Question
Loading External JPEGs with a fade
I am working in AS3 to load some external jpeg images and
have them fade in after they are loaded. I have this code, which
does exactly what I want it to if I am loading a .swf file. But
when I try to load a jpeg I get an error. What do I need to change
to use a jpeg? Any insight would be greatly appeciated. Thanks.
import fl.transitions.*;
import fl.transitions.easing.*;
var myRequest:URLRequest = new URLRequest("image1.jpg");
var myLoader:Loader = new Loader();
myLoader.load(myRequest);
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoaded);
function swfLoaded(myEvent:Event):void {
stage.addChild(myLoader);
var myContent:MovieClip = myEvent.target.content;
TransitionManager.start(myContent, {type:Fade, direction:Transition.IN, duration:9, easing:Strong.easeOut});
}
import fl.transitions.*;
import fl.transitions.easing.*;
var myRequest:URLRequest = new URLRequest("image1.jpg");
var myLoader:Loader = new Loader();
myLoader.load(myRequest);
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoaded);
function swfLoaded(myEvent:Event):void {
stage.addChild(myLoader);
var myContent:MovieClip = myEvent.target.content;
TransitionManager.start(myContent, {type:Fade, direction:Transition.IN, duration:9, easing:Strong.easeOut});
}