HTTPService issues

I'm having difficulty in getting a simple HTTPService call to
work
I've got a simple MySQL DB, using one table with 3 records
and 3 fields
I'm evaluating Flexbuilder 2 and can't seem to construct a
valid result
My PHP page call returns the following XML:
<jobfamilies>
<job>
<jobid>1</jobid>
<surveyid>1</surveyid>
<familyname>Accounting</familyname>
</job>
<job>
<jobid>2</jobid>
<surveyid>1</surveyid>
<familyname>Bookeeping</familyname>
</job>
<job>
<jobid>3</jobid>
<surveyid>1</surveyid>
<familyname>Construction</familyname>
</job>
</jobfamilies>
My MXML code looks like this:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute"
initialize="initializeHandler(event)" >
<mx:Script>
<![CDATA[
import mx.rpc.xml.XMLDecoder;
private function initializeHandler(event:Event):void {
myjobs.send( );
private var myxml:XML = myjobs.lastResult.toString();
]]>
</mx:Script>
<mx:HTTPService id="myjobs"
url="
http://myhostedserver.com/cea/admin_jobs.php"
/>
<mx:VBox>
<mx:TextArea text="myxml" width="300" height="300" />
</mx:VBox>
</mx:Application>
just trying to make a connection and get a return
gotta start somewhere <8-)

See the sample code below. Note especially the resultFormat
and the use of a result handler function.
Tracy
Sample code using HTTPService, e4x, handler function to
populate a list item
The DataGrid tag:
<mx:DataGrid id="dg" dataProvider="{_xlcMyListData}"
.../>
The HTTPService tag:
<mx:HTTPService id="service" resultFormat="e4x"
result="onResult(event)" fault="..../>
Script block declaration:
import mx.rpc.Events.ResultEvent;
[Bindable]private var _xlcMyListData:XMLListCollection;
Invoke send:
var oRequest:Object = new Object();
oRequest.Arg1 = "value1";
service.send(oRequest);
Result Handler function:
private function onResult(oEvent:ResultEvent):void {
var xmlResult:XML = XML(event.result); //converts result
Object to XML. can also use "as" operator
var xlMyListData:XMLList = xmlResult.myListData; //depends
on xml format, is row data
_xlcMyListData = new XMLListCollection(xlMyListData); //wrap
the XMLList in a collection
trace(_xlcMyListData.toXMLString()); //so you can see
exactly how to specify dataField or build labelFunction
}//onResult

Similar Messages

  • HTTPService issue on FireFox and Tomcat

    I have created very simple test :
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute"
    width="100%" height="100%">
    <mx:Script><![CDATA[
    import mx.rpc.http.HTTPService;
    [Bindable]
    public var srv:HTTPService;
    ]]></mx:Script>
    <mx:Label text="Is it working?" />
    </mx:Application>
    This application is rendered by tomcat here :
    http://jc.studiogdo.com (you can
    test)
    As the HTTPService is declared, you can see that nothing is
    rendered!!!! On a local machine (tomcat running on my localhost)
    then it works on IE. On real server like this example nothing
    works!!!
    useProxy is false, so no need for a crossdomain.xml... Where
    is the error????

    The issue is that the Flex Builder2 default wrapper is
    wrong...

  • Help: Very simple HTTPService issue

    I have created very simple test :
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute"
    width="100%" height="100%">
    <mx:Script><![CDATA[
    import mx.rpc.http.HTTPService;
    [Bindable]
    public var srv:HTTPService;
    ]]></mx:Script>
    <mx:Label text="Is it working?" />
    </mx:Application>
    This application is rendered by tomcat here :
    http://jc.studiogdo.com (you can
    test)
    As the HTTPService is declared, you can see that nothing is
    rendered!!!! On a local machine (tomcat running on my localhost)
    then it works on IE. On real server like this example nothing
    works!!! Of course without declaring the HTTPService everything
    works... I've created this example with Flex Builder2 on eclipse
    useProxy is false, so no need for a crossdomain.xml... Where
    is the error????
    Many thanks for help..

    The issue is that : declaring the HTTPService stops the
    player (even if the play parameter is set to true for the embed
    object) when the application is served from a tomcat server (not a
    local file), so it works only if I forces (right menu) the play
    menu item.
    What happens :
    On a local file : FF and IE accepts to autoplay the
    application
    On a local tomcat (localhost url) : FF refuses to auto play,
    IE accepts.
    On a real distant tomcat server : FF and IE refuses to
    autoplay
    I think this is for security reason? But how to force the
    play parameter to be used anyway... (I repeat to be sure
    understanding : the simple HTTPService declaration changes the way
    the play parameter is evaluated..)

  • Starting up time ..loading flex-config.xml  App freezes

    Hello , I'm trying to run FLEX data services samples inside
    jboss or weblogic app server and below lines are the last lines I
    have after application startup :
    11:21:52,562 INFO [TomcatDeployer] deploy, ctxPath=/samples,
    warUrl=.../deploy/samples.war/
    11:21:53,078 INFO [STDOUT] 10/14 11:21:53 INFO Loading
    configuration file
    E:\jboss421\server\default\deploy\samples.war\WEB-INF\flex\flex-webtier-config.xml
    11:21:53,234 INFO [STDOUT] 10/14 11:21:53 INFO Loading
    configuration file
    E:\jboss421\server\default\deploy\samples.war\WEB-INF\flex\flex-config.xml
    freeze point....
    do I miss some required parameter config. or jarfiles ? I
    folowed instructions on jboss about coping some jars and contex.xml
    under web-inf
    please help, thanks in advance.

    Would you mind (if you haven't already) opening a bug on the HTTPServices issue over at bugbase.adobe.com?  Please include sample code so we can reproduce this internally.  Once added, please post back with the bug number or URL so I can investigate internally.
    As for the second issue, are you using Flash Builder, Flash Professional, or some other tool when publishing your app?
    Thanks,
    Chris

  • Caching Issues with Adobe Flex and HTTPservice

    I faced a strange issue a coupla days back. In one of my Applications I had a Timer which would fire every 10 secs and would fetch data using a HTTPService call when fired. Surprisingly though, the initial results fetched by the HTTPservice was cached and would not reflect any changes when the data changed in the background, in IE, however the problem would not occur in Firefox !
    I sort of hacked the HTTPService url to add a random number at the end of the call to make it believe that it was calling a different URL every time and it worked. But I would definitely like to know the reason for this behavior

    Hi, Abesh. 
    I ran into the same thing, but it did not do this until recently!  I had recently installed Flex 3.0 beta, so maybe something changed with the compiler and/or the Flash VM in this regard.  Also, you can change the behavior of the Flex/Flash runtime by changing the caching settings in IE (check page for newer version on each visit).
    Rick

  • HTTPService/XML issue

    Hey fellow Flexers
    I'm a relative newb to Flex so there is probably a simple
    solution to my issue, but I've been trying to fix this for hours
    now with no success.
    I'm loading in some XML using HTTPService and accessing the
    parameters without any issue, it's the node value I have issues
    with.
    The XML is in the following format:
    <events>
    <comment up="1">Some text goes here 1</comment>
    <comment up="3">Some text goes here 2</comment>
    </events>
    Now, with my current code I can access the 'up' parameter,
    but I can't seem to get to the actual node value. i.e "Some text
    goes here.."
    My code:
    <mx:HTTPService id="dataRequest" url=myURL/>
    <mx:Panel>
    <mx:DataGrid
    dataProvider="{dataRequest.lastResult.events.comment}">
    <mx:columns>
    <mx:DataGridColumn headerText="Title"
    dataField="comment"/> <<**this line is the issue**
    <mx:DataGridColumn headerText="Up" dataField="up"/>
    << this line works fine
    </mx:columns>
    </mx:DataGrid>
    <mx:Panel>
    I've chopped out some of the code to make it readable. I know
    that the code is incorrect but I've tried dozens of variations to
    get it working but I'm having no joy.
    Any ideas?
    Thanks in advance.
    Paul

    Suggestions:
    1) Use resultFormat="e4x" on the HTTPService tag. The default
    is object, which causes Flex to convert the xml into a nested
    object structure. God only knows the result of that.
    2) Do not bind to the result. Use a result handler, so you
    can debug the data.
    Here are some code snippets below.
    Tracy
    Sample code using HTTPService, e4x, handler function to
    populate a list item.
    Also shows usage of AsyncToken.
    The DataGrid tag:
    <mx:DataGrid id="dg" dataProvider="{_xlcMyListData}"
    .../>
    The HTTPService tag:
    <mx:HTTPService id="service" resultFormat="e4x"
    result="onResult(event)" fault="..../>
    Script block declaration:
    import mx.rpc.Events.ResultEvent;
    [Bindable]private var _xlcMyListData:XMLListCollection;
    Invoke send:
    var oRequest:Object = new Object();
    oRequest.Arg1 = "value1";
    var callToken:AsyncToken = service.send(oRequest);
    token.callId = "myQuery1";
    Result Handler function:
    private function onResult(oEvent:ResultEvent):void {
    var xmlResult:XML = XML(event.result); //converts result
    Object to XML. can also use "as" operator
    var xlMyListData:XMLList = xmlResult.myListData; //depends
    on xml format, is row data
    _xlcMyListData = new XMLListCollection(xlMyListData); //wrap
    the XMLList in a collection
    trace(_xlcMyListData.toXMLString()); //so you can see
    exactly how to specify dataField or build labelFunction
    var callToken:AsyncToken = oEvent.token;
    var sCallId = callToken.callId; //"myQuery1"
    switch(sCallId) {
    case "myQuery1":
    doQuery2();
    break;
    }//onResult

  • Error while issuing an httpService from a local swf

    We have a swf that  includes a Flex HTTPService call to check for
    tomcat status. This  call is resulting to below error:
    Error #2028:  Local-with-filesystem SWF filefile:///C:/......./click.swfcannot  access Internet URLhttp://localhost:8600/.../dummy.html."
    We are able to get  over this error by adding this click.swf as "Always Allow"
    at http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04a.ht ml#119065
    However, in  production environment it is not feasible to do this manual  step.
    We would want to  know if there is a way to let the flash player know that this is  trusted
    by modifying  any config file of Flash player or flex.
    Please suggest. Any  pointers on resolving this is greatly appreciated

    Make sure you use -use-network=true.  Or AIR.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • HTTPService and requestTimeout connection issue.

    I could really use some help with using the requestTimeout with HTTPService. I have successfully coded the timeout to 10 seconds and tested it with a long running http request. After 10 seconds the fault listener does execute properly. The trouble I have been observing is extreme delays when other HTTPServices starting and completing. There were major delays with them finishing their http request. At this point I fired up the fiddler web debugger. It appears that the http request does not disconnect after the timeout logic is called in actionscript. I have also tried the HTTPServices disconnect method in the fault listener. Does anyone have any suggestions? Thanks in advance. Here is my test  code: private var httpService:HTTPService = null; private function  TestTimeOut():void
    httpService = new HTTPService();
    httpService.url = "http://someurl";
    httpService.method = "post";
    httpService.resultFormat = "e4x";
    httpService.requestTimeout = 10;
    httpService.addEventListener(FaultEvent.FAULT, onFaultHttpService);
    httpService.addEventListener(ResultEvent.RESULT,  onResultHttpService);
    httpService.send();
    } protected function onResultHttpService(e:ResultEvent):void
    Alert.show("Success.");
    } protected function onFaultHttpService(e:FaultEvent):void
    httpService.disconnect();
    Alert.show("Failed.");

    I could really use some help with using the requestTimeout with HTTPService. I have successfully coded the timeout to 10 seconds and tested it with a long running http request. After 10 seconds the fault listener does execute properly. The trouble I have been observing is extreme delays when other HTTPServices starting and completing. There were major delays with them finishing their http request. At this point I fired up the fiddler web debugger. It appears that the http request does not disconnect after the timeout logic is called in actionscript. I have also tried the HTTPServices disconnect method in the fault listener. Does anyone have any suggestions? Thanks in advance. Here is my test  code: private var httpService:HTTPService = null; private function  TestTimeOut():void
    httpService = new HTTPService();
    httpService.url = "http://someurl";
    httpService.method = "post";
    httpService.resultFormat = "e4x";
    httpService.requestTimeout = 10;
    httpService.addEventListener(FaultEvent.FAULT, onFaultHttpService);
    httpService.addEventListener(ResultEvent.RESULT,  onResultHttpService);
    httpService.send();
    } protected function onResultHttpService(e:ResultEvent):void
    Alert.show("Success.");
    } protected function onFaultHttpService(e:FaultEvent):void
    httpService.disconnect();
    Alert.show("Failed.");

  • HTTPService + Flash Player 9 Issue

    Hi,
    I have run a sample program , that accesses HTTP Service and
    gets data.
    I have used Flex builder for this.
    At my organization, in order to access internet via proxy, it
    is required to provide AD authentication
    So everytime we access internet, we need to provide userid
    and password.
    If I execute swf file from browser using HTML, then prior to
    connecting to remote http site, browser asks for AD authentication
    and on providing this information, HTTPService is able to
    fetch data from remote server.
    But if i execute swf file from Flash Player 9, then it does
    not ask for AD authentication .
    Due to this call to remote site via HTTPService fails with :
    Stream Error.
    Is there any way to solve this problem ?
    Regards
    Tarun

    Hi,
    I have run a sample program , that accesses HTTP Service and
    gets data.
    I have used Flex builder for this.
    At my organization, in order to access internet via proxy, it
    is required to provide AD authentication
    So everytime we access internet, we need to provide userid
    and password.
    If I execute swf file from browser using HTML, then prior to
    connecting to remote http site, browser asks for AD authentication
    and on providing this information, HTTPService is able to
    fetch data from remote server.
    But if i execute swf file from Flash Player 9, then it does
    not ask for AD authentication .
    Due to this call to remote site via HTTPService fails with :
    Stream Error.
    Is there any way to solve this problem ?
    Regards
    Tarun

  • HTTPService Data Conversion Issue

    I have a REST-style web service that returns an HTML document
    that looks something like this:
    <a>
    <b>
    <c>2.0</c>
    <b>
    <b>
    <c>3.2</c>
    <b>
    </a>
    I can use the browser to display this document and it looks
    as expected. However, when I use a Flex HTTPService to obtain the
    document, and then display its various values, any numbers ending
    with ".0" are truncated/rounded. For example, the first element
    <c> above is displayed as "2" instead of "2.0".
    Why are numbers being converted? Shouldn't they be treated as
    any other text from an XML element?
    This is how I am calling the service:
    <mx:HTTPService id="myService" url="itsurl" method="GET"
    useProxy="false"/>
    And this is an example that shows a number being
    trucated/rounded:
    <mx:Label text="{myService.lastResult.a.b[0].c}"/>
    Thanks,
    Mike

    The default for HTTPService is resultFormat="object" This
    causes Flex to convert your xml into a tree of dynamic objects.
    This is rarely what you want. Among other things, it tries to do
    type conversions.
    Instead, set resultFormat="e4x". This will give you your xml
    un changed. It also gives you access to the e4x API which is very
    powerful. It includes traversal, search and fileter functionality.
    Additionally, for anything but a trivial or demo app, do not
    bind directly to lastResult. Instead, use a result handler
    function. Here is an example, untested:
    <mx:HTTPService id="myService"... result="onResult(event)"
    (in script)
    import mx.rpc.ResultEvent;
    [Bindable]private var _xmlResult:XML; //instance var to hold
    the data
    private function onResult(event:ResultEvent):void {
    _xmlResult = XML(event.result);
    trace(_xmlResult.toXMLString()); //to see exactly what you
    have
    Note, your xml example is not valid, so I can't show an
    example of an e4x expression.
    Tracy

  • HTTPService not reading updated xml, i've been having to refresh the xml in my browser manually

    I am calling an HTTPService (id=data2php) which runs a php
    script which creates an xml doc and puts it on my server. i then
    call another HTTPService (id=feedRequest) which reads the xml doc.
    i then try to populate a datagrid with the lastResult of my
    HTTPService that reads the xml doc. My issue is that that the
    HTTPService which reads the xml doc reads the previous incarnation
    of the xml doc, not the newly created one that my HTTPService
    (data2php) created. i've been manually going to the xml doc in my
    browser and hitting refresh for my feedRequest HTTPService to read
    the updated xml.
    here is the mxml for the httpservice that reads the xml:
    <mx:HTTPService id="feedRequest" url="
    http://cfcdi.org/eric/dashboard/php/sales.xml"
    result="feedResult(event)" resultFormat="xml" useProxy="false"/>
    pretty straight forward.
    (actually, once in a while it will read the updated
    one)

    LittleMuscle,
    Instead of binding to the lastResult property, I would
    explicitly handle the result and fault events of the HTTPService
    (the one that reads the newly created xml doc) and then manually
    update an XMLListCollection for use as the datagrid's dp. That way,
    you can at least walk through the debugger and see what's going on,
    and force the second HTTPService to read only when you're sure the
    newly created doc is ready.
    Since you said it works sometimes and not other times, it
    sounds like it's just a timing problem, sometimes the xml doc is
    created quickly enough that the HTTPService grabs the new xml doc,
    but if not, it's grabbing the old one. That would be my
    guess.

  • HTTPService + XML Load + Memory Leak

    Hi all....
    I have noticed a memory leak in my application. This leak was
    not apparent when the application was completed some months back
    which is what left me a little confused as all I have done since
    was upgrade to Flex 3 and possibly updated / changed my Flash
    player.
    I think I have found the cause to this problem (below) but am
    not 100% sure that it is the "actual" problem or any reasons to
    back my thoughts up, so have listed what I have checked / tried
    along the way (maybe I have missed something)....
    My Discovery Process:
    I started profiling my application but did not find anything
    out of the ordinary. I did a code walk-through double checking I
    had cleaned up after myself, removing and even nulling all items
    etc but still to now success - the leak is still there.
    I have profiled the app in the profiler for reasonably long
    periods of time.
    All the classes etc being used within the app are consistent
    in size and instance amount and there is no sign of any apparent
    leak.
    I am using a HTTPService that is loading XML data which I am
    refreshing every 5 seconds. On this 5 second data refresh some
    class instances are incremented but are restored to the expected
    amount after a GC has occurred. The GC seems to take longer, the
    longer the app is running, therefore more and more instances are
    being added to the app, but when the GC eventually runs it "seems"
    to clear these instances to the expected amount.
    After scratching my head for a while I decided to make a copy
    of my application, rip everything out, and focus in my data load,
    where I found a problem!
    I have now just a HTTPService that loads an XML file every 5
    seconds, and this is all I currently have in the app (as I ripped
    the rest of the code out), e.g:
    Code:
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    ....... creationComplete="initApp()" >
    <mx:HTTPService
    id="httpServiceResults"
    url="
    http://myIP:myPort/myRoot/myXML.cfm"
    resultFormat="e4x"
    result="httpResultHandler(event)" />
    <script....... >
    private var timerPulse:Timer;
    private function initApp():void
    httpServiceResults.send();
    timerPulse = new Timer(5000, 0);
    private function httpResultHandler(event:ResultEvent):void
    timerPulse.start();
    timerPulse.addEventListener(TimerEvent.TIMER, timerRefresh);
    public function timerRefresh(eventObj:TimerEvent):void
    timerPulse.stop();
    timerPulse.removeEventListener(TimerEvent.TIMER,
    timerRefresh);
    timerPulse.reset();
    httpServiceResults.send();
    </script>
    </mx:Application>
    This is pretty much the code I am currently using and it
    leaks.
    I ran and monitored this in both the profiler and the
    activity / task manager, and after running the app for 1800 seconds
    (30 min) in the profiler, the memory size grew from 50mg to 165mg
    just sending the HTTPService.
    I tried loading the service in multiple ways including in AS
    rather than MXML creating new instances of it each time, resetting
    it, nulling it etc... but nothing prevented this memory increase.
    I then tried to load the XML using different methods such as
    using the URLRequest and URLLoader which again caused a memory
    leak.
    What still confuses me is that this leak did not exist in the
    previous version and not a great deal has changed since then apart
    from upgrading to Flex 3 and possibly upgrading my Flash payer
    (which I believe is a possible cause)
    After looking into this issue a bit more deeply, I read a few
    blogs / forums and other people are experiencing the same problems
    - even with a lot bigger leaks in some cases all when reloading
    large sets of XML data into Flex - however, I as of yet found no
    solution to this leak - people with a similar problem believe it is
    not due to a memory leak more a GC error, and others pointing
    towards the Flash Player itself that is leaking - I don't really
    know.
    Findings so far during investigation of this issue:
    * App leaks for both HTTPService and ULRRequest / URLLoader
    methods
    * App only leaks when calling a data loader
    * The size of the leak seems to depend on the size of the
    XML being loaded
    * The size of the leak also seems to be affected by the
    applications heaviness - the greater seems to enhance the leak
    An interesting factor I have noticed is that if I copy the
    XML from my "myXML.cfm" that I link to in my HTTPService and copy
    the contents of the file into my own XML file stored within the
    Flex project root itself: ""myXML.xml"" the leak disappears... like
    it seems to link when loading the XML over a network, however as my
    network knowledge is not great I am not sure what to make of this -
    any ideas???
    Could the connection to the XML document cause leaks??? is
    there anything else that could cause this leak??? have I something
    in my code sample that could cause this leak??? or could any of the
    other things I have mentioed cause this leak???
    Any help / ideas would be greatly appreciated.
    Thanks,
    Jon.

    I also observed heavy memory leak from using httpservice with
    XML data. I am using Flex3 builder under Linux. My Flex application
    polls httpservice every 10 seconds. The reply is a short XML
    message less than 100 bytes. This simple polling will consume 30+
    MB of memory every hour. I leave it idling for several hours and it
    took 200 MB of memory. No sign of garbage collection at all.

  • Best practice to configure HTTPService url

    I try to find the best way to set up the url attribute of a
    large number of httpService in an application that use different
    servlet as data provider.
    My idea is to read an external XML file and use the text of
    nodes to find the settings for the url attribute.
    For example:
    External file config.xml contains a node like this
    <service1>
    http://achille:8080/dbfw/DBSERVICE</service1>
    In my <mx:Application> on creationComplete I read the
    config.xml file and put the content in a Bindable variable that I
    will refer in every component of my application by the syntax
    XML(parentApplication.config).service1 and use the text value of
    the node to set the url attribut of an httpService.
    This is very important because when I install the application
    at a customer the service1 url change and I have to set up the
    application data provider through the external XML file.
    Is there an esier way to do obtain a behavior like that ?
    Thank you at all

    Hi Louis,
    you need to setup a service with clusterware. On both sides: primary and standby.
    On primary you start them. On standby the services are also configured but stopped.
    In case of switchover or failover, data guard will notice clusterware to bring them up.
    You need to use this service name in your clients tnsnames.
    Another issue are TCP timeouts, to protect against them you use
    outbount_connect_timeout in your sqlnet.ora
    Also have a look at
    http://www.oracle.com/technology/deploy/availability/pdf/MAA_WP_10gR2_SwitchoverFailoverBestPractices.pdf
    HTH Mathias

  • Loading a remote SWF via SWFLoader Issue

    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... Any insight would be greatly appreciated and thanks to
    all in advance!!!
    PARENT SWF (resides on local desktop)
    <?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 when loading child swf LOCALLY -->
    <mx:Button label="Load LOCAL SWF APP"
    click="initSWF('remoteSWF.swf')"/>
    <!-- DOES NOT WORK when loading child swf 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 (resides on remote server)
    <?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:rocessResult()
    at mx.rpc::AbstractInvoker/
    http://www.adobe.com/2006/flex/mx/internal::resultHandler()
    at mx.rpc::Responder/result()
    at mx.rpc::AsyncRequest/acknowledge()
    at :irectHTTPMessageResponder/completeHandler()
    at
    flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio
    n()
    at flash.events::EventDispatcher/dispatchEvent()
    at
    flash.net::URLLoader/flash.net:URLLoader:nComplete()

    After further investigations, it appears that the problem might be, due the fact that in the remote (loaded) swf, the following is null:
    var sm:ISystemManager = ISystemManager(SystemManagerGlobals.topLevelSystemManagers[0]);
    sm.swfBridgeGroup <----- equals null
    I tried creating the swfBridgeGroup in the local (loading) swf, but the loaded one still thinks it is null.
    Any ideas?

  • HTTPService.send() only works the first time

    I have the follow HTTPService defintion in my mxml page:
    <mx:HTTPService
    id="updateRequest"
    url="{accessURL}"
    useProxy="false" result="onSuccessEvent(event)"
    fault="onFailEvent(event)">
    <mx:request>
    <username>{userName}</username>
    <password>{password}</password>
    <id></id>
    <sname></sname>
    <value></value>
    <randomNum>0</randomNum>
    </mx:request>
    </mx:HTTPService>
    Here is my call:
    updateRequest.request.id= myid;
    updateRequest.request.sname= myname;
    updateRequest.request.value = myvalue;
    updateRequest.request.randomNum = Math.random();
    updateRequest.send();
    The first time call is successful, but second time(after 30
    seconds), after send() function call, I didn't even received
    HTTPService call from server side. Is this somehow cached or I need
    to reinitial it? This looks strange.

    I am having the same issue but have already been using the
    post method. When I click my refresh button or if the timer I have
    set up resets I see no request made to the server.
    private function onResult(Event:ResultEvent):void {
    var myNum:int = Math.round(Math.random() * 2);
    var xmlResult:XML = XML(Event.result);
    _xlcMyListData = new XMLListCollection(xmlResult..asset);
    <mx:HTTPService id="tempXML" resultFormat="e4x"
    result="onResult(event)" method="POST" url="
    http://mysite.net/info_wrapper.php?customer={customer.text}&amp;username={username.text}&a mp;password={password.text}"
    useProxy="false"/>
    <mx:TileList dataProvider="{_xlcMyListData}"
    labelField="fleet" left="35" right="15"
    width="350" backgroundColor="#000000" color="#ff0000"
    fontSize="27" borderColor="#000000" columnWidth="315"
    rowHeight="50" themeColor="#808080" fontWeight="bold"
    allowMultipleSelection="true" id="TileList1" height="0" y="202"
    x="178"/>
    <mx:Button label="Refresh Page Now" height="27"
    fillAlphas="[1.0, 1.0]" fillColors="[#030000, #030000, #474545,
    #474545]" borderColor="#DCDEDF" click="tempXML.send();"/>

Maybe you are looking for

  • Infocubes - TRANSACTIONAL - STANDARD - REAL TIME

    <h3>Some clarity has to be brought in to these three types of CUBES. <h5> I am using SALES ANALYSIS & SALES BUDGET here as an example. <h1>Assumptions & Scenario: <h5>1. Sales Budget is prepared once a year, Division / Group / Category / Material wis

  • Captions missing

    Created an iPhoto instant slideshow with captions. Exported it as a Quicktime Movie. Inserted it into a Movie page in iWeb. Worked fine but captions disappeared. How can I get them to remain in the Quicktime version for iWeb ?

  • Session variables trying to resolve as columns

    Hello, I have a simple case statement where I am trying to use the user.id variable.  Unfortunately whenever I do this it returns an 'Unresolved Column' error. CASE WHEN "Users"."User Name" = CAST(@{user.id}{'DWBACKUP'} AS VARCHAR(8)) THEN '1. User'

  • Platform.conf only has 2 lines after install

    Environment: App: Sun ONE Portal Server: Secure Remote Access 6.0 OS: Solaris 2.8 Basic config setup: Portal Server (and SRA) installed on one machine. No SSL. The Portal Server, Gateway and Rewriter proxy are all installed on the same machine. Probl

  • Can i save the Faces view of a picture?

    There are several pictures that iphoto detects as mine and I would like to save the cropped version to use it as a display picture. Is there anyway? Neerav