4 Replies Latest reply on Feb 1, 2010 10:34 AM by Gregory Lafrance

    Accessing Function from another Component - FLEX


      Hello All,


      I have a question.


      I have multiple .mxml files for a program I am building.


      One file is called ThisPopUp.mxml.


      I have it pop up using this function:


           public function addGridPopUp():void
                      thisPopUp = new ThisPopUp();
                      PopUpManager.addPopUp(ThisPopUp, this, true);


      Inside ThisPopUp i have


      <?xml version="1.0" encoding="utf-8"?>
      <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" color="#000000" title="Options" height="214" width="360" borderStyle="solid" borderThickness="3">
                  import mx.managers.PopUpManager;
                  public function ptions(event:MouseEvent):void
                      if(doNothing == selected)
                      else if (connect == selected)
                      else if (compare == selected)
                       (DO A FUNCTION FROM MY MAIN APPLICATION)  


      <mx:RadioButtonGroup id="optionsRadioGroup"/>
          <mx:RadioButton id="doNothing" x="0" y="32" label="Do nothing" groupName="optionsRadioGroup" selected="true"/>
          <mx:RadioButton id="connect" x="0" y="58" label="Connect" groupName="optionsRadioGroup"/>
          <mx:RadioButton id="compare" x="0" y="84" label="Compare" groupName="optionsRadioGroup"/>
          <mx:Label x="0" y="6" text="Select an option:" fontWeight="bold"/>
          <mx:Button x="0" y="123" label="Done" click="options(event)"/>



      This is probably a simple question but I am having trouble with it.


      How do you made it execute a function from a different .mxml file?


      I set my functions as public but it still wont let me call them. For example if I want to call a function from the main file called: doDragDrop(event)


      how would I do that?


      Thanks in advanced.