Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: FLASH: Controlling a Flash movie from JavaScript.
From: Bonney, Mark
Date: Fri, 4 Aug 2000 00:05:28 +0100

This is my first post to the list so hopefully this question has not been
asked before.

I'm setting up a WBT course where the content is running inside of a few
browser frames. The first frame is the navigation controls, the second the
text (content),
And the third is the graphics/animation area. The text area gets loaded
with html pages of text. The graphic area gets loaded once with a Flash
file and the contents
within the Flash file get changed (a movie in one layer is replaced by a new
one).

The way it should work is when the user select a page (via navigation or
menu), the HTML page loads in the text area first, then the Flash file loads
and finally the page number is determined and the navigation controls load.
The HTML that loads in the text area contains calls to JavaScript which are
suppose to be instructions to Flash as to which movie is to be loaded.

The problem is that the HTML is loading, the data is passed to the Flash
file via the JavaScript, but the new movie is not being loaded.

In the HTML file I call a JavaScript function called LoadGraphic, passing
the name of the swf file to be loaded. In the JavaScript I set the myMovie
variable in the Flash file to the name of the movie I want loaded. I've
used text fields and verified that in fact the variable within Flash is
being set to the name of the new movie to load. The problem is with the
LoadMovie method. It seems that in Flash I can specify the swf file to load
and the movie instance to be replaced. This would work except that the
variable to contain the new movie name is not set until after the code to
load the movie is played (timing issue between HTML, JavaScript, and Flash).
So, I've tried to load the movie from JavaScript using the LoadMovie. The
JavaScript LoadMovie does not use an instance name instead, it uses a layer
number.

My question is this: Is there a relationship between the layer number for
the JavaScript LoadMovie and the instance name for the movie? If so, where
can I see that relationship within Flash? If not, how can I load the movie
from JavaScript using the instance name of the movie to be replaced. I
cannot find a way to use the layer number with JavaScript because the new
movie to be loaded needs to play within (masked in a layer) within the main
movie (creates a TV bevel around the new movie).

If this is not possible are there any suggestions as to how I can play
multiple movies in Flash that are based on the page that the student goes to
within the course?

Thanks
Mark Bonney
Multimedia Programmer
Marconi Services

Ethernet (n): something used to catch the etherbunny.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Full flasher archive now available online at:
http://www.chinwag.com/flasher/archive.shtml
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  Re: FLASH: Controlling a Flash movie fro, Mike S

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]