Effect over a movieclip dinamically created

Posted by pacoraya 
Effect over a movieclip dinamically created
March 09, 2009 10:16PM
In the firts frame of the timeline of my fla I have this code:

import LoaderExample;

var mcImage:MovieClip = new MovieClip();
var foto:LoaderExample = new LoaderExample();
foto.x = 50;
foto.LoadImage("1");

this.addChild(mcImage);
mcImage.addChild(foto);

import com.jumpeye.flashEff.symbol.alpha.FESAlpha;
var myPattern:FESAlpha = new FESAlpha();
var myEffect:FlashEff = new FlashEff();
myEffect.showTransition = myPattern;
myEffect.showDelay = 0;
myEffect.showAutoPlay = false;
mcImage.addChild(myEffect);

myEffect._targetInstanceName = "mcImage";
myEffect.transitionEffect("show");


The image is loaded but don't the effect, and give me this errors:

FLASHEFF ERROR: Target must be a non-null DisplayObject.
FLASHEFF WARNING: Please set the target or _targetInstanceName property before applying an effect.

Thank you for the support.
Re: Effect over a movieclip dinamically created
March 10, 2009 09:01AM
You have to wait until the image is loaded completely before you can add the effect.
Create a listener to listen to the loader complete event, there you should add the effect over the image and start the transition.
Sorry, you do not have permission to post/reply in this forum.