I'm working on a Flex application that has a tab navigator component.
 To prevent my main MXML file from becoming huge I decided to make
each tab "page" a separate component.  The problem I have now is that
one of my Flex components need to have access to
Application.application.parameters.  How do I pass this information to
my component, or how do I make this information available to my component?

===== Main MXML file =====

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
xmlns:pf2="*" layout="horizontal">
  <mx:Canvas width="95%" height="95%">
    <mx:TabNavigator x="10" y="10" width="100%" height="100%">
      <pf2:tab1/>
      <pf2:tab2/>
    </mx:TabNavigator>
  </mx:Canvas>
</mx:Application>

===== Component file =====
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml";
label="Properties" width="100%" height="100%">
  <mx:Script>
  <![CDATA[
    
    [Bindable]
    private var service:PropertyService;

    
    private function init():void {
      service = new
PropertyService(Application.application.parameters.psAddr);
      service.makeInitialRequest();
      addEventListener(DataChangedEvent.DATA_CHANGED, doneEdit);
    }

  ]]>
  </mx:Script>

  <mx:Panel id="panel" label="Properties" width="100%" height="100%"
creationComplete="init()">

  <!-- Layout code -->

  </mx:Panel>
</mx:Canvas>

==========

Thanks.

Reply via email to