开发者

Function Call inside of Component

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜