0

this is one script in my.mxml

  <fx:Script>
    <![CDATA[
        import mx.collections.ArrayCollection;
        public function __changeSel():void{

        }
    ]]>
  </fx:Script>

another script in component tag in same my.mxml

<fx:Component>
                                        <s:ComboBox change="changeSel(event)">  
                                            <s:id>selID</s:id>
                                            <s:dataProvider>
                                                    <s:ArrayCollection>
                                                        <fx:String>Less Than</fx:String>
                                                    </s:ArrayCollection>                                                    
                                            </s:dataProvider>
                                            <fx:Script>
                                                <![CDATA[
                                                    public function changeSel(even:Event):void{
                                                         __changeSel();
                                                    }
                                                ]]>
                                            </fx:Script>
                                        </s:ComboBox>
                                    </fx:Component>             

But when i call __changeSel(); it dose not recognize this function. is there any way to get this thing fixed.

Nikhil Mahajan
  • 54
  • 1
  • 2
  • 12

1 Answers1

2

You should not use inline components. That leads to a scope shift. Write a proper self contains component and dispatch events over the display list, so the composites root can set a listener on the bubbling events.

Otherwise try to use outerDocument in the inline renderer to invoke the method.

Florian Salihovic
  • 3,921
  • 2
  • 19
  • 26