开发者

Flex 4 syntax in actionscript ...?

开发者 https://www.devze.com 2023-01-11 22:41 出处:网络
One (dumb) question: Is it possible to use flex 4 syntax declaration inside of a actionscript method? For example, something like that:

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,开发者_StackOverflow so i think it is not possible :).


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


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.

0

精彩评论

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