Page 1 of 1

Sending information into Flash

Posted: Fri Jan 07, 2005 3:10 pm
by Nitrofox125
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?

Posted: Fri Jan 07, 2005 3:43 pm
by DCrazy
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">

Posted: Sat Jan 08, 2005 7:19 am
by Nitrofox125
SWEET! Thats.... incredibly simple!

Posted: Sun Jan 09, 2005 1:40 pm
by Mobius
Repeat after me:

"FLASH IS 99.9% BAD!"

I guarantee you're following almost every rule there is on flash abuse.

Posted: Sun Jan 09, 2005 2:03 pm
by DCrazy
I was waiting for that.

Nitrofox, I'm sure you've learned by now to completely ignore anything Mobius says.

Posted: Sun Jan 09, 2005 6:51 pm
by Krom
DCrazy wrote:I was waiting for that.

Nitrofox, I'm sure you've learned by now to completely ignore anything Mobius says.
Agreed, I think we all saw that coming.

Posted: Sun Jan 09, 2005 6:53 pm
by Top Gun
This pic gets more use than any other here :P:

Image

Posted: Sun Jan 09, 2005 6:55 pm
by DCrazy
You know, this thread probably would have been better suited to the Coders' Corner for 2 reasons...

1) It's more appropriate there.
2) I could edit out Mobius's post. :P