开发者

Function Call inside of Component

开发者 https://www.devze.com 2023-01-14 06:01 出处:网络
I want to call an App function inside a(I know about the Component scope already). What I mean is this:

I want to call an App function inside a (I know about the Component scope already).

What I mean is this:

<mx:Script>
    <![CDATA[
    public som开发者_Python百科eFunction():void {
        // bla bla bla
    }
</mx:Script>

And:

<mx:Component>
    <mx:Label text="{data.something}" click="someFunction()" />
</mx:Component>

How can I do something like that? Is that possible first of all?


Is this within the same MXML file? If so, this should work just as you show it. If not, you'll have to import the one containing the script into the file that is doing the calling. Usually you put separate script code into an ActionScript file rather then an MXML file when importing script though. Hope that helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消