Yes there is, I’ve done this for creating my transitions ( when a button on main is clicked the external SWF goes to a certain frame ). What i did is this :
I made advantage of the fact that when an external movie is loaded into the main, they share the same root. I put a variable in _root (here it’s called [COLOR=RED]movietoplay[/COLOR]) that holds the name of the movieclip that should play when the button is clicked. I added this code to the buttons on the main swf :
[AS]on (release){_root.movietoplay = “any_value”}[/AS]
At the site i made using this i have buttons called SKINS, MAPS, …
So when you click skins, [COLOR=RED]_root.movietoplay[/COLOR] is set to [COLOR=RED]skins[/COLOR]. You should give this variable a name that suits the button.
In the external SWF, I’ve put a movieclip that checks if the variable [COLOR=RED]_root.movietoplay[/COLOR] has changed, and if it has, it goes to a certain frame :
[AS]onClipEvent(load){
_root.movietoplay = “nameofthecurrentmovie”
}
onClipEvent(enterFrame){
if (_root.movietoplay != “nameofthecurrentmovie”{
_parent.gotoAndPlay(framenumber)
}
}
[/AS]
Of course, the movie which you want to go to a certain frame has to have a stop(); action on the frame right before the frame number you want it to go when a button on the main stage is clicked
IMPORTANT:
-
This movieclip has to be on the entire timeline until at the point where you want it to go to another frame when clicking a button on the main stage eg if you want the movie to go to frame 38 when a button on the main stage is clicked, the movieclip has be on the stage from frame 1 to frame 37, 37 included.
-
There can NOT be a keyframe at the last frame in which the movieclip is on the stage ( in the example above, there can’t be a keyframe at frame 37 )
-
This code will work if you put the movieclip on the timeline which you want to go to a certain frame. If not, the code _parent.goto… has to change accordingly to the stacking depth.
-
At the last frame of the external SWF, these actions have to be applied :
[AS]_root.movieclipwhereyouloadinto.loadMovie(_root.movietoplay+".swf");[/AS]
This is an essential part: the filename you give the external SWF has to match the name you gave in the code above :
[AS]onClipEvent(load){
_root.movietoplay = “nameofthecurrentmovie”
}
onClipEvent(enterFrame){
if (_root.movietoplay != “nameofthecurrentmovie”{
_parent.gotoAndPlay(framenumber)
}
}
nameofthecurrentmovie should match your filename eg if you would keep the variable nameofthecurrentmovie your fla ( and with it your SWF ) should be named nameofthecurrentmovie.fla
[/AS]
So here is what it will do: if a button on the main stage is clicked, _root.movietoplay changes value. The movie that is currently playing will detect this and go to the frame you specified, and when it’s done playing the frame(s) after that specific frame, it loads another mc. You can leave this option out, just delete the code of the last frame at the external SWF.
Wow i’ve typed so much that somebody has probably already answered :beam: