0

One (dumb) question:

Is it possible to use flex 4 syntax declaration inside of a actionscript method? For example, something like that:

private function buildContent() : void {

     <s:Label id="aLabel">

}

Thanks.

P.S. I couldn't find any reference about this, so i think it is not possible :).

2 Answers 2

3

No sorry, not possible. Just like you can't put HTML in JavaScript (without it being a string).

Sign up to request clarification or add additional context in comments.

Comments

1

The syntax isn't "Flex 4 syntax" but "MXML".

You can achieve what you want, while writing:

private function buildContent() : void {
     var label:Label = new Label();
}

The syntax <s:Label /> represents an spark:components:Label object.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.