Solved

Actionscript: Pass target and page as parameters.

Posted on 2003-10-28
5
158 Views
Last Modified: 2010-04-03
I have an intro flash which I would like to use on multiple pages.  I would like to pass the target and the page name so I can use the same flash on all the pages.  When the flash intro is complete, it would forward to the page and in the frame specified.

Thanks!
Doug
0
Comment
Question by:coders4hire
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 5

Expert Comment

by:Calron
ID: 9639899
0
 

Author Comment

by:coders4hire
ID: 9641085
Calron,
The FlashVars seem to be it - but I don't know how to code it in the swf.  I will read on, though.  I don't see the javascript example showing it.

negatyve,
This only appears to be 6 buttons coded to different frames... not passed to the swf as a parameter.
0
 
LVL 27

Expert Comment

by:negatyve
ID: 9641111
>not passed to the swf as a parameter.

actually they are. if you click on the button with the label "Frame 5", you will see the url in the address bar:

http://flash-mx.html.it/guide/swf/negatyve_javascript/gotoFrameURL/filmato.html?frame=5

as you can see, frame is passed as a variable via http url.
then this variable is passed to flash via javascript:

+ '<EMBED src="filmato.swf' +document.location.search+'" '

and read inside flash:

gotoAndStop(Number(frame));

Have you downloaded the example source?
0
 
LVL 5

Accepted Solution

by:
Calron earned 125 total points
ID: 9641121
Well, what you do is add the flashvars part to your html tags where you embed the swf (i usually go for both ways, adding it in the embed and as a separate param tag). That way it should work for both IE and other browsers.

lets say you have this:

<PARAM NAME=FlashVars VALUE="foo=Hello%20World&paragraph=first+line%0Dsecond+line">

you will have two variables available in your main timeline names foo and paragraph. Just check their content and react to it.

The javascript example uses this function found in flashpage.htm to pass a variable to the swf:

function setPage(newPage) {

      //check if Flash object exists
      if (window.document.mymovie) {
            //set page variable in _root timeline of Flash movie
            window.document.mymovie.SetVariable("page", newPage);
      }
}
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to record live broadcast.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question