ActionScript 3.0 :: Receiving Variables Back From Php?
Apr 21, 2010
basicaly i have narrowed it down to this code
[Code]...
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
View 3 Replies
Similar Posts:
Sep 30, 2006
Here is the action script in flash MX that im using
function doSubmit(){
sendData = new LoadVars();
recData = new LoadVars();[code].....
I am able to send data to the database but the script does not send back the variable data "success".I have 2 input fields on my form, one drop down and 2 radio buttons, a dynamic text field and a Butto.the data from the input fields, the drop down and tyhe radio buttons all get to the database, this part is working great.The dynamic text field shows the data from the error loading variable "Error Loading file".When it should have picked up the variable from the php variable and show the word "Success".Does anyone know why it send my data to the database and won't return the variable from php?
View 3 Replies
May 26, 2010
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.
View 1 Replies
May 26, 2010
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
[code].....
View 7 Replies
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.
View 1 Replies
May 26, 2010
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:
}
Variable _level0.recLV = [object #3, class 'LoadVars'] {
onLoad:[function 'onLoad'],
mySubscriberID:"36",
firstName:"Bill"
}
Using a colon instead of an equal sign?
Here is the code for the first frame of my flash file:
Code:
stop();
var sendLV = new LoadVars();
var recLV = new LoadVars();
[Code].....
I also have dynamic text fields with the above variables assigned to them. why the swf is not receiving the data correctly?
View 2 Replies
Nov 6, 2010
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.
[Code]...
View 3 Replies
Oct 1, 2010
I m trying to receive some variables from a PHP file in AS3.
AS3 code :
package {
import flash.display.MovieClip;
import flash.events.*;
import flash.net.*;
public class bakar extends MovieClip {
[Code] .....
The problem is I am getting output as :
Code:
username is undefined
email is undefined
I am using a WAMP server.
View 2 Replies
Jan 19, 2009
I know you can track the progress of URLLoader receiving variables, but has anyone found a way to track the progress of it sending variables?
View 0 Replies
Jun 15, 2010
I'm writing code that takes data from mysql that's processed by a PHP script. It's actually a bit bizarre, at least to me. Anyway, here's some basic AS3 code that's moving toward what I want to do:
var loader:URLLoader = new URLLoader();
var urlRequest:URLRequest=new URLRequest("receive.php");
urlRequest.method=URLRequestMethod.GET;[code]....
For some reason, the statement "trace(evt.target.data);" produces a whole pile of garbled text before the actual stuff that it's supposed to show Because of problem #1, I've had to include a throwaway variable at the beginning, otherwise the first variable I try to pass into AS3 comes back as undefined. This causes errors when I run my flash movie in the IDE, but when I run it from the browser it doesn't seem to have any effect.But this is the strangest thing of all whenever I make any changes to the database (and subsequently try to load data from different variables), the new variables come back as undefined. For example, let's say that I add another entry to the database, and decide to load students 2, 3, and 4 instead of 1, 2, and 3. When I do that, any new data I've added comes back as undefined, even though when I view the PHP output in my browser, it looks just fine.
And now for the REALLY bizarre part: I'll copy that output, paste it into my PHP script as an echo statement, comment everything else out, and my flash movie runs fine. Even though the output from the PHP script is exactly the same, it gives me errors.
View 9 Replies
Oct 12, 2009
I can successfully get variables back into AIR when communication just using variables, but get errors when trying to get vars back after a successful upload.Here is some non-upload code that works perfectly giving me vars back:
function login(event:Event):void {
u_username = login_user.text;
u_password = login_pass.text;
[code]....
When I use upload code, I get the error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
Here's the upload function:
function testerFunction(event:Event):void {
var URLrequest:URLRequest = new URLRequest("http://www.blah.net/uploader.php/");
URLrequest.method = URLRequestMethod.POST;
[code]....
Everything except the var return works fine - the file is uploaded and saved no problem, and in the php the print "var1=upload successful"; code comes right after the code that saves the file to the server.
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
...when uploading a file, as that seems to be the main difference.
View 10 Replies
Dec 4, 2011
I can successfully get variables back into AIR when communication just using variables, but get errors when trying to get vars back after a successful upload.[code]Everything except the var return works fine - the file is uploaded and saved no problem, and in the php the print "var1= upload successful"; code comes right after the code that saves the file to the server.[code]
View 1 Replies
May 26, 2010
I am trying to retrieve some information back from my LMS and into variables in Flash with AS3. I used to be able to do this without any problems in AS2, but can't seem to find a way to make this work in AS3. In AS2, publishing with the "Flash with SCORM 1.2 Tracking" option, I could call a line like the following:
fscommand("LMSGetValue", "cmi.core.student_name,_root.stuname");
This would grab the student name from the LMS and store it in Flash in the variable named stuname.
Any way to do this with AS3? I can set values back to the LMS no problem still through fscommand such as score or completion, I just can't get anything back from the LMS such as student name or lesson location.
View 2 Replies
Dec 16, 2009
I had posted this in the PHP section but think it may be more relevant in Flash as have'nt had any replies yet..I have been asked to create a photo canvas website that allows users to upload an image, then apply several effects such as re-sizing/cropping/desaturate, then viewing the updated image on a generic wall and going to check out to buy the canvas.I am pretty new to web developing/designing, i am confident with html,css and actionscript to an extent, but have only used small parts of php before.My biggest worry is how to go between html > php >flash >back to html again.From what i understand i need to create the following functions:
1. Create a general html website which will store the upload form and flash photo editor swf on, when the user first access's the site i start the php session...
2. The user then uploads there image to the server using a simple php upload form which will store the file and create a unique named file also on the server...
3. The flash editor swf will then load up on the html page. Inside the actionscript of the swf i will tell flash to continue with the php session by calling it again and call users image on the server with the 'file reference' command. The editing functions such as cropping, canvas size will all have variables to mark what the user has chosen and these varaibles will get ent back to the html page using php to keep track of them for the checkout process...
4. Once the editing has finished the user will click 'finish' in the swf taking them to the php shopping basket/checkout which will call the variables sent in flash to determine final cost depending on what effects chosen.
Is the above correct and more importantly is it possible? The main part i am struggling to get my head around is editing in flash (say changing the uploaded image to 20 x 26) and then saving this back to the server and sending the new settings back into the html/php page.Is this all possible without using database and tables such as MySql?
View 0 Replies
Nov 17, 2010
I try to make a simple login. I use the code
Code:
function sendVars_login(event:MouseEvent):void
{
var scriptRequest_login:URLRequest = new URLRequest("http://******.aspx");[code]...
when i send the vars i get back that user doesn't exists although i have checked that it exists.A funny thing is that when i change the following
Code:
scriptVars_login.u_pass = "somePass"
scriptVars_login.u_email ="someEmail"
I get correct results. So the .aspx script works and the way i'm sending the variable works. when i trace
scriptRequest_login.data
i get a url encoded string, so i tried to unescape the value
Code:
var unescapedString = unescape(String(scriptVars_login));
scriptRequest_login.data = unescapedString;
scriptLoader_login.load(scriptRequest_login);
now when i trace(scriptRequest_login.data) i get an unescaped value but it still doesn't work
View 1 Replies
Nov 16, 2010
I'm looking to send a list of variables (say 6 in total) from php to flash and for flash to pick a random one and send it back to php when clicking a button.
I would like it to appear in a dynamic text box. That randomly selected variable needs to be sent back to php on pressing a button.
View 2 Replies
Nov 16, 2010
I'm looking to send a list of variables (say 6 in total) from php to flash and for flash to pick a random one and send it back to php when clicking a button. I would like it to appear in a dynamic text box. That randomly selected variable needs to be sent back to php on pressing a button.
View 6 Replies
Oct 17, 2009
How to pass variables from flash to php to process and get back the result to flash
this is th php code
<?
$money = $_POST["fname"];
$persent = $_POST["age"];
[Code]......
View 5 Replies
Oct 21, 2010
I have a Flash website with 3 interfaces( 3 frames with movie clips inside). they have a button that goes to different loaded .html page(text). But once the back button is pushed on the web browser, it always goes back to the first frame instead of the actual last page, which might have been frame 2 or 3.
View 1 Replies
Jan 13, 2009
I have a project (see attached) where I need to have the folders seem like they are floating in space, and I need the best way to make it so when you click on a back folder, it slides off the screen and come back in front of all the folders.
View 2 Replies
Dec 4, 2010
Anyways I am using action script 3.0 and I created multiple layers using just one scene. I created a layer with lables on them to mark where I want my buttons to point to and go to. I have the stop (); on the first frame. And I made my buttons mostly interactive with movie symbols and tweens.My first scene I have 2 doors, the user can pick which door to go to and it takes them into a different path.I made the buttons that are clicked to go forward, and then I tried to make an invisible button on the button edge of the scene to go backwards However, the PROBLEM is when I click my button to go backwards I am stuck on the first page and can't move forward.
function gotoOne(evt:Event):void{ gotoAndStop("one")}backbutton1.addEventListener("click",gotoOne);
function gotoFour(evt:Event):void{
[code].....
View 11 Replies
May 26, 2011
I have a GUI using Flex. I have a condition like i need to execute some command line arguments in the local machine and get the results back or output back to a textbox area. How can i do a button on submit, execute command in the local machine and return the output?Command to execute example:
echo logfile.log | grep username
Code:
button1.onRelease = function ()
{
// in this computer, it will now run a command, please wait.
}
View 1 Replies
May 28, 2010
I am working on a having external swfs get loaded into the main swf one by one from an array.I can get the first one to load, but it just keeps on playing the first item in the array over and over, instead of loading the next movie. I have a container on my stage, cleverly named "container" and I am using AS2 and loadMovie.
I am guessing my conditon on my if statement is off, but I am not sure how to tell the onEnterFrame to check the currentframe of the loaded swf and not the container itself. I might be way off, but in my mind I feel like this mostly makes sense, but knowing Flash it is probably not nearly enough coding.I might also add this won't be running on the web, so I don't need to worry about preloading swfs since it will be running directly off a PC onto a screen in our office.Here is my code:
Code:
var myClips:Array = ["movie1.swf", "movie2.swf", "movie3.swf", "white_logo.swf"];
var i:Number = 0;
_root.container.onEnterFrame = function() {[code].....
View 2 Replies
Sep 14, 2011
I've got the standard scene 1 with three frames on it. the first frame has a movie clip with about a 70 frame timeline. the second frame has a movie clip with about a 20 frame timeline. the third frame is black with a stop action. i'm trying to make a leaderboard banner, and i need each clip to play one after the other.
right now, when ctrl+enter it plays nothing. i actually have to rewind it to have it play the first clip. then it just repeats the first clip and completely skips the second. in the first clip's timeline, I have a parent.gotoAndPlay(2); on the last frame.
View 1 Replies
Sep 14, 2011
I have some knowledge of Flash, but not enough obviously. Right now I've got the standard scene 1 with three frames on it. the first frame has a movie clip with about a 70 frame timeline. the second frame has a movie clip with about a 20 frame timeline. the third frame is black with a stop action. i'm trying to make a leaderboard banner, and i need each clip to play one after the other. right now, when ctrl+enter it plays nothing. i actually have to rewind it to have it play the first clip. then it just repeats the first clip and completely skips the second. in the first clip's timeline, I have a parent.gotoAndPlay(2); on the last frame.
View 1 Replies
Feb 27, 2010
i want to know how we can make back button in flash to go back to page same like browser back button.
View 1 Replies
Nov 8, 2011
In my apps, i would like to:
1)have a pop-up menu when a button is touched, then ok to close but still in the same page as it is
2)invoke the popup menu by using samsung's "MENU keycode",then ok to return the same page as it is
3)having the user to swipe 5 images to view them, left image as 1st and 5th image as last image with smooth transitions
4)and also using the "BACK keycode" to go back to previous page
View 3 Replies
May 31, 2010
my first flash webpage sends data to a php script. I then do
var result_data:String = String(contactLoader.data);
if (result_data == "ok")
{
navigateToURL(strURL, "_self");
}
So if the data is sent with no problems, it will load up my new url. Problem is, this new url needs this data to display it. So, if my php file holds the data in variables, how can my new url retrieve these in real time? (meaning that data goes straight from swf to php to new swf) I have been trying LoadVars, but not sure if this will work in real time, maybe it will.
View 8 Replies
Feb 28, 2012
Not getting data back into flash from php that queries mysql data, think the problem is with my as3 code here?The php works, the as3 posts to the php ok, its the returning of the variables to as3 that I am unsure about and seems to be the problem?
public static function MineData():void{
var myRequest:URLRequest = new URLRequest("login.php");
var myLoader:URLLoader = new URLLoader();
[code].....
View 1 Replies
Mar 13, 2012
I have a flash-movie on my webpage, which makes a post when its done playing. I want to catch that post and update a session.
I get the following "post-error" when the movie ends.
POST /en/RunTest/test/showmovie/finish
HTTP/1.1 500 Internal Server Error
"test" is my controller"showmovie" is my action which takes an id as parameter. fx.
/en/runtest/test/showmovie/1
That is the page my flash is on.
I've tried the using the HandleUnknownAction-method, but it just never gets there. I've tried some MapRoute'ing - but havent succeded.
What i want is the method setMovieSeen to be called whenever i recieve the post from the flash.
View 1 Replies