Interaction between two SWF files

I wish to be able to use a Flash animation (call it “one.swf, loaded into “one.html””) as a control panel to control the activities in another animation (say “two.swf” which of course will reside in “two.html”)

The control panel (“one.swf”) will have 10 buttons for the navigation around “two.swf” and “on release” of the butons, I would like for BOTH 1. the navigation in “two.swf” to happen AND 2. “one.swf” to be (preferably) minimised or else closed.

What sort of coding is needed to enable this interaction between the two swf files?

There will be a button on “two.swf” which will be used to call up “one.swf”, but presumably the coding there will need to be different if “one.swf” is minimised to how it is if it is closed. Whilst I can hack opening “one.swf” from fresh if it has been closed, how do I code the button to restore it from being minimised?

hi martin–i’ll take a crack at your problem:
first off, everything should happen inside one movie, call it “main.swf” and it resides in ‘index.html’–you shouldn’t have/need a second .html page unless you are doing server/database stuff–otherwise, everything should be done inside ‘index.html’ (this is a key advantage of flash, that you ‘maintain state’ and that everything happens inside the same html page)

i’ve found that loading an external .swf to control the navigation can be clunky, having to move back and forth between movies, and worry about levels, etc.–for this reason, i’d recommend making ‘navMC’ inside ‘main.fla’ (if you have a particular reason why you want to load the nav, let me know and i can work you thru the process to do it that way, but it’s much less straitghtforward, and i don’t know what is gained)

to make ‘navMC,’ lay out your buttons, select them and hit ‘make new symbol’. inside new symbol, make a blank keyframe in the second frame, and drag all the buttons to the second frame, leaving the first frame blank. make an actions layer w. 2 keyframes and put a ‘stop()’ in each. then click to the outside of your MC and name it ‘nav’.
back inside, on each button attach a script like this:
loadMovieNum(“one.swf”, 1);
//hide nav buttons
(keep all your layers the same if you want to replace loaded .swfs each time a new one is loaded)

that’s it–all you need is a button or something to trigger navMC to goto frame2 and show the buttons when needed…
good luck!

thanks for taking the time to reply Mojo. The purpose of the separate html file was to have a control panel which could be dragged around the screen to the users content. Hey if that can be done within Flash then so much the better.

It would also have the advantage of sharing a (rather large) movie clip with the main page, although it would bloat the size of the main swf file, which will then need some other way to minimise download time (I was going to look into how to stream load as well in due course)

If you don’t mind me taking advantage of your offer to help, if you can PM me your e-mail address, I’ll send you my FLA files so that you can see where I am at. Except for the Actionscript governing the behaviour of the buttons, the control panel is finished, but the main site is just getting started.

Hope you don’t mind helping someone at the lower reaches of the learning curve, and your assistance is appreciated.



do you mean you want an html popup window that controls the main html window? thats kinda possible, but it isn’t really a great solution–you can do the popup in flash while keeping everything in the same html frame–i’ll pm you my email and you can drop me your files, with more of an explanation of what you are trying to do–i may not have time today, but i’ll look them over and let you know what i think–it seems like its just a structure thing, and once i explain it, it’ll make more sense…