?
Solved

Actionscript: Pass target and page as parameters.

Posted on 2003-10-28
5
Medium Priority
?
164 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 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
Suggested Courses

741 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