More Flash Help
- Started
- Last post
- 11 Responses
- skonge
I have 4 buttons in a movie. They all load the same swf into level 16, but i would like each one to goto a different frame label in that movie. Is this possible?
thanks
- derrickito0
yes
- shant0
why do people load into levels?
- skonge0
how do u load it if its not in a level?
- justarobot0
you can use the attachMovie() method, but if you're loading into another level try using something like "newMovie.swf?frame=10" and have it look out for the var in the newMovie.swf. Or you could use global variables, but it gets confusing.
good luck.
- jkosoy0
first off, loading into levels is...depreciated. i'd suggest loading into movie clips. you have MUCH more control and the code is no different, even at its most basic stage.
loadMovie("movie.swf","movieClip...
or more properly
movieClipName.loadMovie("movie.s...
either way, there is a small bug (i would call it a bug) that forces you to wait for the movie to actually load before you can send it commands. so whether you load it into a level or a movieclip, wait a frame or two before you send it the gotoAndPlay(); command.
if you're careful, the user will never see the difference.
- skonge0
Ok. i got it to load into a blank movie clip. How do I specify which frame to go to?
on (release) {
loadMovie("webpopup.swf", "/blankclip");
}I need to go specific frames in webpopup.swf depending on which button is clicked.
I appreciate the help!
- jkosoy0
/blankclip? / works in AS? weird.
assuming your buttons are named "ringo","john","paul" and "george".
var mc_name = this._name;
if(mc_name == "ringo")
{
/blankclip.gotoAndPlay(1);
}
else if (mc_name == "john")
{
/blankclip.gotoAndPlay(1000);
}
else if(mc_name == "george")
{
// you get the idea.
}this is hardly modular programming, but it'll do what you want it to. :)
- phirschybar0
I think the only real benefit to loading into a level is that you can use _root in that movie to access the root of the movie wheras with loading into a MC, when you use _root, you are accessing the PARENT'S _root timeline.
- jkosoy0
swapping depths is nice, too.
though I do believe there's a way to swap layers as of MX though for some reason I've yet to use it.
- skonge0
Once the swf is loaded into the blank movie clip can it be controlled like a regular movie clip?
- arlo0
As long as the clip has an instance name, its just like a normal target. _root.blankClip.gotoAndPlay(what...
I would set a var that indicates what frame to go to and then have the clip check for that var and route accordingly.