Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI-Scripting & Flash

Status
Not open for further replies.

archisoft

Programmer
Dec 19, 2001
15
0
0
IN
I would like to know how do You provide CGI code to do the Flash interface, Flash dialogs, PC/Mac cookies and cookie testing for credit card verification and registration form for a paid site .
 
Any variable in a Flash movie can be passed to a CGI, and the results of said CGI passed back into Flash using the loadVariables() Method. You can send your current vars to a script, and read the return back in... so if the user entered their name/passwd into two text fields you named "user" and "pass" in the main timeline, and your login script was called "login.php" (or whatever language you like =) you would use:

loadVariables("login.php",0,"POST");

You CGI would then be able to access any var you have set on the main timeline, and then Flash will read back in the output of the script. The output needs to be application/x- (like a GET... var1=value1&var2=value2 and so on)

HTH

-vedder
-- like what you see? Give me a job!! =)
 
some notes which may be of interest:

sending variables to the cgi/asp/php/whatever file
All the vriables resident in the timeline you are using the loadvariables action are sent to the cgi/whatever file. So if you have the action in the main-timeline, then all the variables in the main timeline are sent, whether the CGI/whatever needs them or not. However, if you have variables resident within a particular movie-clip, say _root.davemc, then to pass ONLY the variables from that mc you would use [color]
Code:
_root.davemc.loadVariablesNum......[/color]
.

Remember that the above tells Flash where to get the variables required, but it's the second part of the loadvariables command which defines the targte for any variables returned by the CGI/whatever script, so:

Code:
_root.davemc.loadVariablesNum("hhtp://[URL unfurl="true"]www.mydomain.com/myscript.cgi",[/URL] 0, "GET");

would pass the variables from the movie-clip "davemc" on the main timeline to the script, which would then return any variables to the _root (or main-timeline or _level0).

was hoping to complete this, but will add to it later as my business partner is hassling me to go to the pub.... ;-)


dave
dave@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top