views:

7

answers:

0

Dear Frnds,

I have my own actionscript to call Randon Images through XML.

Now what i want that to add some fading effect in it.

But donot know how to do this.

Because I don't have the deep knowledge of flash/ActionScript.

so plzzzz help me.

thnxs in advance.........

I am putting my actionscript given below.

/* Flashandmath.com tutorial by Doug Ensley. See "Loading Random Images from an XML List in Flash CS3" in the Basic section for documentation.

Last modified on August 13, 2008. */

var pHeight:Number = 200; var pWidth:Number = 200;

var listLoader:URLLoader = new URLLoader( new URLRequest("filelist.xml") ); var picLoader:Loader = new Loader();

listLoader.addEventListener(Event.COMPLETE, gotList);

function gotList(evt:Event):void { var xmlData:XML = XML(listLoader.data); var numImages:Number = xmlData.pix.length();

var stImage:String = xmlData.pix[Math.floor(numImages*Math.random())].toString();

picLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, gotPic); picLoader.load( new URLRequest(stImage) );

listLoader.removeEventListener(Event.COMPLETE, gotList); }

function gotPic(evt:Event):void { var thisBmp:Bitmap = Bitmap(evt.target.content); thisBmp.x = 0; thisBmp.y = 0; var thisWidth:Number = thisBmp.width; var thisHeight:Number = thisBmp.height;

thisBmp.scaleX = pWidth/thisWidth; thisBmp.scaleY = pHeight/thisHeight; addChild(thisBmp); // package(thisBmp); picLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, gotPic); }