[swx] Problem saving swx returned object

Rob Slegtenhorst rob_slegtenhorst at hotmail.com
Thu Apr 24 12:00:40 PDT 2008


I've just uploaded the swf I'm working on to a server, so you guys can at
least see what's happening inside the analyzer. the last call made should
give back the same result as the result before that (as this is nothing more
than a send and receive of the same object) (the last one is:
updateTemplate, and the one before that: loadTemplate).

 

ps. I have updated the script below to add the pieces of script etc. I
forgot to send before.

 

pps. thanks everyone for trying to help me out :)

 

http://www.smmart.nl/testomgeving/triggertree_webshop/php/analyzer/

http://www.smmart.nl/testomgeving/triggertree_webshop/flash/index.htm

 

 

From: swx-bounces at osflash.org [mailto:swx-bounces at osflash.org] On Behalf Of
Rob Slegtenhorst
Sent: Thursday, April 24, 2008 5:53 PM
To: 'SWX Mailing List'
Subject: [swx] Problem saving swx returned object

 

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 

 

import org.swxformat.*;

 

var swxContent:SWX = new SWX();

swxContent.gateway =
"http://www.triggertree.nl/configurator/swx/php/swx.php";

swxContent.encoding = "POST";

swxContent.debug = true;

 

_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();

}

 

// 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():Void {

                var saveTemplateCallDetails:Object = {

                               serviceClass:"TemplateController",

                               method:"saveTemplateDetails",

                               args:[ _root.templateArray],
<- If i were to change this to _root.templateArray.month_font.id, it works

                               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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/swx_osflash.org/attachments/20080424/1cb65036/attachment.html 


More information about the swx mailing list