473,396 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Flash, PHP & loadVariablesNum()

Ok...
I am having problems getting variables/values INTO Flash from an
external source (PHP).
I'm NOT having problems getting loadVariablesNum() 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";
loadVariablesNum("foo.php", 0, "POST");

if (result == "ok")
{
getURL("bar.html");
}
}
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
loadVariablesNum() 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
Jul 17 '05 #1
1 13448
Ralph Seguin wrote:

Ok...
I am having problems getting variables/values INTO Flash from an
external source (PHP).
I'm NOT having problems getting loadVariablesNum() 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";
loadVariablesNum("foo.php", 0, "POST");

if (result == "ok")
{
getURL("bar.html");
}
}

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
loadVariablesNum() 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.

I made a portfolio using Flash MX, PHP and mySQL.

loadVariablesNum("http://www.mysite.com/scriptname.php?doit=getcats", 0);

"Scriptname.php?doit=getcats" produces the following output in plain text:

title=Logos%201,Logos%202,Logos%203,Brochures%201, Brochures%202,Posters,Outdoor%20Media,POS,Print%20 Ads,Direct%20Mail,Signs,Labels,Fleet%20Graphics,Pr omotional%20Items,Gift%20Certificates,Contests,Ill ustrations,Sales%20Presenter,

And that's all there is to it. make sure to url encode your variables.

Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: SOS | last post by:
hi guys ! i don't know is this a proper group for discussing about this problem or not .... anyway , i have a Flash news board in my asp.net page this news board get data from an aspx page and...
10
by: Steve Cook | last post by:
Hi, I have an upload application written in PHP and Flash. The PHP page gets the file information via $_POST. Moreover, the user never actually visits the PHP page, rather Flash sends the...
5
by: ASP.NET explorer | last post by:
I have been asked to create some simple animation using Adobe Flash player in ASP.NET(C#) web application. While I am fairly well versed with ASP.NET C#, I absolutely have NO IDEA about how to...
2
by: staryeyes47 | last post by:
Hi, I am creating a contact page for a my website and I am having a bit of trouble. I have created the form in flash, and am using a php file to send the email to myself. The form works OK, but...
0
by: vinodkus | last post by:
dear sir/madam I have flash file there are two input text named user_name and password just i have to access these value of this text box in another asp page suppose an asp page index.asp and...
0
by: dolittle | last post by:
Hi, I'm embedding a last.fm flash widget. I want to be able to remove it from the page using javascript. I've tried to delete the html element that contains the code but it keeps playing in...
1
by: jrayjr | last post by:
Hello everyone, Im running into a problem passing values from ASP to Flash. I've been searching around and trying different things with no luck. The project im working on will use ASP to pull data...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.