PDA

View Full Version : Using URL Variables


Baboosi
03-12-2006, 04:16 PM
First problem - my head is hurting. It's late here and I've had enough so I thought I better have a drink (of water) to help my brain function better, but alas it had no effect on solving my ...

second problem - which is using URL variables in my Flash project. Why oh why can I use a URL passed variable in a button, but not in action assigned to a frame? The button says something like this...

on (press) {
getURL("examplepage.cfm?variable="+urlvariable);
}

... and works bute, but when I assign an action to a frame (which tells the exampletarget movie to go to a frame with a labelname of that of a URL variable) like this ...

tellTarget (_root.exampletarget) {
gotoAndStop(+urlvariable);
}

... it doesn't work bute at all. In fact you could say that it doesn't work full stop.

Baboosi
03-14-2006, 03:09 PM
So my head isn't hurting anymore and I was able to solve it. For those interested ...

Basically I had to set the URL fed variable as a root variable at the start of the movie ...

_root.myVar = myVar;

... I was then able to use it to go and stop on a certain frame label ...

tellTarget (_root.exampletarget) {
gotoAndStop(_root.myVar);
}

... which doesn't explain why I could use a URL fed variable in the scripting of a button but not in the scripting of a frame, but it works so I'm not that concerned.