Moments of Flash, ActionScript, Flex

Discuss, challenge, inspire, connect, discover...

Subscribe
Add to Technorati Favourites
Add to del.icio.us
Oct 9, 2009

Funny Compiler Check Bug

Posted by Unknown

Evidently, to the compiler the following is a big difference:

Passes
[actionscript]
return [
                 {label:"MyriadPro",styleName:"textDefault"}
                ,{label:"Albertus",styleName:"textAlbertus"}
            ];
[/actionscript]

FAILS
[actionscript]
return
[
                 {label:"MyriadPro",styleName:"textDefault"}
                ,{label:"Albertus",styleName:"textAlbertus"}
            ];
[/actionscript]


[error message]
Severity and Description    Path    Resource    Location    Creation Time    Id
1065: Metadata attributes cannot have more than one element.    ProjectName/src/com/novelastudios/examples    FontsUtil.as    line 8    1255105753861    1317796

[/error message]

If you couldn't tell the difference, all that is different is the bracket starts on the same line as the return in the first example. Whereas, in the second, it is on the following line.

I'm actually curious if there is a reason to the humor in this perceived "bug." I'm going to search for a post in Adobe's JIRA for Flex

Jun 27, 2009

Hidden $addChild for Flex Components

Posted by Unknown

Ever try to add a DisplayObject to a Flex Component? If you have, you know the run-time engine will complain about a type conversion (Adobe casts DisplayObjects to IUIComponents). Well, there is a hidden $addChild for UIComponents. To utilize simply add use namespace mx_internal; to the beginning of your script. Now you can use $addChild.

For more information, check out http://www.boostworthy.com/blog/?p=224.