How to load external image with transition effect?

Hi,

How can I do some transition effect while loading the external image.

The following code is not working. The “picture.png” only waits 3 seconds and appear without any transition effect.

import fl.transitions.;
import fl.transitions.easing.
;

var loader:Loader = new Loader()
image_mc.addChild(loader)
loader.load(new URLRequest(“picture.png”))

// apply wipe transition
TransitionManager.start(image_mc, {type:Wipe, direction:Transition.IN, duration:3, easing:None.easeNone, startPoint:1});

Best regards

Alex

Hi Ahmed,

Thanks for your help. It works:)

I visited your website. What a wide variety of web design and computer skills you have! And the websites you designed for your clients are really very beautiful.

Thanks and best regards

Alex

I tried to apply Tweener to this but I’m coming up short somewhere?



import caurina.transitions.*;

var loader:Loader = new Loader()
mcImage.addChild(loader)
loader.load(new URLRequest("picture.jpg"))


loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadTheImage);


function loadTheImage(){
    Tweener.addTween(mcImage, {alpha:1,time:1, onComplete:timer1, transition:"easeoutExpo"});
}


Any ideas?

[quote=reblis;2333667]I tried to apply Tweener to this but I’m coming up short somewhere?



import caurina.transitions.*;

var loader:Loader = new Loader()
mcImage.addChild(loader)
loader.load(new URLRequest("picture.jpg"))


loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadTheImage);


function loadTheImage(){
    Tweener.addTween(mcImage, {alpha:1,time:1, onComplete:timer1, transition:"easeoutExpo"});
}


Any ideas?[/quote]

I think that the error is here onComplete:function() I mean you have to call a function after onComplete event.
But I m not an expert… try read the documentation of caurina http://hosted.zeh.com.br/tweener/docs/en-us/ maybe it ll give some answers.

yeah that is a good catch but that wasn’t the problem.

Here is my new code that still doesn’t work. I figure I have to make the mcImage.alpha = 0 before and then fade it p but for some reason it’s not recognizing it.
I’m also getting this error;
ArgumentError: Error #1063: Argument count mismatch on imageloader_fla::MainTimeline/startLoad(). Expected 0, got 1.



import caurina.transitions.*;

var loader:Loader = new Loader()
mcImage.addChild(loader)
loader.load(new URLRequest("picture.jpg"))


loader.contentLoaderInfo.addEventListener(Event.COMPLETE,startLoad);


function startLoad(){
    Tweener.addTween(mcImage, {alpha:0,time:1, onComplete:loadTheImage, transition:"easeoutExpo"});
}

function loadTheImage(){
    Tweener.addTween(mcImage, {alpha:1,time:5, transition:"easeoutExpo"});
}

[quote=reblis;2333762]yeah that is a good catch but that wasn’t the problem.

Here is my new code that still doesn’t work. I figure I have to make the mcImage.alpha = 0 before and then fade it p but for some reason it’s not recognizing it.
I’m also getting this error;
ArgumentError: Error #1063: Argument count mismatch on imageloader_fla::MainTimeline/startLoad(). Expected 0, got 1.



import caurina.transitions.*;

var loader:Loader = new Loader()
mcImage.addChild(loader)
loader.load(new URLRequest("picture.jpg"))


loader.contentLoaderInfo.addEventListener(Event.COMPLETE,startLoad);


function startLoad(){
    Tweener.addTween(mcImage, {alpha:0,time:1, onComplete:loadTheImage, transition:"easeoutExpo"});
}

function loadTheImage(){
    Tweener.addTween(mcImage, {alpha:1,time:5, transition:"easeoutExpo"});
}

[/quote]

Ok then maybe… I say maybe… try this
function startLoad([COLOR=DeepSkyBlue]e:Event[/COLOR]):void { blah blah…
Place the e:Event into the function…I really don’t know how to call this!

Event callbacks always needs one paremeter

function startLoad(event:Event){