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.

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Got the solution. outerDocument.[objectname] and it worked for me.. :) Thanks Florian...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.