all groups > flash actionscript > september 2007 >
You're in the

flash actionscript

group:

Check for vars passed from HTML


Re: Check for vars passed from HTML mark_s_nospam NO[at]SPAM entouch.net
9/10/2007 9:35:52 PM
flash actionscript: On Sep 10, 6:44 pm, "knucklenutz" <webforumsu...@macromedia.com>
[quoted text, click to view]

maybe use watch. it only trigger when the value changes. if it remains
undefined it will be ignored. i don't pass mine via querystring so it
may be different. i use setvariable and pass via javascript. this is
untested but should be close.

function fReactToMyVar(property,oldval,newval)
{
trace(oldval);
tract(newval);
}

_root.watch("s", fReactToMyVar);

'test by setting s to various values here
Check for vars passed from HTML knucklenutz
9/10/2007 11:44:13 PM
Hi,

I am trying to check for a var that is passed into a SWF via HTML
(file.swf?var1=something) however when I check for the var on the first frame
while publishing the SWF in the test environment it tells me the var is not
defined.

if (s=="something") {
doSomething();
} else {
doSomethingElse();
}

The var may or may not be passed into the SWF. So when I test this locally in
the Flash authoring environment the Output window tells me that 's' is not
defined. Is there a way to test without defining 's'? Defining 's' will
overwrite any value that is passed into the SWF won't it?

Thanks
Re: Check for vars passed from HTML C-Rock
9/11/2007 1:48:00 AM
i actually do this with my flash shopping cart checkouts. i don't have my code
in front of me but i know it's possible. i just pass the price to swf on a
secure page and the checkout proceeds.

check google, should be easy to find.
Re: Check for vars passed from HTML knucklenutz
9/11/2007 5:39:29 PM
AddThis Social Bookmark Button