Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-07-2004, 07:12 PM   #1
laphan
Registered User
 
Join Date: Dec 2004
Posts: 1
Default NEWBIE - Passing dynamic value to Flash movie

Hi All

I apologise in advance, but I am a complete newbie when it comes to Flash and although I am trying to grasp it, I'm being pressured into sorting an issue out that I hope you can help me with.

Basically I have a web site that has a flash movie/anim on it that plays music. I have buttons on this flash movie to turn the music on and off, but as the user clicks through each page in my web site the whole page gets refreshed (I don't want to use Frames) and therefore the flash movie restarts the music each time a new page of the site is displayed.

My plan was to keep track of the user's on/off preference using simple ASP querystring requesting, but I don't know how to do the followng:

1) What code do I need to use to parse 1 flag value to the Flash Moive? The value can simply be on for music on and off for music off. That is all I need.

2) The Flash movie I have used is not mine, but I believe I can see the general idea of how the bg music is setup. In the actual fla/swf how would I retrieve this parsed value and if then else the sound to play or not play?

Would it be best to call the sound on/off routines with this flag result? If so, how would one do this?

Many thanks for any help you can give.

Rgds Laphan
laphan is offline   Reply With Quote
Old 12-07-2004, 11:13 PM   #2
simonboris
HK510
 
simonboris's Avatar
 
Join Date: Nov 2001
Location: Montreal
Posts: 290
Default

Allright, in your html, where you set the parameter of your swf you can simply add a variable and value like this:

"yourMovie.swf?Sound=Off"

this will create a variable named "Sound" in your flash movie, on the main timeline (_root) with the value "Off". So, in your flash, you can do:

if(_root.Sound=="Off") stop();

or

gotoAndPlay(_root.Sound);

etc...

If you are using flash player 7, you can use FlashVars wich is the same thing, except it let you pass 65 ko + to flash player unlike the other way.

<param name="FlashVars" value="Sound=Off" />

It does the same thing...
__________________
www.hk510.com
simonboris is offline   Reply With Quote
Old 12-07-2004, 11:16 PM   #3
jack_dougan
Registered User
 
Join Date: Dec 2004
Posts: 5
Default

Whoa, that was fast. I pressed preview post and you got the answer already. Good Stuff
jack_dougan is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:25 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.