Archive

Archive for October, 2008

Executing HTML links in Flex

October 27th, 2008 admin 1 comment

In the project I’m currently working on, I found that HTML links in textfields weren’t properly executing, although the text seemed to be rendered properly. My mouse cursor even changed to a hand cursor on rollover of the link within the text, but I could only actually √≥pen the link through the context menu that popped up after a control-click (or right click for the PC user).
After some searching, I found the simple answer to my problem on the Flex Examples blog: in order for the HTML link to be properly executed, the ’selectable’ property of the containing TextField must be set to ‘true’! If the text is not selectable, your HTML link won’t automatically be opened on click. Way to go Adobe!

Categories: Flex, programming Tags:

Removing ugly yellow focusRect in Flex

October 10th, 2008 admin 5 comments

Right now I’m working on a project in which Flex integrates Flash components in its application and we encountered the infamous yellow focus borders when hitting the tab key from inside the application.

It wasn’t as easy as I thought it would be to Google the solution to prevent the ugly yellow rectangles from being displayed. I’ve found the solution in the Flex help though, so I’ll try to improve the search results on Google by providing the solution here.

When you look at the focusRect property description of flash.display.InteractiveObject, it says: “Specifies whether this object displays a focus rectangle. A value of null indicates that this object obeys the stageFocusRect property set on the Stage.”
And there’s your solution! In your Flex application, create a method that is called on creationComplete and in this method add the following code:

stage.stageFocusRect = null;

Now all focus rectangles are globally disabled in your application. It’s as simple as that.

Categories: Flex, programming Tags: