views:

7

answers:

1

Hello.

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 someFunction():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?

A: 

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.

Wade Mueller
Thanks :] I used a <mx:Script> tag inside of the Component and it worked.
demogar