Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call Function on Inner Component

I'm working with flex 3. I've a mx:Compnonet in a mx:Canvas, Can I call a function declared in canvas on inner component?

I've somethink like this:

<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
       xmlns:flexlib="http://code.google.com/p/flexlib/" xmlns:local="*" 
       horizontalScrollPolicy="off" verticalScrollPolicy="off"
       creationPolicy="all">

    <mx:Script>
        <![CDATA[

            public function someFunction():Boolean {
                //do something
                return someBoolean;
            }

        ]]>
    </mx:Script>

    <mx:Component>
        <mx:HBox width="100%" height="100%" horizontalAlign="left" verticalAlign="middle" paddingLeft="4" paddingRight="8" horizontalGap="4">
            <mx:Script>
                   <![CDATA[
                        private function anotherFunction():Boolean{
                            //do something else
                            //here I need call someFunction()
                        }
                   ]]>
            </mx:Script>

            <mx:Image source="@Embed('/assets/icons/compress_folder_down16.png')" 
                    buttonMode="true" click="this.setFocus(); this.dispatchEvent(new Event('multipleDownload',true));"
                    visible="{this.anotherFunction()}" includeInLayout="{this.anotherFunction()}"/>

        </mx:HBox>
    </mx:Component>

I wanna call someMethod in anotherMethod. How can I do it?

like image 241
Lucas Merencia Avatar asked Dec 10 '25 01:12

Lucas Merencia


1 Answers

Use outerdocument.someFunction();

like image 141
ayahya82 Avatar answered Dec 12 '25 15:12

ayahya82



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!