[swx] Problem saving swx returned object

Rob Slegtenhorst rob_slegtenhorst at hotmail.com
Thu Apr 24 11:34:17 PDT 2008


Sorry for that, root.templateArrayTest is defined. and this is the setup
i've defined:

var swxContent:SWX = new SWX();
swxContent.gateway = ***
swxContent.encoding = "POST";
swxContent.debug = true;

so, yes, it is an swx actionscript api thing (correct me if I'm wrong).

I still can't figure it out.. the problem only occurs when I try to send the
complete object, if I send just a single item
(_root.templateArray.month_font.id for example) it's passed trough just
fine..

are there any know problems with sending objects like this?

-----Original Message-----
From: swx-bounces at osflash.org [mailto:swx-bounces at osflash.org] On Behalf Of
Nederflash (Folkert Hielema)
Sent: Thursday, April 24, 2008 8:17 PM
To: SWX Mailing List
Subject: Re: [swx] Problem saving swx returned object

Two things. First i do not see: _root.templateArrayTest defined 
somewhere, while that is what you give the non working 
updateTemplate(_root.templateArrayTest);

Maybe it's not there or a typo from othere tests or somekind.

Second, is swxContent a SWX actionscript api thing ? if not the 
arguments you give: [args] should be JSON format.

If the last is the case you look at the archive from this list ;)

Hope i scanned your code well and it helps,

Folkert
http://nederflash.nl (With Dutch SWX documentation and articles).

Rob Slegtenhorst wrote:
> Hey guys,
> 
>  
> 
> I have a weird little problem.. I'm trying to save an object returned 
> from swx, but getting nowhere.. below the AS and PHP, any help is 
> greatly appreciated.
> 
>  
> 
> (second mail btw.. sent the last one with the wrong mail account)
> 
>  
> 
>  
> 
> // AS
> 
>  
> 
> _root.templateArray = new Object;
> 
> _root.templateArray2 = new Object;
> 
>  
> 
> function loadTemplate(template_id:String):Void {
> 
>                 var saveTemplateCallDetails:Object = {
> 
>                                serviceClass:"TemplateController",
> 
>                                method:"getTemplateDetails",
> 
>                                args:[template_id],
> 
>                                progress:[this, progressHandler],
> 
>                                fault:[this, faultHandler],
> 
>                                timeout:[this, timeoutHandler],
> 
>                                result:[this, loadTemplateResultHandler]
> 
>                 };
> 
>                 swxContent.call(saveTemplateCallDetails);
> 
> }
> 
>  
> 
> function loadTemplateResultHandler(resultObj:Object):Void {
> 
>                 _root.templateArray = resultObj.result;
> 
>                 updateTemplate(_root.templateArrayTest);
> 
> }
> 
>  
> 
> // everything up to here works, and I get a nice object entered in 
> _root.templateArray. Below is where the problem occurs.
> 
> //
> 
> // the object looks like this:
> 
> //
> 
> // _root.templateArray
> 
> //            _root.templateArray.month_font
> 
> //                           _root.templateArray.month_font.id
> 
> //                           _root.templateArray.month_font.font
> 
> //                           _root.templateArray.month_font.size
> 
> //            _root.templateArray.week_font
> 
> //                           _root.templateArray.month_font.id
> 
> //                           _root.templateArray.month_font.font
> 
> //                           _root.templateArray.month_font.size
> 
> //
> 
> // etc.
> 
>  
> 
> function updateTemplate(post:Object):Void {
> 
>                 var saveTemplateCallDetails:Object = {
> 
>                                serviceClass:"TemplateController",
> 
>                                method:"saveTemplateDetails",
> 
>                                args:[post],
> 
>                                progress:[this, progressHandler],
> 
>                                fault:[this, faultHandler],
> 
>                                timeout:[this, timeoutHandler],
> 
>                                result:[this, updateTemplateResultHandler]
> 
>                 };
> 
>                 swxContent.call(saveTemplateCallDetails);
> 
> }
> 
>  
> 
> function updateTemplateResultHandler(resultObj:Object):Void {
> 
>                 templateArray2 = resultObj.result;
> 
> }
> 
>  
> 
> php:
> 
>  
> 
> nothing spectacular here, just return the object.
> 
>  
> 
>                 Function saveTemplateDetails($aTemplate)      {
> 
>                               
> 
>                                return $aTemplate;
> 
>                               
> 
>                 }
> 
>  
> 
> this functions returns null...
> 
>  
> 
> thanks again for any help.
> 
>  
> 
> Rob
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> swx mailing list
> swx at osflash.org
> http://osflash.org/mailman/listinfo/swx_osflash.org
> 
> 
> ------------------------------------------------------------------------
> 
> No virus found in this incoming message.
> Checked by AVG. 
> Version: 7.5.524 / Virus Database: 269.23.4/1395 - Release Date: 24-4-2008
7:24


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




More information about the swx mailing list