-
fade external image
Hi
Can anyone help me with fading in external images into the movie clip please?
Here is my code:
Code:
function loadImage(url:String):void {
imageLoader = new Loader();
imageLoader.load(new URLRequest(url));
imageLoader.contentLoaderInfo.addEventListener(ProgressEven t.PROGRESS, imageLoading);
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLE TE, imageLoaded);
}
loadImage("imgs/" + pic + ".jpg");
function imageLoaded(e:Event):void {
if (pic_mc.loadedImage) {
pic_mc.removeChild( pic_mc.loadedImage );
}
pic_mc.loadedImage=imageLoader;
pic_mc.addChild(imageLoader);
}
Many thanks
Last edited by pcmac; 02-27-2013 at 06:41 AM.
-
Senior Member
using TweenLite that could be TweenLite.from (imageLoader, 2, {alpha: 0 }); iirc
-
Originally Posted by realMakc
using TweenLite that could be TweenLite.from (imageLoader, 2, {alpha: 0 }); iirc
Any chance you can help me further with this please? When I tried fading in the image, it faded in the movie clip just the once.
Many thanks looking forward to hearing form you.
-
Senior Member
you need to put it at the end of imageLoaded, I think
-
Is there a way to find out what class needs to be imported for my script to work?
I am getting a type error for this line of code:
Code:
var TweenTarget:DispayObject=e.target as DisplayObject;
I have imported:
Code:
import flash.display.DisplayObject
This is the error:
Code:
1046: Type was not found or was not a compile-time constant: DispayObject.
Any ideas?
Thanks
-
Senior Member
what you really need is good code editor like flashdevelop or fdt you missed L in Disp_ayObject.
-
Originally Posted by realMakc
what you really need is good code editor like flashdevelop or fdt you missed L in Disp_ayObject.
Lol oh my god.thanks realMakc you've really helped me out today. Thanks a lot!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|