ActionScript 2.0 :: Send An Array To Flash From PHP?
Mar 2, 2010
So I'm trying to send an array of values from PHP to Flash, but the problem is any character I could use to separate the values could potentially be in the value itself.
Fine, no problem I thought. I'll just urlencode the variables and allow (for arguments sake) commas to separate the 'encoded' values.
Just after I'd finished laughing about my mighty victory over code adversary as I often do, I attempted to fetch the array from the PHP file and I quickly learned that Flash automatically applies the 'escape' function to the data after it is received. My laughter was replaced by (for theatrical sake) tears!
A way to tell Flash to stop automatically 'escaping' the incoming variables, or
A way to send an array of values without using a character that could be used in the variable (which could be anything... fullstops, commas, dashes. Pretty much anything within reason)
Now, before you mention that I should just make a NVP (Name value pair) for each variable in the array, know that there is quite a lot of data already being loaded, and adding (what I consider is) unnecessary extra NVP syntax (which would double the large amount of data I'm sending) could potentially cause trouble, not to mention a general lack of bandwidth.
Should I bite the bullet and NVP my arrays (ugh!), or maybe use an obscure character as the separator... but I would like a practical approach to this solution... like stopping Flash from automatically escaping the input.[code]...
View 4 Replies
Similar Posts:
Jan 13, 2008
I am using flash 8 and actionscript 2 I have created an array in flash to send to php using getURL and POST. i.e.
on (release) {
var id:Array = new Array();
id.txt_4 = 'nopanels';
id.txt_2 = 'xheight';
id.txt_3 = 'xwidth';
[code].....
I am trying to make it 'register globals = off' compatible.
View 2 Replies
Mar 24, 2011
I have a video file in my local system.I am using windows XP in my system. Now i want to send this video file byte array to server in Flash Builder (Flex 4). I am using PHP at server end.
View 5 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
Aug 15, 2009
I am trying to send an array to php and from there to mail as a message that array. the problem is that in the php script nothing happens. The problem is that I don't know any much php.[code]And nothing is happen in the echo. The script is tested live in a web server that is supporting php and mail.
View 1 Replies
Feb 13, 2009
how I could send an array to PHP?I know I could essentially do a request to my PHP page per item in my array, but I would rather send the array to PHP and then have PHP do the calling to the database.
My array in flash will look like this:
Code:
var data:Array = [
{position:xxx,type:text(or video),title:some title,tcIn:"00:00:00.00",tcOut:"00:00:00.00"},
{position:xxx,type:text(or video),title:some title,tcIn:"00:00:00.00",tcOut:"00:00:00.00"},
{position:xxx,type:text(or video),title:some title,tcIn:"00:00:00.00",tcOut:"00:00:00.00"},
{position:xxx,type:text(or video),title:some title,tcIn:"00:00:00.00",tcOut:"00:00:00.00"},
[code]....
View 1 Replies
Jun 24, 2011
In efforts to allow users to save their progress in my application, I've decided to allow them to save. In order to do this, I'd like to create an array with all the necessary information, and send that information to a coldfusion (.cfm) file and process the information from that page. Is it possible to send an array instead of a bunch of url variables? It is possible (and quite probable) that users would exceed the query string length of most browsers.
View 1 Replies
Apr 29, 2011
I have a collection of Objects in an ArrayCollection in my flex page.
What is the best approach to send this data to a Java Servlet?
The object in the ArrayCollection is a VO that consists of an id and message for now. I want a solution that is scalable in case more properties are added later on.
View 1 Replies
Jul 26, 2011
I am using FB for PHP 4.5, ZendAMF, and I read that I do not need to use HTTPService for what I want to do.
Table structure:
people: {pID, pName}
departments: {deptID, deptName}
people_departments: {pID, deptName}
I have a slightly complex flex script, People.mxml. In the PersonAdd state, I have a form which will be used to send data to the mysql server. In that form , I have a repeater that will create a checkbox for every department in my database. When I click the Add button, I want to insert data into the people and people_departments tables.
[Code]...
[Edit] I am using an s:Checkbox and I do not have the data property. mx:Checkbox does but I cannot use the mx:Checkbox component in my project.
View 2 Replies
Dec 5, 2010
I need to send an array of objects from Flex to a Ruby Web service, but sending them as parameters is not getting through since they seen to come through as Objects instead of readable data.
Sending it as raw XML or JSON didn't work either so the last resort might be to send everything in a HTTP query. However, I'm not sure how to do this since the array contains objects, all of which have 4 or 5 properties, and I don't know what the right format would be.
View 1 Replies
Jan 3, 2010
I am new to php and specially AMFPHP, now all I am trying to do is send and Array to PHP using AMFPHP and get it back, but it returns "null";.
Code:
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class Main extends Sprite {
[Code] .....
View 3 Replies
Oct 13, 2011
I need some help creating an array from a string send via POST from a php loop.The string looks sorta like this: keyword=key1val &
text=text1val & keyword=key2val & text=text2val
(spaces added for readability)
I have a little bit of control over how the string is sent. So I could add numbers to the keys in the string, so they read like this
keyword1=key1val & text1=text1val & keyword2=key2val
basically I want to then end up with an array
noteCards[0] = ["key1val", "text2val"];
noteCards[1] = ["key1val", "text2val"];
View 2 Replies
Mar 5, 2012
I upload a file using adobe air HTTPService.Send method by passing byte array of file content read using FileReference. When I write the set of bytes from the server side (php) it writes the details of the byte array (buff) to the file instead of contents of the file like "endian=bigEndian&position=0&bytesAvailable=61127&length=61127&objectEncoding=3" . Below I have included the code that how I read the file and send it to server. Is there anyway that i can directly pass the data in the byte array to send method?
File Read
var buff:ByteArray = new ByteArray();
var localFilePath:String = "/Videos/sample.txt";
var uploadedFile:File = new File(localFilePath);
[Code]....
View 1 Replies
Mar 11, 2004
I searched around and found some helpful things, but I am still missing something I think...
LoadVariables() won't work across domains, right, so, is it porrible to send data to a CGI script via getURL and not have a popup window on send?
View 3 Replies
Mar 18, 2010
I have a problem with shareobject. the Send method does not work. I work with AS3 My code
[Code]....
View 4 Replies
Nov 24, 2005
I am actually discovering Classes.I try to make a class that reads out an XML file and than converts it into arrays.the array is well created in the class file, but I can't send it back to the swf correctly: it only duplicates the first item of the array in an infinite loop, but when I trace it into the class the output displays it right..
with this code I call the class:
Code:
var myProduct:Product = new Product("gallery.xml");
this.onEnterFrame = function() {
trace(myProduct.getArray());
[code]....
View 1 Replies
Mar 12, 2009
a week ago I bought the following monster template template:[URL]..my last changes to it were to the popup boxes that appear on the SERVICII page when you click those titles there. Right after those changes it compiled and published, everything ok, i did several other tasks in Photoshop then back to my flash and at the next recompile, Error - Send don't send Flash has to close. I reopened it and it keeps closing forced. I tried undoing my steps but nothing worked. I am desperate, the project is due completion on saturday and my source is messed up.
Can anyone tell me why I get that? Has anyone been in a similar situation.I am a flash newbie, I saw no errors in "Compiler Errors" or in "Output", just force closing the Flash CS3.
View 8 Replies
Jul 13, 2010
I am curious if this is an okay implementation of the Array.filter() method.
[Code]...
I was not able to figure out an implementation of the callback function for the filter() method, where the callback was outside of the getGallery() function. I wonder if there is a way to get the isGallery function outside of the getGallery scope?
View 1 Replies
Oct 17, 2011
iSo let's say I have three different arrays of objects, and I want to combine them into one sorted array. I want the order to be such that the items from each array are evenly distributed throughout the sorted array.
If there were 3 xItems, 3 yItems, and 3 zItems, the sorted array would have this order: x, y, z, x, y, z, x, y, z
HOWEVER, even if the arrays are differing lengths, I still need to make them alternate as much as possible. If there were 6 xItems, 4 yItems, and 2 zItems, the sorted array should have this order: x, y, x, y, x, z, x, y, x, y, x, z
View 1 Replies
May 20, 2011
I use this code to convert an image to a BitmapData and store a JPG in a ByteArray.
import com.adobe.images.JPGEncoder;
var jpgSource:BitmapData = new BitmapData (img_mc.width, img_mc.height);
jpgSource.draw(img_mc);
[code]....
Now, I want to do the following:
1. send the ByteArray to PHP;
2. PHP must store a physical image_id.jpg on server;
3. then PHP must return the URL of the image to Flash;
The first lines of PHP could be:
if (isset($GLOBALS["HTTP_RAW_POST_DATA"]))
{
// get bytearray
$jpg = $GLOBALS["HTTP_RAW_POST_DATA"];
[code]....
View 1 Replies
Jul 13, 2010
I'm passing a Javascript Array() to Flash via FlashVars but Flash complains. Can you guys point me what am I doing wrong here?
javascript code
// array with the user defined cities
var usercities = new Array(
[code]......
View 3 Replies
Jun 22, 2011
I know how to remove duplicates from an array, but what I'm trying to do is prevent an item from ever being added to an array in the first place if it already exists. I'm pulling in data from an xml feed in a loop, and I thought that searching for that values index would work, but no matter what, the index is always -1. Here's my code:
[Code]...
Maybe I'm misunderstanding the indexOf function, but I thought it was supposed to return -1 if a value did not exist in an array. What am I doing wrong?
View 4 Replies
Oct 20, 2011
anyone knows how to pass an array values from an HTML into flash? Well, to begin I'll discuss what am I doing. I edited a twitter widget javascript which search tweets based on the hashtag I needed then passing it on an array per tweet and then displaying it using a <div> it updates once every 5 minutes. Now I want to display those tweets on a dynamic text on Flash. Let's say I will have 5 dynamic text placed on my flash file then; I want each of those dynamic text to have the tweets I have based on on my HTML arrays to be displayed in random.
View 2 Replies
Dec 10, 2010
Example of code which would be used to send a bunch of variables to a PHP script via flashThis would require the PHP script to load when the data is sent.I want to use this for a Flash event calender which triggers more information about the event to appear in a HTML area of the page when an event is clicked on. The PHP file would be the same file that the SWF is embeded in so the FLASH file would reload the page with the variable sent to the PHP. The PHP would use this variable to select the right content from a MySQL database.
View 13 Replies
Jun 4, 2010
I have to send some specific xml to a php script (from flash AS2) that then sends out sms message based on the xml. I have been given the xml by the sms sender and have tested it via their live demo and that works fine. The problem I am having is getting flash to send this XML.
The sms sender states that it needs to recieve the xml in the following format: The XML Document should be posted uriencoded, with a UTF‐8 character set as paramaeter 'xml'
Here is the code I have so far, I think something is missing maybe. I have tried running the swf in a browser rather than in the flash testing environment
var my_xml:XML = new XML('<xml></xml>');
my_xml.contentType = "text/xml";
send_btn.onRelease = function () {
[Code]....
View 1 Replies
Jun 4, 2010
I'm trying to send array of data from Flash to PHP to sending e-mail. I'd like to do that because I must change the php page everytime my form site changes because of client's choice.[cod]e...
View 1 Replies
Nov 15, 2010
I need to send a tweet from flash, so i've been looking for solution on the net, but everything i found is using as3. Since i don't know anything of as3, it becomes difficult to edit everything.
View 1 Replies
Sep 13, 2011
So, I have learned how to actually send data from Flash, but how do I in ActionScript send data every 3 second?
View 1 Replies
Jul 11, 2008
Is it possible to send sms from flash, by using PHP? I would be greatful if someone knew about a tutorial for this, or if anyone has any idea about how to do this.
View 3 Replies