How does one send information into Flash? Basically I have a flash navigation bar embedded into a web page with a few buttons for different pages. You click a button, and it does a getURL() for that page. But, I also want the flash file to know what page it's on. It's actually using PHP. The entire thing is on index.php, and different pages are called by index.php?page=thispage. index.php will automatically include thispage.php in the content pane. So for example, when I click the home button in Flash, it does getURL("index.php?page=home");
But I want the home button to turn blue and display the sublinks for "Home". I want to do something like
<embed src='navbar.swf?page=home' width='700' height='200'> (Yes I understand I'm not supposed to use Embed, I don't know how to use object yet though). So that the variable 'page' gets sent to flash with the value of 'home'. I've tried using XML, but it's a lot of shuffling files just to tell flash what page it's on. No, I will not create seperate flash nav bars for each page.
Any help?
Sending information into Flash
- Nitrofox125
- DBB Admiral
- Posts: 1848
- Joined: Sun Jul 07, 2002 2:01 am
- Location: Colorado Springs, CO, USA
- Contact:
Any parameters you send a Flash movie as part of the query string -- as you are doing -- or the FlashVars parameter -- the preferred way of doing it -- are automatically created as variables in the root level. So what you're doing ("navbar.swf?page=home") will automatically create the variable _root.page and set it equal to "home". You should really do the following, though:
<embed src="navbar.swf" width="700" height="200" flashvars="page=home">
<embed src="navbar.swf" width="700" height="200" flashvars="page=home">
- Nitrofox125
- DBB Admiral
- Posts: 1848
- Joined: Sun Jul 07, 2002 2:01 am
- Location: Colorado Springs, CO, USA
- Contact:
- Mobius
- DBB_Master
- Posts: 7940
- Joined: Sun Jun 03, 2001 2:01 am
- Location: Christchurch, New Zealand
- Contact:
Repeat after me:
"FLASH IS 99.9% BAD!"
I guarantee you're following almost every rule there is on flash abuse.
"FLASH IS 99.9% BAD!"
I guarantee you're following almost every rule there is on flash abuse.