ActionScript 2.0 :: Receiving Multiple Variables From PHP
Aug 4, 2009
Currently I have a simple setup which sends some data to PHP and then PHP returns a variable to flash. I have no problem tracing out the returned variable in Flash, however i'm strugling to send back more than one variable.[code]If I remove the trace and echo for fromPHP2, it's all good, however with with my second echo for fromPHP2 it just gives me back undefined:[code]It seems that fromPHP1 is basically returning both echo's.
As silly as it sounds, i need the trace to see the error. I am using cs4 for this and have not found anything so far to explain why it is not working. You can test it out without needing anything on stage.
This is the error i get and do not know why. undefined is the varSend trace
TypeError: Error #1010: A term is undefined and has no properties. at Untitled_fla::MainTimeline/frame1() is the varLoader trace
I am using the sendAndLoad class to perform a script through PHP and load the variables back into the swf. Using Firefox Firebug, I am able to tell that everything is executing correctly, including the PHP script returning the following variables:
&mySubscriberID=36&firstName=Bill
But the variables are not making it back into the swf file. Here is the code for the first frame of my flash file:
[Code]....
I also have dynamic text fields with the above variables assigned to them.
the sendAndLoad class to perform a script through PHP and load the variables back into the swf. Using Firefox Firebug, I am able to tell that everything is executing correctly,including the PHP script returning the followingvariables:&mySubscriberID=36&firstName=BillBut the variables are not making it back into the swf file. Here is the code for the first frame of my flash file:
stop(); var sendLV = new LoadVars();var recLV = new LoadVars(); recLV.onLoad = function(success:Boolean){trace("recLV back from php");} sendLV.onLoad = function(success:Boolean){ nextFrame(); trace("sendLV back
I am using the sendAndLoad class to perform a script through PHP and load the variables back into the swf. Using Firefox Firebug, I am able to tell that everything is executing correctly, including the PHP script returning the following variables:
&mySubscriberID=36&firstName=Bill
But the variables are not making it back into the swf file in a usable fashion. The variables sent back look like this:
I am trying to get an xml to load from an external site using a PHP proxy. I have been able to achieve this with the url of the xml hard coded in the PHP though I now wish to get the flash to send the url as a variable to the PHP though I am unsure how to do this.
I'm trying to declare a few variables in a for statement using the variable in the for statement. In older flash versions I would use something like this.
Code: for(a=0;a<10;a++) { _root["variable"+a] = "Some text "+a;
I want to declare on multiple numerated variables like this:
var myVar1; var myVar2;
But I don't want to do this manually for every variable instance but automatically, so I need a way to instruct the compiler to declare by himself on every variable and to numerate them automatically.
So hopefully I explained myself well, I wanted to know if there is such way to do this?
i can trace out 'levelNum' and it traces out fine. i can trace out 'questionNum[currentQuestionNum]' and it traces out fine.basically without any variables my object array would look like this:
lvl(1 or 2)Questions[(a # here)].correctAnswer.
But my trace is not working and i'm not sure how to group that all together.
I got a problem with URLVariablesprobably better to show by example
Code: for each(var foo:String in fooArray){ variables.foo = foo; }
this unfortunately doesn't work as intended as the old foo variable in the URLVariables get overridden each time.Thus when I output the variables as suchTried looking around the net for it but couldn't find anything. Also it seems logical enough that the variable gets overridden and I wouldn't really question it if it wasn't that ive been told the querystring should contain multiple definitions of the foo variable...
I am using the Kirupa email form to gather some results on a form...How can I load variables from 2 different movieclips to post in the php? I tried...
As seen below, I tried to return more then one variable from a function but , I think I have some syntax problem..
function hesapla3(parametre1,parametre2):(Number&&Boolean) // PROBLEM IS HERE, I NEED TWO VARIABLES TO RETURN{var yenideger2:Number=new Number();var bol2:Boolean=new Boolean();yenideger2=parametre1+parametre2;if(yenideger2>80){bol2=false;}return yenideger2;return bol2;trace(yenideger2);trace(bol2);}
I have been focusing on PHP a lot lately and just had a client that requires an MP3 player playing multiple songs so I had to whip out my rusty actionscript skills. I have the player completed and it is working as desired. The down side is it has multiple songs. I am using separate functions for each song and separate event listeners. My main question is there a way to combine these funtions into one and just use the event listener to pass another variable to the functions? Below is a sample of one of the code for Song1. I would like to make it so anywhere there is Song1 in the code, I can make it a variable so I can put in for example (Song2, Song3, Song4, etc.) This way, I can have one or two functions handle all the songs instead of having to copy, paste and then find and replace.
// Song 1 var Song1:Sound = new Sound(); pbSong1.source = Song1; //pbSong1.visible = false; var Song1Loaded:Boolean = false;
This may be a weird question, but I'm wondering if there's any way to efficiently (perhaps using namespaces?) have different default variables in a class per developer in an actionscript project. I ask because we're currently working on a series of Flash games: 24 in total. Each is loaded by a shell container. The shell receives a flash var for which game to load. In our development environment (Flash/FlashDevelop), there are no flashvars, so a constant in the AS defines which game to load when there's no flashvar:
I am a designer trying to modify some ActionScript for a web project. When defining the variables, I would like for some of them to have multiple parameters/categories[code]...
I have a conditional statement (if) that I am trying to use contingent on multiple variables being true. So the AS I have right now is:
[Code]...
But when I run that I get the following error message: "Error 1050: Can not assign to a non reference value" What do I need to change so that once 1,2 and 3 have been visited visitComplete is set to true?
I've automated a lot of my script, but cannot automate the very beginning where one sets the variables. I have the following script that I'd like to put in a "for" loop :
private var aliPlane1:Plane3D; private var aliPlane2:Plane3D; private var aliPlane3:Plane3D;
I am working on a project where I am getting some data back into my .swf via FlashVars. They are being sent back in a HTML Code: <param name = "FlashVars value ="resultstring=&username=value&userfirstname=value&userlocation=value" I am not sure how to target the resultstring in actionscript to retrieve all of the different variables?
I am sending a complex flashVar sequence where a shell swf gets the URL for a SWF to load via flash vars. The URL for this loaded swf has flashVars appended to it. I need to pass in two flashVars to the loaded swf, but can't get it to work. I think it might have to do with escaping the "&" -- I've tried & but no dice -- in both cases it just ignores the & and everything following it. I can't post sample code as the forum won't let me post what it considers 'links' -- but basically the flash var string passed to the loading swf is something like [code]...
The course contain ten chapters that all have to report that when a user completed them. When they all are, the status is set to "completed" for the course. First off the theory behind it:
1. I just completed a chapter.
2. Load a string with then numbers "0,0,0,0,0,0,0,0,0,0", one for each chapter. All 0's, no chapter is completed, all 1's, all chapters are completed, you get the picture.
3. Add a 1 for, lets say chapter 5, would look like this "0,0,0,0,1,0,0,0,0,0".
4. Check if the course is complete, like this: "1,1,1,1,1,1,1,1,1,1", or not.
5. If complete, set status to "complete", if not, set to "incomplete".
In practice:
import flash.external,*; String(ExternalInterface.call("LMSGetValue, "cmi.suspend_data, TheCourseStatus")); String(ExternalInterface.call("LMSSetValue, //..add the number "1" to
[code]....
So, after this rant. How do I,
1. Get the string.
2. Add the course number/value to the string
3. Then update the string, and..
4. ..set the appropriate status.
I found out that "I need to concatenate them together with a delimiter so I can separate the string on re-entry", but I don't know how to do that.
My issue is that I have 10 small audio clips and I want to make them into variables that i can access later in the code. But I'd be happy if I didn't have to write the same code 10 times down over and over to create/access them.[code]...
A question on the side, is there any built in sound generator in actionssccript 3.0?
load multiple variables from a single text document into one main dynamic text field. If it is possible could someone post an example for me i would appreciate it a lot