Flex Components and Anchor Tags

On a current project I found a bug within a custom UIComponent. Hopefully my explanation is thorough enough to give you an understanding as to why I think this may be an implementation issue with components in the Flex framework itself:

The UIComponent added a child Sprite that contained a TextField child. The text field's htmlText property contained an anchor tag. By default the text field's selectable property was set to false. This is when it gets interesting.

The class which contained the TextField and extended from Sprite when included on the flash player stage worked correctly, meaning that the anchor tag located the browser correctly when clicked even though the selectable property was set to false. Seems like this should be the standard...

The bug was when this class' object reference was added as a child to a class extending UIComponent. When this occurred the anchor tag did not allow for left mouse click in turn locating the browser to the location specified in the anchor tag. Oddly enough, Flash allowed for right clicking on the link displaying the standard anchor tag options of open, open in new window, and copy link.

The workaround was to set the selectable property to true, though I may not want a user to select the text it was the only workaround with regard to adding a text field to a UIComponent. Please see examples below (view source is enabled).

Selectable set to false in component example.

Selectable set to true in component example.

Selectable set to false in sprite example.

Comments
Nice fix, great work!
# Posted By darin | 9/6/07 11:07 AM
[&] former peeps over at Yahoo just released 10 more components, 3 Flash and 5 Flex components. The also fixed some of the bugs [&]
# Posted By battery | 6/26/08 10:45 PM

Copyright Strikefish, Inc., 2005. All rights reserved.