0
votes

I wan to know if is there any way to put a "inspectable" function (not component) to avoid choose another value outside of the defaults.

Example:

If we have a

function goToHome(typeOfTransport:String):void {

....

}

And I want that only two values are possible to choose for "typeOfTransport": "bus","car".

So if it was a component [Inspectable( enumeration="bus,car", defaultValue="bus" )]

But it only functions in custom components and MXML.

I need a way to do in standard code, like when we do:

X.addEventListener([//he appears only the possible values]

Thanks in advance.

1

1 Answers

0
votes

You could create a TransportTypeE enum based off of Christophe Herreman's model

Then you would change your method definition to:

function goToHome(typeOfTransport:TransportTypeE):void {
...
}