ryosaeb4
02-10-2009, 03:43 PM
Dear Actionscript.org friends
I've try to make this comboBox where I try to populate it with a HTTPService calling
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init(event)">
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.collections.ArrayCollection;
import mx.events.FlexEvent;
[Bindable]
private var units:ArrayCollection = new ArrayCollection();
//private static var urlBase: String = new String(ConfigUrl.getInstance().dataProvider) + "Service.asmx/GetAllApps";
private var urlBase:String = "assets/prova.xml";
private function init(evt:FlexEvent):void{
unitRPC.url = urlBase;
unitRPC.resultFormat = "e4x";
unitRPC.send()
}
//Array per popolare la ComboBox di selezione viste per applicazione
public function unitRPCResult(event:ResultEvent):void
{
units=event.result.itemCollection.item;
comboBOXX.dataProvider = units;
}
]]>
</mx:Script>
<mx:HTTPService id="unitRPC" result="unitRPCResult(event)"/>
<mx:ComboBox id="comboBOXX" y="28" right="169"/>
</mx:Application>
I've debug it but the comboBox is not populate and I've this error
[SWF] Users:walterfantauzzi:Documents:Flex Builder 3:ProvaComboBox:bin-debug:ProvaComboBox.swf - 1,014,624 bytes after decompression
*** Security Sandbox Violation ***
Connection to assets/prova.xml halted - not permitted from file://localhost/Users/walterfantauzzi/Documents/Flex Builder 3/ProvaComboBox/bin-debug/ProvaComboBox.swf
WHY?
I've try to make this comboBox where I try to populate it with a HTTPService calling
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init(event)">
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.collections.ArrayCollection;
import mx.events.FlexEvent;
[Bindable]
private var units:ArrayCollection = new ArrayCollection();
//private static var urlBase: String = new String(ConfigUrl.getInstance().dataProvider) + "Service.asmx/GetAllApps";
private var urlBase:String = "assets/prova.xml";
private function init(evt:FlexEvent):void{
unitRPC.url = urlBase;
unitRPC.resultFormat = "e4x";
unitRPC.send()
}
//Array per popolare la ComboBox di selezione viste per applicazione
public function unitRPCResult(event:ResultEvent):void
{
units=event.result.itemCollection.item;
comboBOXX.dataProvider = units;
}
]]>
</mx:Script>
<mx:HTTPService id="unitRPC" result="unitRPCResult(event)"/>
<mx:ComboBox id="comboBOXX" y="28" right="169"/>
</mx:Application>
I've debug it but the comboBox is not populate and I've this error
[SWF] Users:walterfantauzzi:Documents:Flex Builder 3:ProvaComboBox:bin-debug:ProvaComboBox.swf - 1,014,624 bytes after decompression
*** Security Sandbox Violation ***
Connection to assets/prova.xml halted - not permitted from file://localhost/Users/walterfantauzzi/Documents/Flex Builder 3/ProvaComboBox/bin-debug/ProvaComboBox.swf
WHY?