Sign in to follow this  
Kristafarii

[web] JavaScript to Flash - goto scene and play?

Recommended Posts

Kristafarii    172
I'm trying to use javascript to communicate with a swf movie to tell it to goto and play a particular scene. Now I've know about flash.GotoFrame(n) but I need it goto a particular scene Is this possible or do I need a one scene movie? The following code shows what I'm trying to do...
<script language="JavaScript" type="text/JavaScript">
<!-- 
// jumps to flash frame
function jumpToEmail()
{
	var flash = MM_findObj("flash");  // get flash object	
	flash.gotoAndStop("Email",[1]);     // this doesn't work but you get the idea
}
//-->


(the flash object is being found ok) [Edited by - Kristafarii on June 30, 2005 12:09:58 AM]

Share this post


Link to post
Share on other sites
Kristafarii    172
I haven't had a reply on this all day so here's a bit more info about what I'm trying to do.

If you visit my website www.linknet.com.au/chrisg and offer me a job on the Gold Coast - Australia I'll be very happy :)

but seriously...

If you go to my website you'll see I have the page split into 2 frames with a flash navigation bar at the top.

The Nav bar displays what page is showing in the lower frame. This works fine as long as you use the nav bar, however if you use the browser's back or forward buttona, or use a link in the lower frame then the nav bar doesn't change and so doesn't reflect the current page.

This is why I need to tell the nav bar to goto a particular scene (each scene is for a different page). I really don't want to radically change the way the nav bar works because it's an intricate little beast.

Share this post


Link to post
Share on other sites
Kristafarii    172
Problem solved..
use flash.GotoFrame(n)
and add together the number of frames in the preceeding scenes.

eg.
If each scene is say 100 frames and you want to goto frame 3
then n = 200.

flash.GotoFrame(200);

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this