pass variable from main to component
is way pass data main component? if not how it.
thanks
<?xml version="1.0" encoding="utf-8"?>
<mx:application xmlns:mx=" http://www.adobe.com/2006/mxml"/>
<mx:script>
<![cdata[
idmymenu.varincomponent = "....";
]]>
</mx:script>
<mymenu:topmenuapplicationbar id="idmymenu"/>
</mx:application>
<mx:applicationcontrolbar xmlns:mx=" http://www.adobe.com/2006/mxml" >
<mx:script>
<![cdata[
var varincomponent:string;
]]>
</mx:script>
</mx:applicationcontrolbar>
thanks
<?xml version="1.0" encoding="utf-8"?>
<mx:application xmlns:mx=" http://www.adobe.com/2006/mxml"/>
<mx:script>
<![cdata[
idmymenu.varincomponent = "....";
]]>
</mx:script>
<mymenu:topmenuapplicationbar id="idmymenu"/>
</mx:application>
<mx:applicationcontrolbar xmlns:mx=" http://www.adobe.com/2006/mxml" >
<mx:script>
<![cdata[
var varincomponent:string;
]]>
</mx:script>
</mx:applicationcontrolbar>
certainly ok. varincomponent known property of component. want make var "public", though
you can use getter , setter functions if want more control on happens when value set, example, if wanted run other code.
another way pull data component using application.application.mypublicmember;
still way use events listen change of value in main app. can access public member of app using event.target reference.
you can pass data in custom events.
yet solution use data model component, implemented "singleton". such model component can accessed anywhere in app, , can used invoke bindings or trigger changewatchers.
you have many options.
tracy
you can use getter , setter functions if want more control on happens when value set, example, if wanted run other code.
another way pull data component using application.application.mypublicmember;
still way use events listen change of value in main app. can access public member of app using event.target reference.
you can pass data in custom events.
yet solution use data model component, implemented "singleton". such model component can accessed anywhere in app, , can used invoke bindings or trigger changewatchers.
you have many options.
tracy
More discussions in Flex (Read Only)
adobe
Comments
Post a Comment