Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy wouldn't a flex remoteobject be able to work within a custom component?
    text
    copied!<p>Please enlighten this flex noob. I have a remoteobject within my main.mxml. I can call a function on the service from an init() function on my main.mxml, and my java debugger triggers a breakpoint. When I move the remoteobject declaration and function call into a custom component (that is declared within main.mxml), the remote function on java-side no longer gets called, no breakpoints triggered, no errors, silence.</p> <p>How could this be? No spelling errors, or anything like that. What can I do to figure it out?</p> <p>mxml code:</p> <p>&amp;#060 mx:RemoteObject id="myService" destination="remoteService" endpoint="${Application.application.home}/messagebroker/amf" &amp;#062 &amp;#060 /mx:RemoteObject &amp;#062</p> <p>function call is just 'myService.getlist();'</p> <p>when I move it to a custom component, I import mx.core.Application; so the compiler doesn't yell </p> <p>my child component: child.mxml</p> <pre><code>&lt;mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()" &gt; &lt;mx:Script&gt; &lt;![CDATA[ import mx.core.Application; public function init():void { helloWorld.sayHello(); } ]]&gt; &lt;/mx:Script&gt; &lt;mx:RemoteObject id="helloWorld" destination="helloService" endpoint="$(Application.application.home}/messagebroker/amf" /&gt; &lt;mx:Label text="{helloWorld.sayHello.lastResult}" /&gt; &lt;/mx:Panel&gt; </code></pre> <p>my main.mxml:</p> <pre><code>&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()" xmlns:test="main.flex.*" &gt; &lt;mx:Script&gt; &lt;![CDATA[ [Bindable] public var home:String; [Bindable] public var uName:String; public function init():void { //passed in by wrapper html home = Application.application.parameters.appHome; uName = Application.application.parameters.uName; } ]]&gt; &lt;/mx:Script&gt; &lt;test:child /&gt; &lt;/mx:Application&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload