[swx] multiple SWX instances in actionscript

Aidann Bowley aidann at ukgateway.net
Tue Jan 1 09:53:56 PST 2008


Hi there and happy new year!

Nice Flash Twitter - did you get it working the way you wanted?

I'm guessing that your repeated calls get overwritten. Have you tried 
creating a new instance of the class?, e.g.

function flickrSWX(){
     var myFlickrSwx = new SWX();
     myFlickrSwx.gateway = "http://swxformat.org/php/swx.php";
     myFlickrSwx.encoding = "POST";
     var callParameters:Object =
        {
         serviceClass: "Flickr",
         method: "photosSearch",
         args: ["","","test"],
         result: [this, flickrCallback]
         }
    myFlickrSwx.call(callParameters);
}
function twitterSWX(){
     var myTwitterSwx = new SWX();
     myTwitterSwx.gateway = "http://swxformat.org/php/swx.php";
     myTwitterSwx.encoding = "POST";
     var callParameters:Object =
         {
          serviceClass: "Twitter",
          method: "getNumFriendsUpdates",
          args: ["benniejolink", 1],
          result: [this, twitterCallback]
         }
     myTwitterSwx.call(callParameters);
}
function flickrCallback(event:Object){
        //do flickr stuff
        var flickrParameters:Object ={
            //etc
        }
        //call twitterSWX
        twitterSWX(flickrParameters);
}
function twitterCallback(event:Object){
    //do twitter stuff
}

//init
flickrSWX();

Cheerio for now,

Aidann

----- Original Message ----- 
From: "Bennie Jolink" <benni.jolink at gmail.com>
To: <swx at osflash.org>
Sent: Saturday, December 29, 2007 7:34 AM
Subject: [swx] multiple SWX instances in actionscript


> hello all,
>
> I'm working on a flash twitter app: www.eerkmans.nl/eurosonic.
>
> I'm having trouble with actionscript instances of the swx class. When I 
> have
> a single instance (see the actionscript pasted below) everything runs 
> fine,
> but when this function gets called more than once at the same time,
> everything stops working. I want to make a flickr call and a twitter call 
> at
> approximately the same time.
>
>        var mySwx = new SWX();
>        mySwx.gateway = "http://swxformat.org/php/swx.php";
>        mySwx.encoding = "POST";
>
>        var callParameters:Object =
>        {
>            serviceClass: "Flickr",
>            method: "photosSearch",
>            args: ["","","test"],
>            result: [this, flickrCallback]
>        }
>        mySwx.call(callParameters);
>



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





More information about the swx mailing list