PDA

View Full Version : Flash VARS intro


barney-0-
10-24-2006, 01:42 PM
Hey...i want try (for the first time) to use FlashVars in a new site that im making.

Im not too sure what to do, however i was thinking something on the lines of;

Index.html.....this page is the default and set as italian language. I have a preloader in this page that will preload the main timeline (when its preloaded, itll become a 'enter' button). On this preloader, i was thinking about putting something like;

<PARAM NAME=FlashVars VALUE="lang=it">
Embed Tag Example:

<EMBED src="preload.swf" FlashVars="lang=it"

Is this the right method so far?....will the var be passed from the preload.swf to the main.swf?

....on the other perspective, ill have a button 'english' that will go to index_eng.html....and the lang=eng will be used above the movie...

The second part of my query is how to implement the var onthe first frame (do i need on each movie (the whole site has 20 or so external swfs)) and when i load movies, is it ok to loadmovie 'movie1_(VAR).swf'?

Sorry, but i just dont have a clue with this....mnay thanks in advance







All i want is in the index.html page two links, one for english and one for italian.

anonymous
10-24-2006, 10:22 PM
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_16417

http://www.permadi.com/tutorial/flashVars/index.html

http://www.actionscript.org/resources/articles/217/1/Creating-script-free-deep-links-with-full-flash-sites/Page1.html

barney-0-
10-25-2006, 06:31 AM
Cheers for the links...i did see then before i made my post, however i dont understand!....

Ive had a play, on the first index page i have two buttons, english goes to main2.html and italian goes to main.html.

In the head for the main.html i have;

<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="main.swf" />
<PARAM NAME=FlashVars VALUE="language=it"> <param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="main.swf" FlashVars="language=it" quality="high" bgcolor="#ffffff" width="550" height="400" name="main" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

Then in the main.fla i have to load the movie 'test_it.swf';

on (release) {
holder.loadMovie("test_(_root.language).swf");
}

....and yes, it doesnt work....could someone help me out

Many thanks in advance

Manta
07-25-2008, 10:34 PM
I know this is some stupid newbie question, but I have spent a day and a half trying to assign a flash var to a var x in flash AS2 with no luck.

Here is what I have been trying recently.

---------------------------------------------------

On the HTML side

<param name="flashVars" value="vid=sams.flv" />

In the AS2

var x:String = vid;

------------------------------------------------------

This is from numerous examples I have tried to understand on the web.

I do not get an error when I publish, but it x never gets the value of vid either. :(

If I hard code x in the AS2 with the value of vid the clip plays.

Could someone please post the correct line of code I need to use in the AS2 to assign the value of the flashvar vid to x? :confused: