SitePoint Sponsor

User Tag List

Results 1 to 1 of 1
  1. #1
    SitePoint Member
    Join Date
    Aug 2005
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    filters not working

    In the code below the lower switch case runs first and looks great. The second time through the code the upper switch case runs and that also looks great. Now the problem, the second and as many times through the first upper case the filters don't seem to work right. It appears as if the filter plays then the picture get repainted. I have spent a week working on this problem and my brains are about mush. Is there something I am missing?
    Code:
    	var jj = j;  //Make jj local and it will not change for this loop
    	switch (frameData[0].AdType[jj]){
    	case "image":
    	case "iTextMessage":
    		var oNewEle = getObj('aShow');
    		if(!oNewEle) {
            	var picObj = document.createElement('img');  // Creat dynamically object tag
            	picObj.setAttribute('id','aShow'); // Give id to it
            	picObj.setAttribute("Name", 'currentImage');
            	picObj.setAttribute('alt' , "");
            	picObj.setAttribute('border' , '0');
            	picObj.setAttribute('width', '100%');
            	picObj.setAttribute('height' , '100%');
            	picObj.setAttribute('src' , '');
            	picObj.setAttribute('style', 'position:absolute;visibility:visible;');
            	oNewEle = oDis.appendChild(picObj);
    		}
    		var fil = decode64(frameData[0].ImgTrans[jj]);
        	var titleName = new setTransName(fil,frameData[0].ImgTransTm[jj]/1000);
    		var fr0Pic = 'DXImageTransform.Microsoft.'+titleName.transNam;
    //        aShow.onerror=fnLoad2Fail1;
        	oDis.style.filter = 'progid:DXImageTransform.Microsoft.'+titleName.transDNam;
        	oDis.filters.item(fr0Pic).apply();	 
    	    if(oNewEle.style.backgroundColor)oNewEle.style.backgroundColor='';
        	if(oDiv.innerText)oDiv.innerText = '';
            oNewEle.src = PImages[jj].src;
        	oDis.filters.item(fr0Pic).play();
    		if (frameData[0].AdType[jj] == 'iTextMessage'){
        		var timeoutArgs = 'im0 = new ShowMessagePlay('+jj+',0,\"'+oDiv.id+'\",\"'+oCon.id+'\")';
    			mt0=setTimeout(timeoutArgs, frameData[0].ImgTransTm[jj]);  //wait for filter to finish befor showing message
    		}
            break ;
        case "TextMessage":
    		var oNewEle = getObj('aShow');
    		if(!oNewEle) {
            	var bkgObj = document.createElement('img');  // Creat dynamically object tag
            	bkgObj.setAttribute('id','aShow'); // Give id to it
            	bkgObj.setAttribute("Name", 'currentImage');
    //        	this.bkgObj.setAttribute('background-color',"");
            	bkgObj.setAttribute('alt' , '');
            	bkgObj.setAttribute('style', 'position:absolute;visibility:visible;');
            	oNewEle = oDis.appendChild(bkgObj);
    		}	
          	oNewEle.style.visibility = 'visible';
    		var fil = decode64(frameData[0].ImgTrans[jj]);
        	var titleName = new setTransName(fil,frameData[0].ImgTransTm[jj]/1000);
    //        aShow.onerror=fnLoadFail2;
            oNewEle.style.width = '100%';
        	oDis.style.filter = 'progid:DXImageTransform.Microsoft.'+titleName.transDNam;
    //     	oBkg.style.visibility = 'hidden';
    //		oDiv.innerHTML = '';
            if (oNewEle.getAttribute('src')) oNewEle.removeAttribute('src');
        	oDis.filters.item('DXImageTransform.Microsoft.'+titleName.transNam).apply();	 
        	oNewEle.style.backgroundColor = frameData[0].BgColor[jj];
    //    	if(oDiv.innerHTML)oDiv.innerHTML = '';
          	oNewEle.style.visibility = 'visible';
        	oDis.filters.item('DXImageTransform.Microsoft.'+titleName.transNam).play();
    //alert("Time to display :"+oBkg.filters.item('progid:DXImageTransform.Microsoft.'+fil).duration); 
        	var timeoutArgs = 'im0 = new ShowMessagePlay('+jj+',0,\"'+oDiv.id+'\",\"'+oCon.id+'\")';
    		mt0=setTimeout(timeoutArgs, frameData[0].ImgTransTm[jj]);  //wait for filter to finish befor showing message
    		break;
        }  //end switch
    Thanks for any help,
    Michael
    Last edited by stymiee; Aug 14, 2006 at 14:49.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •