Dynamically start staged FlashEff instance

Posted by jensworld 
Dynamically start staged FlashEff instance
March 23, 2009 01:05PM
I've already setup my FlashEff component on the stage and want to not autoplay, but start it dynamically (i.e. say, on mouse click) - how do I do that? Most of the examples I'm seeing are creating the FlashEff instance dynamically as well, but I need to start one that has already been setup in the timeline.
Re: Dynamically start staged FlashEff instance
March 23, 2009 01:34PM
Create an event listener on a button and then add the following code in the function:
FlashEffInstanceName.show();
That will start showing the transition. Instead the show() you can use hide() to hide the transition.
Re: Dynamically start staged FlashEff instance
March 23, 2009 01:56PM
Precisely what I tried. I have something like this in my document class - where myFlashEff is the instance name of FlashEff on the stage. The FlashEff instance's auto play under the show tab is unchecked:

public function docClass() {
startFlashEff();
}

public function startFlashEff():void {
myFlashEff.show();
}

...I get this error:
FLASHEFF WARNING: Please set the target or _targetInstanceName property before applying an effect.


If I comment out myFlashEff.show() and check the FlashEff instance's autoplay, everything works fine, but of course, its automatically playing.
Re: Dynamically start staged FlashEff instance
May 11, 2009 04:13PM
Did you find a solution to this problem? I want to add brightness or a glow to a movieclip when the mouse is over it. I didn't understand how to do it. :-)
Re: Dynamically start staged FlashEff instance
May 12, 2009 07:08AM
jensworld,
Write this above the show() method to see if you have a target set.
trace( myFlashEff._targetInstanceName )
Are you using a loader to load an image? If so, make sure you add the effect only when the image has loaded 100%
tania,
To add a button pattern to a movie clip just set it from the panel, go to the button tab and its pretty self explanatory from there.
Re: Dynamically start staged FlashEff instance
April 10, 2014 09:26AM
Re: Dynamically start staged FlashEff instance
June 15, 2015 01:13PM
Good information always helps those who read it. Thank for sharing.
DesireLeather.com
Re: Dynamically start staged FlashEff instance
July 22, 2015 05:21AM
I really liked this article and i appreciate good content as always I do have lots of good content about
Visit This Dean Winchester Coat
Sorry, you do not have permission to post/reply in this forum.