Tutorial question: 'Transitions between external SWFs'

I just read the ‘Transitions between external SWFs’ tutorial. Now I have a question… in the example used, the buttons for switching between SWF movies are part of the movie. Is it also possible to control/navigate between movies from outside of the Flash file?

I mean, I want to place my navigating buttons in HTML. Is that going to be a problem?

no, it is not going to be a problem, but you would have to use flashvars to “communicate” with the swf that makes the transitions.
see http://www.kirupaforum.com/forums/showpost.php?p=473066&postcount=4

Okay, that looks pretty easy…

However, I need to do two things:

  1. Tell the current movie1.swf to ‘fade out’ (goto frame xx)
  2. After movie1.swf faded out, I need to load movie2.swf/movie3.swf/movie4.swf/… etc. depending on the button I clicked.

How can I make the browser do these two things? If I read your post correctly, it only takes care of step 1. Or am I missing something?

hmmm… I don’t think flashvars is what you are looking for :frowning: sorry
what you want can most likely be done with javascript, but I have no experience with javascript and flash working toghether, so i wouldn’t know…
this might be something:
http://www.kirupaforum.com/forums/showthread.php?t=20098&highlight=javascript+variable

http://www.kirupaforum.com/forums/showthread.php?t=3209&highlight=javascript+variable

http://www.kirupaforum.com/forums/showthread.php?t=41281&highlight=javascript+variable

Each swf loads _root.curMovie + “.swf” when it reaches it’s last frame. So what i guess you’d have to do is create the functions that are normally on the buttons on the main timeline (edited where necessary), and then call those functions through JavaScript. However, I wouldn’t know how to do call a function in flash from JavaScript. Maybe you could do it with the example from the first thread Kalliban linked to and the watch method … so that if the variable changes (through JS) it executes a function (the button function).

hmm, no idea how to do it but i read you can communicate with javascript and flash using the fscommand. NO idea how to do it though…

yeah, as voets said, you would have to make a javascript function that changes the _root.curMovie variable. I’ll experiment a little, to see what I can do :wink:
I’ll keep you updated

I know how to execute JavaScript function from Flash using fscommand, but I don’t know how to execute Flash functions from JavaScript … lemme search and see if I can find anything.

Thanks guys… really appreciate your help! I’ll keep watching this thread.

I think this says it all… :smiley:
http://www.macromedia.com/support/flash/ts/documents/flash_to_flash_comm.htm

http://www.kirupaforum.com/forums/showthread.php?t=55254
http://www.macromedia.com/support/flash/ts/documents/set_variables.htm#javascript
:wink: