[swx] Flash/SWX/PHP - writing array contents to text file

Aral Balkan aral at aralbalkan.com
Fri Sep 21 14:48:54 PDT 2007


Hi,

Are you using the SWX ActionScript Library?

If not, you have to pass arguments from Flash to the SWX RPC gateway
in JSON format (serialized as a JSON string).

The SWX ActionScript Library does this for you automatically.

If you don't want to use the whole library, you can just use the
prepare() static method of the SWX class to serialize your arguments
into JSON format.

ie.,

import org.swxformat.SWX;

// Other loader properties (serviceClass, etc.)
loader.args = [1,2,3];

SWX.prepare(loader);

loader.loadMovie // etc.

More info:
http://swxformat.org/documentation/swx-php/#98
http://swxformat.org/documentation/swx-php/#99

Does this help?

Take care,
Aral


On 9/20/07, azsl1326-email at yahoo.com <azsl1326-email at yahoo.com> wrote:
>
> I am using Flash, SWX and php to write to a text file. If I pass an array
> via SWX to php the only value that gets written in the text file is the
> string 'Array'.  However, if I have the contents of the array returned to
> flash, it returns the correct content. If I change the argument that is
> passed to a string, it writes correctly to the text file.
>
> Here's the simple php code:
>
> function writeData($val)
>         {
>             $fp = fopen('test.txt', "w");
>             fwrite($fp, $val);
>             if(fclose($fp))
>             {
>                 return $val;
>             }
>         }
>
> Any ideas?
>
> Thanks for the help.
>
> _______________________________________________
> swx mailing list
> swx at osflash.org
> http://osflash.org/mailman/listinfo/swx_osflash.org
>
>



More information about the swx mailing list