Introduction

Last modified on 2007-08-25 15:12:12 GMT. 0 comments. Top.

SWX and SWX RPC work in Flash Lite 2.0 and 2.1. In fact, SWX RPC is the only RPC solution for Flash Lite since Flash Remoting is not supported on Flash Lite. With its low processor overhead and native support in Flash, SWX is the ideal data format for mobile applications with Flash Lite.

Check out the MiniFlickr sample application that comes with SWX PHP for an example of how to build data-driven Flash Lite applications using SWX.

Keep in mind that, due to a bug in Flash Lite, you cannot make POST requests in a loadMovie call. Instead, you must make GET requests when using SWX RPC with Flash Lite. For more information on this, see the Mobile Limitations section, below.

The MiniFlickr application makes use of the ExternalAsset and LoadManager classes that come with SWX AS to queue all load requests (data and assets such as images). This is essential in mobile development as most handsets will fail if you try to load two things at once. The SWX AS Full API handles the queueing of requests for you and gives you a general purpose load queue that you can use in your own applications. Make sure you study the MiniFlickr sample if you want to create Flash Lite applications using SWX PHP.

Swx Mobile Device Central

SWX and SWX RPC advantages for mobile development

Last modified on 2007-08-25 15:13:37 GMT. 1 comment. Top.

SWX RPC is the only RPC solution for Flash Lite and, beyond that, it works really well and is simple to use. Here is a summary of some of the advantages of the SWX data format and SWX RPC for Flash Lite development:

  • Native; data is ready to use the moment it loads as native ActionScript objects.
  • No processor-intensive parsing, etc.
  • No plumbing code for deserializing requests.
  • Public gateway and APIs for mobile mashups.
  • Only RPC solution for Flash Lite.
  • Easy to understand and use.

11 Responses to “SWX RPC for Flash Lite (Mobile)”


  1. 1 RIBOTMINIMUS

    aral, you got the link to that swx-based flickr app (shown above)? me wanna play.

    ta

  2. 2 RIBOTMINIMUS

    maybe i’ll just dl SWX PHP..

  3. 3 aral

    Hi Ribot,

    It’s in the SWX ActionScript Library and SWX PHP/SWX PHP MAMP Bundle releases. Have fun and do let me know how it goes! :)

  4. 4 glenn

    Aral you have done a nice job :)
    i hope really that you come up whit
    some good starting tutorials and more
    examples cus i find it still hard to
    develop my own application.
    More video tutorials would be nice :P

  5. 5 Stefan Wessels

    Hi Aral!

    We finally have some time to do our own stuff, going to get SWX up and running now, very excited to play with it!

    Stefan

  6. 6 aral

    @Glenn: More tutorials and screencasts are on the way… I just need to convert/upload them. Being on the road isn’t helping!

    @Stefan: That’s cool, do let me know how you get on and feel free to submit your work to the SWX Showcase! :)

  7. 7 Amit

    Hi,

    I want to develope an application/game in flashlite 2.0 using swx…but how should i proceed for that??

  8. 8 aral

    Hi Amit,

    I would use the SWX ActionScript Library and create an application with that.

    For example, download the SWX AsLib and unzip it somewhere. Then, in that folder, create a FlashLite 2.0 or 2.1 FLA. On the Stage, create an empty movie clip and give it the instance name imageHolder.

    On the first frame, create an Actions layer and type the following into it:

    import org.swxformat.SWX;
    
    var swx:SWX = new SWX();
    swx.gateway = "http://localhost:3004/swx";
    swx.encoding = "GET";
    
    var callParameters:Object =
    {
        serviceClass: "Flickr",
        method: "swxPhotosGetRecent",
        args: ["small", "", 1],
        result: [this, resultHandler]
    }
    
    swx.call(callParameters);
    
    function resultHandler(event:Object):Void
    {
        image.loadMovie(event.result.photo[0].src);
    }

    Test the movie and, in Device Central, you should see the latest photograph from Flickr.

    Hopefully, that should get you started!

  9. 9 raj

    hi ,
    could you please explain any very simple example to use on native flash.. to understand the concept. and the vital parts to start with. i have seen your getting started but still i didnt get it…

  10. 10 akhil

    hi aral i tried this code but it still is not working….

    import org.swxformat.SWX;

    var swx:SWX = new SWX();
    swx.gateway = “http://localhost:3004/swx”;
    swx.encoding = “GET”;

    var callParameters:Object =
    {
    serviceClass: “Flickr”,
    method: “swxPhotosGetRecent”,
    args: ["small", "", 1],
    result: [this, resultHandler]
    }

    swx.call(callParameters);

    function resultHandler(event:Object):Void
    {
    image.loadMovie(event.result.photo[0].src);
    }

  1. 1 biskero.org

Leave a Reply




Bad Behavior has blocked 3570 access attempts in the last 7 days.