FLASH—target specific frame from external swf
- Started
- Last post
- 9 Responses
- steadyvibe
What is the best way to target a specific frame from an exterally loaded swf?
- unfittoprint0
targetMC = _parent.mc;
targetMC.gotoAndStop("label");
- fate0
target a frame? what now? you mean test what frame it's on with _currentframe or something? You cannot target a frame.
_level1._currentframe
or
_loadSWFMC._currentframe
- contra0
this._parent.mypath
or
_root.mypath
or
_level0.mypath (if the external swf is loaded into a level instead of a container mc)
- steadyvibe0
It is coming from an external swf so it has to be loaded first.. how can that be done?
- caseyc0
"target a specific frame" by that do you mean "go to a specific frame"?
Sounds like you are trying to load a swf and then do something like loaded_mc.gotoAndStop(10) right?
If that is the case, you will have to load the swf, and set some kind of loop to see if the frame you want is loaded and if so jump to it...
this.createEmptyMovieClip("load...
load_mc.loadMovie("some.swf");
this.onEnterFrame = function() {
var theFrame = 50;
if(load_mc._framesloaded > theFrame) {
load_mc.gotoAndStop(theFrame);
delete this.onEnterFrame;
}
}Is that what you are looking for??
- steadyvibe0
yes, the movie isnt loaded so it cant go to the frame.. So i have tried preloading it into an empty movie clip in the backgroudn where you cant see it. But that didnt work. Im confused
- steadyvibe0
help?
- steadyvibe0
could i just make 5 differnt empty mc's and put them on hte stage. then set all the visibilities to 0 except the one i want??? Then they would always be loaded and it could go to the frame?
- tparsons0
In your index.swf load the first external swf into layer 1
like so
loadMovie("movie01.swf", 1)If you don't want it to play on load put a blank key frame and frame one with a stop action on it.
When you want to talk to the .swf in level one make a blank key frame and label it with some name. Then do this to talk to it on that labeled frame.
on (press) {
_level1.gotoAndPlay ("labelname_here");
}That's for a button but you can do it just on a keyframe also.
Very simple solution to what I think is your issue.