flash AS help?
- Started
- Last post
- 8 Responses
- airey
alrighty, here's an easy one i have no idea about.
root timeline, first frame: i want to call in an external swf and then tell the external swf to play from a certain label:
this.containerWrapper_insert_mc...
this.containerWrapper_insert_mc... 'hello');any help? the external loads fine but doesn't play from that label (well not at all as the first frame has a stop() action).
- airey0
it clipped it? see below:
this.containerWrapper_
insert_mc.loadMovie('home.swf');
this.containerWrapper
_insert_mc.gotoAndPlay('home.swf... 'hello');
- lvl_130
quick guess, and i'm sure someone will have a more direct solution but...
you need to load the swf, and THEN call the frame label (after the swf is fully loaded). i'm assuming that it's not jumping to the frame label, because there is no frame label to find.
- "no frame label to find. "
what i mean is there is no frame label that is being seen initially.lvl_13
- "no frame label to find. "
- antistatic0
You have to check first if movie is loaded. The best practice is to use built in MoviClipLoader and add listener to onLoadInit. Flash help system is your best friend :)
- plagro0
I think you could be running into issues because the swf isn't fully loaded when you're trying to trigger it. The simple answer is to not use loadMovie and use the movieClipLoader() functions instead. That way you can legitimately trigger the action when the clip has fully loaded instead of running into possible load errors. eg.
var myMCL = new MovieClipLoader();
myMCL.onLoadComplete = function (targetMC)
{
// do whatever
}
myMCL.loadClip(theSWF, theEmptyMovieClip);- actually you have to check .onLoadInit
Only then movie is fully loaded :)antistatic
- actually you have to check .onLoadInit
- airey0
thanks plagro will give that a shot. much appreciated.
- plagro0
In response to antistatic's comment about onLoadInit - you're right, my apologies...
onLoadComplete is triggered when the file is completely loaded but before any of the functionality is loaded (eg gotoAndPlay etc), onLoadInit is triggered after the first frame of the file is loaded, so all of the functionality is available.
airey - simply swap onLoadComplete for onLoadInit in my code above. Also if you've never used it before, check out onLoadProgress which is really useful for making easy loading bars etc
- stewart0
if you want to cut 'n paste some actionscript without loosing characters do it here and paste the hyperlink here
http://flash.pastebin.com/