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!
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.
I’ve written a NavigatableList class to provide the already handy ArrayCollection class with a simple cursor-like navigation option. You can call list.navigateTo() and provide for instance list.next or list.previous. You also specify the class to which items should belong and you can search for an item with list.findItem(property, value). And finally, you can clone it with list.clone().
Download it here
EDIT: the clone() method didn’t work correctly for some reason. I’ve removed it for now.
EDIT: added an equals() method which compares this list to another list. You must specify the name of a unique property which can be used to check if two items are the same.
Check out the new website started by Rick Companje: www.flexotic.nl
It contains thoughts, experiments, tutorials, components and other stuff, all concerning Flex. Keep an eye out for interesting stuff on this website.
I’ve made a small application in Flex to draw l-systems with.
The previous post explains what l-systems are exactly, but here are the rules again in short:
L-systems is a grammar describing the growth of plant-like structures. It is made up of simple drawing commands and rules how these change during growth. For example, you start out with the command ‘F’ meaning draw one unit. You add a rule that says ‘change F to F+F-F’ where ‘+’ and ‘-‘ mean turn left and right, respectively, with a predefined angle. Then, as it grows, the sequence of commands grows longer and more complex, as every time each ‘F’ is replaced by ‘F+F-F’ until you end up with a long sequence of simple commands that make up a complex shape. Add branching with the ‘[‘ (start branch) and ‘]’ (end branch) characters and you can quickly create nice plant structures.
Try out the application here. It’s a small first version with some limitations, such as a maximum amount of drawing commands to prevent slow processing times, the possibility to define only one rule, and the fact that it always starts out with ‘F’. You can define your own rule of how ‘F’ changes (using F, +, -, [ and ]), you can set the angle of rotation and the amount of iterations to define the complexity of the resulting shape. If responses are too slow, you can turn off ‘update realtime’ and hit the ‘go’ button to calculate your l-system.