Set variable using html link

say i have a flash file… which checks the value of a variable… if the value is true then it does something and if the value is false it does something else…

my question is ,… can i set that variable value… from a link to the html page which has that flashfile embedded in it

hope that makes sense

yes you can after the link to the swf files in the html page(theres two of them) you can add xxxx.swf?variableName=variableValue

Where variableName is the name of the variable and variableValue is the value of the variable. In your movie you then have a variable called variableName that you can use as a normal variable

i knwo that… but what i want to do is… set the variable just using a link soo when i click the link it sets the variable to a value

and when i click another link it goes to the same page same swf buttt different variable value…

that depends on what kind of webserver you are working on.

You can add parameters to the end of a url in the following format

On the page that holds your calll to the swf you need to put some code to grab the parameter and pass it into the call to the swf. (At work I use a java based webserver so this is pretty easy to do) ie

myVar = request.getParameter(myVariable)

and then the call to the swf would be

“mySwf.swf?myVariable=” + myVar

where myVar is the variable. Otherwise your stuck to having the links point to different pages all calling the same swf but passing in parameters

can u show me the exact code… for using javascript to send the variable from the link to the swf??

and what exactly do u mean by a java based web serever?