473,800 Members | 2,367 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Flash, PHP & loadVariablesNu m()

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
Jul 17 '05 #1
1 13476
Ralph Seguin wrote:

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.

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

loadVariablesNu m("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,Logo s%203,Brochures %201,Brochures% 202,Posters,Out door%20Media,PO S,Print%20Ads,D irect%20Mail,Si gns,Labels,Flee t%20Graphics,Pr omotional%20Ite ms,Gift%20Certi ficates,Contest s,Illustrations ,Sales%20Presen ter,

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

Shawn
--
Shawn Wilson
sh***@glassgian t.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
1219
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 this page read data from database. to show external data , i use of "loadVariablesNum" in my Flash news board. my data are "Farsi" & "Arabic" strings and when i show them in the Flash news board , these data doesn't showed correctly ...
10
29907
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 information to the PHP page and then loads the result, all in the background. Right now, the php page cannot access the $_SESSION. Is there anyway that I can conitnue the PHP session when doing this or does the user have to visit the PHP page?
5
5951
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 say "Hello World" in a Flash enabled web page rendered via ASP.NET. Can any one let me get started? ---
2
4072
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 when it deliver's it to my inbox, I am getting all of this jibberish with the email Example: Name: <TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Arial" SIZE="14" COLOR="#242868" LETTERSPACING="0" KERNING="0">Test</FONT></P></TEXTFORMAT>...
0
3122
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 another check.asp asp page is made up of flash in flash there are two input type user_name and password I have to access this in check.asp in flash I have written
0
5478
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 IE. In FF it stops playing but I can't tell if it is removed or not. Can I do it in javascript or maybe I need a FLASH script to do it?
1
3111
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 from Access and SQL and then post the information on series of frames that is timed. The code im am posting is just a test to try and get values passed to Flash. I am using Flash CS3 with actionscript 2.0. Frame 1: success="";...
0
9691
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10035
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9090
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7580
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6813
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.