Display list and FlashEffect? - Reseting the component?

Posted by terablade2001 
Display list and FlashEffect? - Reseting the component?
March 13, 2009 09:20PM
Hello,
I am trying to create an application in flash, using Flash Effect (FLEFF), and I notice that when I apply i.e. show() of FLEFF to a movieclip, it is removed from it's current position in display list. Where it goes?.. The problem occurs when I want to remove that Movieclip from displaylist with removeChild(), but I get errors that it doesn't exist!

A simple example, adding a MovieClip - named "mv" and a FLEFF component (named "flEff") in the stage which I setup from windows panel. Using the code:

var i;
trace("BEFORE: ");
for (i=0; i < numChildren; i++) { trace( getChildAt(i).name); }

flEff.target=mv;
flEff.show();
trace("AFTER: ");
for (i=0; i < numChildren; i++) { trace( getChildAt(i).name); }


I get:

BEFORE:
mv
flEff
AFTER:
flEff


It's obvious that the "mv" movieclip is not now at the Display list that I had it.
Where is it now?..
How can I revert it back to it's position, and release it's connection to flEff-instance?

And how can I remove it from FLEFF instance, and utilize the same FLEFF instance to show() another movieclip without problems, without loosing the animation configuration of FLEFF (which I set-up from the fl-panel and thus don't have actionscript code)? -- without using the removeAll() function

Trying: flEff.target=null; I get always error: FLASHEFF ERROR: Target must be a non-null DisplayObject. .. Although the "mv" object becomes "free" and returns to the display list - is it correct to do this action, that way? or it may create problems in the application?
Thank you...



Edited 2 time(s). Last edit at 03/13/2009 09:29PM by terablade2001.
Re: Display list and FlashEffect? - Reseting the component?
March 13, 2009 10:15PM
The way I found to overcome this issue, is to create an empty invisible Sprite(), and when the Animation of FLEFF finished (checking the "isTransitioning" variable) to set the FLEFF.target property to that sprite:

var S = new Sprite(); S.visible=false; addChild(S);
flEff.target=mv; flEff.show(); addEventListener(Event.ENTER_FRAME, oEF_Check);
function oEF_Check(e:Event) {
if (flEff.isTransitioning == false) {
flEff.target=S;
removeEventListener(Event.ENTER_FRAME, oEF_Check);
}
}
....
Sorry, you do not have permission to post/reply in this forum.