Applying flasheff to external SWF

Posted by markr 
Applying flasheff to external SWF
March 24, 2009 01:19PM
Hi,
I have tried to apply flasheff to the external movie clip using the following code but I always get errors:

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

I have tried using an event listener to only apply the effect when the swf is loaded, but it still shows the above error.

var livemovie:MovieClip;
var thisLoader:Loader = new Loader();
thisLoader.contentLoaderInfo.addEventListener(Event.INIT, doneLoading);
thisLoader.load( new URLRequest("livesound.swf") );

import com.jumpeye.flashEff.symbol.slide.FESSlide
var myPattern:FESSlide = new FESSlide();
var myEffect:FlashEff = new FlashEff();
myEffect.showTransition = myPattern;
myEffect.showDelay = 0;
myEffect.showAutoPlay = false;



function doneLoading(evt:Event):void {
livemovie = MovieClip(thisLoader.content);
stage.addChild(livemovie);

livemovie.addChild(myEffect);
myEffect._targetInstanceName = "livemovie";
myEffect.transitionEffect("show");

}

I am sure I am making a simple mistake, but would apprecaite any help.
Thanks
Re: Applying flasheff to external SWF
March 26, 2009 07:28AM
You haven't set the target. Let's say the target that you want to animate is named: "pic" than you will have to add the following line:
myEffect._targetInstanceName=pic;
put it before this line: myEffect.showTransition = myPattern;
This should do the trick.
Re: Applying flasheff to external SWF
March 26, 2009 09:29PM
Thanks for the response. I am still struggling slightly, I did already have the line myEffect._targetInstanceName="livemovie" lower down in the script, but i have tried it in the position suggested. The target I am trying to apply the effect to is the movieclip livesound.swf which I load dynamically above the flasheff stuff. I get the following errors:

FLASHEFF ERROR: Please add the component to the display list, before setting the _targetInstanceName property.
FLASHEFF WARNING: Please set the target or _targetInstanceName property before applying an effect.

The code stands as follows:

var livemovie:MovieClip;
var thisLoader:Loader = new Loader();
thisLoader.contentLoaderInfo.addEventListener(Event.INIT, doneLoading);
thisLoader.load( new URLRequest("livesound.swf") );

import com.jumpeye.flashEff.symbol.slide.FESSlide
var myPattern:FESSlide = new FESSlide();
var myEffect:FlashEff = new FlashEff();

myEffect._targetInstanceName="livemovie";

myEffect.showTransition = myPattern;
myEffect.showDelay = 0;
myEffect.showAutoPlay = false;



function doneLoading(evt:Event):void {
livemovie = MovieClip(thisLoader.content);
stage.addChild(livemovie);

livemovie.addChild(myEffect);
//myEffect._targetInstanceName = "livemovie";
myEffect.transitionEffect("show");

If anyone could help i'd be really greatful.
Thanks
Re: Applying flasheff to external SWF
March 27, 2009 08:08AM
If it's loaded dynamically you should add the FlashEff affect only when the livemovie.swf has been loaded 100%, otherwise there will be no target and you'll still get the same error.
Re: Applying flasheff to external SWF
April 26, 2009 09:03PM
I know this topic was posted 11 months back but it brings up the questions I have.
I am trying out FlashEff and am wondering what the best way to load a movie (by button click or other) and have the loaded movie play a FlashEff effect upon load. Would this work best with LoaderPro ... (I have read a few thoughts here about LoaderPro and MCTE... it seems that FlashEff is an upgrade and combination of MCTE and TXEff ...) anyway there was a statemtent that one would set up LoaderPro then drag an instance of MCTE into the instance of LoaderPro etc...
Know that I haven't even looked into LoaderPro yet and am not sure of all it's capabilites (ie, can you start the load with a button click) I will find out more and experiment... but my main question again is, what is the best way to load an external swf and have it transition in with FlashEff .... hmmm wouldn't this work if you created the external SWF with an effect that activated onload??? Sorry just musing here... I will give it a try... but it would be good to know the quick and dirty!
Thanks
Re: Applying flasheff to external SWF
April 27, 2009 10:36AM
Put the FlashEff and the target in the same swf that you are going to load in another swf and just loaded as you normally would the effect will load as soon as the swf is loaded.
Re: Applying flasheff to external SWF UnClear! ~ My Solution!
April 29, 2009 07:22PM
HuH! Sorry but that just didn't make any sense to me.
I found the solution using the UILoader Component!!!
I am sure there are other ways to do this, but I am pressed to find them in your forum or your tutorials.
I think I will post the solution as a Tip or Tutorial in another post so it is easier to find.

Others here have commented that there needs to be a more comprehensive tutorial/example section..
I whole heartedly agree. at least for some rather common uses.... like loading an external swf with FlashEff working on the load.
I used your InteractiveButtons.swf example to sort out the load external swf issue and I will attach that file for others to see.
Now I am starting to like FlashEff... but you guys could make it a lot easier to like if you supported it more clearly.
Sorry, you do not have permission to post/reply in this forum.