Ok...
I am having problems getting variables/values INTO Flash from an
external source (PHP).
I'm NOT having problems getting loadVariablesNu m() to _SEND_ variables
via POST, but I _AM_ having difficulty reading back into Flash local
variables.
Say, for instance, I have a Flash page that has a number of typein
fields. Each of the typeins has a variable associated with it.
In the action script section, I have something like this for a "Save"
button:
on(release) {
var result = "unset";
loadVariablesNu m("foo.php", 0, "POST");
if (result == "ok")
{
getURL("bar.htm l");
}
}
Now, foo.php runs fine and is able to see all of the typein variables
in its HTTP_POST_VARS array and works properly and outputs:
result=ok
The locally scoped 'result' variable never gets changed.
If, however, I create a typein field and give it a variable called
'result' (and get rid of the local 'result' variable declaration in
the action section), the text typein field displays "ok" after
clicking on the "save" button.
What gives?
How does one declare/create variables in Flash that are locally (or
globally, I don't really care) scoped variables that are NOT UI
elements, but DO work for reading values back from an external source
(PHP, Python, txt file, ...)?
I've done some reading of the Flash documentation, and
loadVariablesNu m() and loadVariables() sections are too terse and the
examples aren't very useful.
Furthermore, there seems to be an awful lot of WRONG information out
on the various websites and Q&A sites.
Thanks.
-Ralph
I am having problems getting variables/values INTO Flash from an
external source (PHP).
I'm NOT having problems getting loadVariablesNu m() to _SEND_ variables
via POST, but I _AM_ having difficulty reading back into Flash local
variables.
Say, for instance, I have a Flash page that has a number of typein
fields. Each of the typeins has a variable associated with it.
In the action script section, I have something like this for a "Save"
button:
on(release) {
var result = "unset";
loadVariablesNu m("foo.php", 0, "POST");
if (result == "ok")
{
getURL("bar.htm l");
}
}
Now, foo.php runs fine and is able to see all of the typein variables
in its HTTP_POST_VARS array and works properly and outputs:
result=ok
The locally scoped 'result' variable never gets changed.
If, however, I create a typein field and give it a variable called
'result' (and get rid of the local 'result' variable declaration in
the action section), the text typein field displays "ok" after
clicking on the "save" button.
What gives?
How does one declare/create variables in Flash that are locally (or
globally, I don't really care) scoped variables that are NOT UI
elements, but DO work for reading values back from an external source
(PHP, Python, txt file, ...)?
I've done some reading of the Flash documentation, and
loadVariablesNu m() and loadVariables() sections are too terse and the
examples aren't very useful.
Furthermore, there seems to be an awful lot of WRONG information out
on the various websites and Q&A sites.
Thanks.
-Ralph
Comment