[swx] swx Digest, Vol 3, Issue 6

azsl1326-email at yahoo.com azsl1326-email at yahoo.com
Tue Sep 25 11:28:17 PDT 2007


HI ---

Thanks for the reply. I am using the SWX Actionscript library. If I am trying to store an array's contents in a text file, the only way I have found to do it is to either pass the items of the array individually as you explained or pass the array itself and then loop thru the array object in php. Is this correct?

i.e. 

// will have to loop thru the array object in php 
// ...looping thru in php 
//      foreach ($vall as $i => $value) 
//      {
//              fwrite($fp, $vall[$i]);
//       }

//AS Code
var someArray:Array = new Array(1,2,3)
loader.args = [someArray];
SWX.prepare(loader);

OR

//just pass the array contents 
loader.args = [1,2,3];
SWX.prepare(loader);

Thanks.


----- Original Message ----
From: "swx-request at osflash.org" <swx-request at osflash.org>
To: swx at osflash.org
Sent: Saturday, September 22, 2007 12:00:03 PM
Subject: swx Digest, Vol 3, Issue 6

Send swx mailing list submissions to
    swx at osflash.org

To subscribe or unsubscribe via the World Wide Web, visit
    http://osflash.org/mailman/listinfo/swx_osflash.org
or, via email, send a message with subject or body 'help' to
    swx-request at osflash.org

You can reach the person managing the list at
    swx-owner at osflash.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of swx digest..."


Today's Topics:

   1. Re: Flash/SWX/PHP - writing array contents to text file
      (Aral Balkan)


----------------------------------------------------------------------

Message: 1
Date: Fri, 21 Sep 2007 17:48:54 -0400
From: "Aral Balkan" <aral at aralbalkan.com>
Subject: Re: [swx] Flash/SWX/PHP - writing array contents to text file
To: "SWX Mailing List" <swx at osflash.org>
Message-ID:
    <db3c36f80709211448r2f8732fbpfd27de7f32e9d32e at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

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
>
>



------------------------------

_______________________________________________
swx mailing list
swx at osflash.org
http://osflash.org/mailman/listinfo/swx_osflash.org


End of swx Digest, Vol 3, Issue 6
*********************************




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/swx_osflash.org/attachments/20070925/fcfb6b61/attachment.html 


More information about the swx mailing list