ActionScript 2.0 :: Sending Array From PHP To Flash
May 10, 2010I know how send Var from PHP to Flash. But can I send Array from PHP to Flash? and how?
View 2 RepliesI know how send Var from PHP to Flash. But can I send Array from PHP to Flash? and how?
View 2 RepliesI have a flash file with an array of 46 elements.Is there any way to send this whole array to php to be processed instead of the painstakingly way of accessing each element to a variable.
PHP Code:
myArray = {,5,6,7,8,9,9.......}
myvars.1=myArray[0];
myvars.2=myArray[1];
[Code]....
Currently I'm working on a turn based multiplayer game using stage3D. When the server sends a object for example the code below everything goes very smooth on the client side.
[Code]...
With this ActionScript code:
Code:
ExternalInterface.addCallback("sendArray",null,sendArray)
Function sendArray(message:Array) {
...
}
[Code]....
I can pass a string from Flash to AutoIt and back.
I am sending over a JavaScript Array to ActionScript. The JavaScript code is as follows:
[Code]....
When I run this on Safari for Windows, arrayInput is null. However, this method works fine in Safari for Mac, IE, FF, Chrome, and the variable holds the actual array.
I am having trouble on sending my data to the php..I am using flash cs 3 and the code is what I copied from a site. here's the code.[code]I pasted this code to the button named 'submit' and when I checked the script for errors, my script has an error! it says:Statement must appear within on/onClipEvent handler and I don't know what does it mean I am just newbie in flash cs 3.
View 1 RepliesFriend wanted a change in Email address and I'm assisting. I notice at the bottom it posts to a formmail.php file but I was wondering if there was an easier way to understand what exactly it POSTS and how AS handles POST methods so I can rewrite a script.
function playTier() {
switch(this.tierContent.tier_txt.text) {
case "Sinking Ship":
bullseye_mc.arrow_ani._x = 205; break;
case "Piggy Bank":
[Code] .....
The BLOB field (pic) is turning out as 0 Bytes when trying to send ByteArray through as3 to PHP, so i assume the PHP script or the HTTP_RAW_POST_DATA isn't working.I think the Flash part is working, I have set a trace() to see if the bitmapdata is coming through and it seems it is, so I'm assuming its my php side.3
private function export():void
{
var bmd:BitmapData = new BitmapData(600, 290);
[code].....
I have a flash file where I can pass xml from file :
script type="text/javascript">
var flashvars = {};
flashvars.xmlSource = "XML.xml";
...
/script>
Can I send xml from php in varible to flash example:
$xml = "?xml version="1.0 ...";
script type="text/javascript">
var flashvars = {};
flashvars.xmlSource = ?php echo $xml; ?>;
...
/script>
I am currently working on an online connect four game where the state of the game needs to be updated after ever move. i've had no problems sending variables from a php script to flash but i'm having difficultly sending variables from flash to php when trying to update a database. i am getting this error message:
The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
To try an understand the process and figure out what i am doing wrong i've stripped down both my actionscript and php files to the bare minimum but still it wont seem to work. here is my actionscript:
Code:
var game_id:String = "1";
var postURL:String = "updateMoveScript.php";
var variables:URLVariables = new URLVariables();
[Code]....
i know the php query is fine as i've tested it by changing the $game_id variable to the value i want to send.
i've tried changing urldataformat from variables to text and also messed about with changing post and get and about every different possible combinations of doing this but with no joy.
I need to pass some variables so ASP, but error occur.
[Code]
but it did not catch any request
Actionscript 2
I am creating an online video for a client. I have it set to play the video in frame 1 and then go to frame 2 once the video has completed. What I'd like to do is have it automatically send me an email once the person has reached that 2nd frame. Is there a way to do this? It wouldn't need to have any kind of form or anything. Just a simple message saying "Fred has watched your presentation".
how to send data from a flash to a database and how the receive it aswell. Im presuming you pass the data from the flash to a php file to the database when sending and call the data using a php file to the database aswell. What im trying to do is just have a button that will increment a number in a database by 1 and then display that information on a different Frame within the flash later.
Basically what i want to do if have a button pressed to increment a number in a database.
I want to send variables from my Flash (AS2) movie to a PHP file that would then process the variables and echo them, but echo in an HTML page. Basically, I want to make my Flash movie form the equivalent of an HTML form, in that, when it's submitted, it sends the variables by POST and opens the PHP page for the PHP page to process and deal with, instead of sending the variables and loading the response from PHP into Flash.
I've been unable to use loadVariables in the usual way that I do it.
Actionscript Code:
form.loadVariables("myPHPfile.php", "POST);
Because that sends the variables to the PHP file, but then does not open the PHP file in the browser. Is there anyway that I can make this work? How can I make the variables send from Flash and then open the PHP page in a new browser window, just like an HTML form would?
having an unusual problem sending vars to php. it is sending the var but my flash game is being unloaded off the site once the var is sent. if there is another way to send VARS please let me know, OR maybe my code is wrong.
Code:
function sender()
{
varsToSend = new LoadVars();
varsToSend.var1 = beatTimer;
[code]....
Anybody knows how to send the data from flash and catch in php scripts?
View 3 RepliesI am trying to send the time to flash but set to the currently timezone. When you view the below even though the echo date, looks like its working the $time is the same. When i test in flash I get the extra hour added.
$format = "d/m/Y H:m:s";
$timezone = "Europe/Amsterdam";
date_default_timezone_set($timezone);
echo "<h1>Timezone ".$timezone."</h1>";
[code]....
If i send bitmap data from Flash AS3, to PHP and then PHP turns the bitmap data into a image file and saves on server... Would it take too much resources?I mean, The Bitmap Data could contain too much pixels etc does that affect the resources? If 10-100 people send data simultaneously is it going to cause problems.
View 3 RepliesI am building a flash website and I want contact information sent to my gmail address.
The Lynda.com tutorial I am using says I need to "enter the php address." What is that and how do I do it?
This is my code edited
if (thename.text == "" || theemail.text == "" || thephone.text == "" || themessage.text =="") {
thefeedback.text = "*Please fill out all fields";
[Code].....
So this is probably a simple question, but for some reason, I'm having problems with it. I have no ideia why, but I suspect the fact that sending a xml with full "< something >" tags may cause the php to behave wrongly.So all I need is to send (from a swf as3 client) a filename and a xml. The php will write a xml file with the required filename.
Everything should be okay with the php side, because I tried it using " $_GET " variables, but whenever I try using the flash client, It just doesent work, and the php log says that "the filename variable can't be empty". Whenever I try some static filename (not using GET or POST), it works.
EDIT: Code added.
var xmlURLReq:URLRequest = new URLRequest("www.url.com");
var test:URLVariables = new URLVariables;
test.filename = "01.xml";[code]............
I was wondering... in the past it was never smart to send flash in emails, but now it's 2011, and I thought, would it be smart to embed flash in emails, and even possible?
View 1 RepliesI'm looking to figure out a simple way to send variables to a flash page.
Basically [URL]
Not sure exactly how it works in flash and out of flash. I searched but couldnt really find anything that worked..
Edit: I found this post
[URL]
But I'm not really sure where to put it and how to execute it. Do I just put the variables in the URL and then put that AS into my code?
On a website I am constructing (search for World Tutors .net on Google and then click Test page next to Webmail at the bottom) I have a contact form with various parts for the user to fill in (some text input boxes, and some COMBO boxes). Having looked on various forums, I thought I undstood how to make the Flash Actionscript 2.0 talk to the php script to send the email (i.e. pass on variables etc.) When the user completes the Client enqiry form and clicks the send button, it looks as though the message has been sent, but no email ever arrives. I've pasted the code I have below.
ActionScript 2.0 code:
stop();
error_clip._alpha = 0;
[code]....
this is my php code
[Code].....
as you can see i want to send variable"t$i" from php to flash but my this code is not working for me.its like i am sending a variable from php to flash which name is a variable. i dont want to use a.text=myData.t0 simply
I am making a flash sign up form that sends the input data to ASP then to the database. In flash I have put input text boxes with variables like email and username etc. Now on my ASP page I have:
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Path=Server.MapPath("DATABASEname.mdb")
[code]....
But its just not getting from ASP to the database. It might be that the ASP is not reading the flash input areas right. Heres the code for sending the data to ASP
Code:
loadVariables("signup.asp", [POST]);
It just doesnt work I have tried for hours but nothing happens
I have a form in flash which has name, email & message. I want to send the data entered from flash to my email address via ASP page. I have found tutorials with flash and PHP. Can anyone help/guide me with flash with ASP?
View 1 RepliesI'll try to explain this as best as I can.I have about 30 .jpg files, 1 .swf file and 1 .php file.I want the PHP to load multiple copies of the SWF and have each copy load a diffrent JPG.
View 14 RepliesI was wondering if there was a way to send out email in Flash via Actionscript? All the tutorials I find, use php in conjunction with Flash. I have no inclination to use php, I don't see why should have to.
View 3 RepliesI want to send some variables to flash, just changing some the URL of the page. Tried adding ?value=2 on the url and receive that on flash, but it�s not working.
View 2 RepliesHas anyone been success in sending an email from within Flash MX? I am trying to launch the email client & being able to add a subject & body information. I have been trying all kinds of combinations with no luck
Also, I have an input box labeled recipient so when I launch the mail client I want the recipient email address to automatically appear in the To line.