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.
精彩评论