Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Supporting Technologies > HTML and JavaScript

Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
Old 06-29-2003, 04:35 PM   #1
magicwand
Senior Member
 
magicwand's Avatar
 
Join Date: Oct 2002
Location: NY
Posts: 657
Default flashvars

i recently used flashvars to pass variable into swf from html.
i used javascirpts before since they suggested javascirpts example.
flashvar is 100X easier to use and more effective.
i could not find toomuch documentation on this matters in this forum.
i will post some good links that i found when i goback to my office.

my point is...it is very useful.
but not many knows about this.
if someone should type flashvars in search arg.
i want this thread to appear with added link i will put later..

if some one have some other good links..feel free to addthem.
thanks.
__________________
"If a man does not keep pace with his
companions, perhaps it is because he hears a different drummer." Thoreau
magicwand is offline   Reply With Quote
Old 06-29-2003, 09:29 PM   #2
freddycodes
Master of Nothing
 
Join Date: Dec 2002
Location: San Diego, CA
Posts: 2,468
Default

Yep I always use FLASHVARS when passing variables to my movie from an object or embed tag.

Code:
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="210" HEIGHT="105" id="mp3player" ALIGN="">
<PARAM NAME=movie VALUE="mp3player.swf"> 
<PARAM NAME=quality VALUE=high> 
<PARAM NAME=FlashVars VALUE="mp3name=City_of_New_Orleans.mp3">
<PARAM NAME=bgcolor VALUE=#000000> 
<EMBED src="mp3player.swf" quality=high bgcolor=#000000  WIDTH="210" HEIGHT="105" NAME="mp3player" 
ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" 
FLASHVARS="mp3name=City_of_New_Orleans.mp3">
</EMBED>
</OBJECT>
freddycodes is offline   Reply With Quote
Old 06-29-2003, 10:00 PM   #3
Sualdam
Registered User
 
Join Date: May 2003
Posts: 848
Default

Colin Moock touches on it in the Definitive Guide.

Macromedia's take is at: http://www.macromedia.com/support/fl.../flashvars.htm

And a few others:

http://www.impossibilities.com/blog/flashvarstip.php
http://www.ultrashock.com/ff.htm?htt.../FlashVars.php

You need to be careful because it only applies to the Flash Player 6.
Sualdam is offline   Reply With Quote
Old 06-30-2003, 08:15 AM   #4
farafiro
Addicted To FLASH
 
farafiro's Avatar
 
Join Date: Dec 2001
Location: EGYPT
Posts: 12,439
Send a message via MSN to farafiro Send a message via Yahoo to farafiro
Default

good links Sualdam
thx, never used them b4
__________________
â€* GOD Is Near â€*
Questions Don't PM for Questions . Thanks
An eye for an eye, make the whole world blind
_____________________________________________GHANDI
farafiro is offline   Reply With Quote
Old 06-30-2003, 02:06 PM   #5
magicwand
Senior Member
 
magicwand's Avatar
 
Join Date: Oct 2002
Location: NY
Posts: 657
Default

Quote:
I say, magicwand should compile all thses and create a tutorial with various examples for all of us.... Yay!!!
if i write tutorial for this..willllll it be one of the tutorials in the forum???
__________________
"If a man does not keep pace with his
companions, perhaps it is because he hears a different drummer." Thoreau
magicwand is offline   Reply With Quote
Old 06-30-2003, 02:39 PM   #6
farafiro
Addicted To FLASH
 
farafiro's Avatar
 
Join Date: Dec 2001
Location: EGYPT
Posts: 12,439
Send a message via MSN to farafiro Send a message via Yahoo to farafiro
Default

do it and send it to Jesse
it it worth to be there, he will post it
__________________
â€* GOD Is Near â€*
Questions Don't PM for Questions . Thanks
An eye for an eye, make the whole world blind
_____________________________________________GHANDI
farafiro is offline   Reply With Quote
Old 03-28-2005, 10:39 PM   #7
alexcq
Registered User
 
Join Date: Feb 2005
Location: Manchester, UK
Posts: 20
Default

Here's some javascript to help putting in flashvars , it makes the whole process a lot easier.

http://www.centralquestion.com/archi...lash_flas.html
alexcq is offline   Reply With Quote
Old 06-06-2005, 08:12 PM   #8
jackSalomone
Registered User
 
Join Date: Jun 2005
Posts: 2
Default variable scope and "FlashVars"

I just found out that Flash isn't too happy if you try to assign the scope of a variable from HTML.

For example, I wanted to create a _global variable named "myVar". If I placed a dynamic text box on the stage at frame 1 with the variable set to "_global.myVar", I could see the assignment. The same text box copied and pasted to frame 2 showed nothing! I ended up having to write something like the following script to get my ActionScript to work:

ActionScript Code:
if (myVar == undefined){     _global.myVar = "default value"; }else{     _global.myVar = myVar; }

Folks, please let me know if anyone else has run into this, or if I am just crazy.
jackSalomone is offline   Reply With Quote
Old 06-07-2005, 02:37 AM   #9
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,878
Default

Howdy and Welcome...

What's not happy is not the FlashVars but the variable name you are using for the textField...
You should use instance name rather than the variable name if you are using FMX and above...

For example, remove the _global.myVar in the variable name field, and give that textField an instance name of content_txt and add this line at the bottom of that if statement...
ActionScript Code:
content_txt.text = _global.myVar;
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 06-08-2005, 11:59 PM   #10
jackSalomone
Registered User
 
Join Date: Jun 2005
Posts: 2
Default

That is a very valid point. However, my ultimate usage had nothing to do with textfields at all, I was trying to use the variable in my script. I just had the text field example as a troubleshooting measure.

Flash just didn't seem to like me setting FlashVars="_global.myVar=whatever" (Please assume the correct syntax for the OBJECT tag throughout this paragraph). It worked well when I set FlashVars="myVar=whatever", and then assigned it to a _global scope in my first frame with the code from my previous post. Also, it acted the same way with the src="myMovie.swf?myVar=whatever" method.
jackSalomone 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 On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:28 PM.


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