[swx] Problem saving swx returned object
rob slegtenhorst
rob_slegtenhorst at hotmail.com
Thu Apr 24 14:58:38 PDT 2008
wow! thank you so much, you have no idea how much you've just saved my butt (this project has to be ready for testing by monday ;))
are there any side effects to this change? (any reason why Aral used the 'x instanceof Object' function over this one? (I'm not familiar with any of these codes))
once again thank you (to everyone else who helped as well off course), now I can go to bed in peace :)
greets,
Rob
> From: holger.arndt at synap.de> To: swx at osflash.org> Date: Thu, 24 Apr 2008 22:24:41 +0200> Subject: Re: [swx] Problem saving swx returned object> > Hi Robert,> as you can read below, i have worked on that problem a while> and found a clue to what the problem might be.> > And i have found a radical solution :-)> > So the object that is returned to a SWXcallback is an Object but the > result property is not...or better no quite :-)> To Flash it is an object because typeof(e.result) rturns the String > "object"> But when using strict typing, as you can read below, e.result is NOT > an Object> And the instanceof function also returns false...> > So what to do...?> go into the class org.swxformat.SWX> and find the function "arrayToJson"> this is called for preparing the args-Array.> Within it you will find that Aral used the> "x instanceof Object"> function to see if a parameter is indeed an Object> when you change this to> typeof x = "object"> it works fine and you can send resultObjects directly as args again> > So before you jump ahead, i want you to notice that you change > sourceCode that's not yours.> OK, now go ahead ;-)> > > Greets,> Holger Arndt> > > > ************EARLIER**************> so far I can only confirm that there is indeed a problem with using > the result object of SWX.call as an argument> within the result handler.> i constructed a simple call to a method like yours on the server side, > which only returns the object itself> and just used the result property as the args parameter for the second > call to just the same method and it returns null.> So I'm trying to figure out, what the problem is but it seems that > it's noting special to your script...> > A clue to the problem might be that e.result is not seen as an Object > in Flash (see below):> > var example = {name:"senseless"};> trace(example.constructor==Object);//true> > But in the callback function:> function resultHandlerFromSwx(e:Object){> trace(e.constructor==Object); //true> trace(e.result.constructor==Object); //false> }> > And when pass the result property directly to a function that strictly > accepts only Objects, i get a compiler error...> > function resultHandlerOne(e:Object){> echo(e.result);> }> function echo(result:Object){> //error : type mismatch> }> > If i use strict typing to MovieClip, it passes without error...> ******************************************> > I HAD TO CANCEL THE REST OF THE MESSAGES OR THE MAILER WOULDNT ACCEPT > IT....> > _______________________________________________> swx mailing list> swx at osflash.org> http://osflash.org/mailman/listinfo/swx_osflash.org
_________________________________________________________________
De leukste online filmpjes vind je op MSN Video!
http://video.msn.com/video.aspx?mkt=nl-nl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/swx_osflash.org/attachments/20080424/14fb48fe/attachment-0001.html
More information about the swx
mailing list