Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 09-23-2002, 03:26 PM   #1
Registered User
Join Date: Sep 2002
Location: Maidstone, Kent, UK
Posts: 2
Question Passing arrays PHP -> Flash

I want to send an array from PHP to Flash, and I have tried something like this:
for($i=0; $i<$max; $i++){
Flash can pick up flasharray and dynamically print from it - for instance if a text field is set to flasharray[10] it prints fine, BUT I don't think it's really an array, just an object called "flasharray[10] so any attempt to access it, like trying
if(flasharray[i]="Pig" will not work. Can anyone tell me how I should be sending arrays please?
JohnnyS is offline   Reply With Quote
Old 09-23-2002, 03:47 PM   #2
Join Date: Jun 2001
Location: portland, or
Posts: 8,106

ya, its not really an array, flash imports its vars as strings. split your arrays out on the flash side.
what the hell was i thinking?
tg is offline   Reply With Quote
Old 10-08-2002, 05:32 PM   #3
Registered User
Join Date: Sep 2002
Location: Maidstone, Kent, UK
Posts: 2

I have now done it by sending a string from PHP to Flash but there are pitfalls-you are limited to the length of string you can send in one go, and I had to send in 4 chunks. These I stored and split() into 4 arrays which I joined to make my finished array. Another pitfall worth knowing about is this:
for(i in myArray){
i is not an integer! If you try and use it to access arrays, it falls over. You must recast it with Number(i); Hope this helps someone...
JohnnyS is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 01:45 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.