PDA

View Full Version : Loading a remote swf into parent, default arraycollection result of httpservice fails


jmars
02-08-2007, 05:00 PM
I have a simple flex app which loads an external XML into an arrayCollection using HTTPService send method. This works fine as both a stand-alone, or when loaded into it's parent as a LOCAL file via the SWFLoader tag. However, when I place this child file onto a remote server and try to load it into the parent which resides on my desktop, the ArrayCollection default resultFormat of the send method triggers the following runtime error (listed below). I don't think it's a sandbox issue because when I change result format to e4x, it works fine remotely. I've been hitting a wall on this for days now... Please advise and thanks to all in advance!!!
-------------------------------------------------------------------
PARENT SWF
-------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" initialize="initData()">
<mx:Script>
<![CDATA[
public var baseURL:String;
public function initSWF(swfURL:String):void {
remote_swf.load(swfURL);
}
public function initData():void
{
baseURL = "http://blahblahblah";
Security.allowDomain(baseURL);
}
]]>
</mx:Script>
<!-- WORKS LOCALLY -->
<mx:Button label="Load LOCAL SWF APP" click="initSWF('remoteSWF.swf')"/>
<!-- DOES NOT WORK REMOTELY -->
<mx:Button label="Load REMOTE SWF APP" click="initSWF('http://blahblahblah/remoteSWF.swf')"/>
<!-- LOADER -->
<mx:SWFLoader height="100%" width="100%" id="remote_swf" autoLoad="false" visible="true" scaleContent="false"/>
</mx:Application>
-------------------------------------------------------------------
CHILD SWF
-------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="getXMLData()">
<mx:HTTPService id="myTeams" url="http://blahblahblah/xml/myXML.xml"/>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
import mx.collections.ArrayCollection;
public function getXMLData():void
{
Alert.show(Security.sandboxType);
myTeams.send();
}
]]>
</mx:Script>
<mx:Label text="THIS IS THE LOADED SWF WHICH HAS JUST PERFORMED A SEND ON HTTP SERVICE TO CREATE ARRAY COLLECTION"></mx:Label>
</mx:Application>


------------ RUNTIME ERROR ---------------------------------
ArgumentError: Error #1063: Argument count mismatch on Object/http://adobe.com/AS3/2006/builtin::hasOwnProperty(). Expected 0, got 2.
at mx.rpc.xml::SimpleXMLDecoder/decodeXML()
at mx.rpc.xml::SimpleXMLDecoder/decodeXML()
at mx.rpc.xml::SimpleXMLDecoder/decodeXML()
at mx.rpc.http::HTTPService/http://www.adobe.com/2006/flex/mx/internal::processResult()
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()
at mx.rpc::Responder/result()
at mx.rpc::AsyncRequest/acknowledge()
at ::DirectHTTPMessageResponder/completeHandler()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()