Better FormItem
Read more...
Flex textheight workaround
I spent over an hour banging my head against the wall on this one, so I'm going to post my solution.
If you have a Flex Text component, text.textHeight gives you an incorrect result in certain situations. This is a known bug, I see it listed
http://bugs.adobe.com/jira/browse/SDK-14792 and
http://www.mail-archive.com/flexcoders@yahoogroups.com/msg63011.html.
Read more...
Server changed from Dreamhost to Slicehost
Ok. I know how much I've praised Dreamhost in the past. I was very impressed with them when I started using their hosting, they were cheap, fast, had all the features I wanted, and had awesome automated installers that let me get up and running very quickly.
Read more...
Variables and constants
Actionscript 3 guide to constants and variables.
This article assumes you have a knowlege of Classes and instances.
public class Cow extends Mammal { protected static const NUM_LEGS:uint = 4; }
Let's dissect this cow, specifically, the NUM_LEGS constant.
There are 6 parts to this declaration:
protected
static
const
NUM_LEGS
:uint
4
I'm going to explain them backwards in order to go from simplest to most complicated.
Read more...
File attachments fixed
File attachments are fixed. I did an update to Drupal after their nag screens telling me my version was no longer secure, and there were some added or fixed permissions regarding downloading attachments that they didn't mention in their update logs. Well, the permissions are set correctly and now files should be downloadable again. Please post any other bugs with the site here. (And workaround if any)
Read more...
Flex states retaining memory
I use flex states a lot. I think they're a great way to handle navigation within your application. However, I have recently discovered that any mxml component added with AddChild will not and can not be removed from memory. This isn't a problem with small applications, but with large ones, this is pretty awful. It's not technically a memory "leak" because going back and forth between two states won't pile on the memory, but every state you navigate to will never be released.
Read more...
Flex verticalScrollPolicy bug
When you have content with width set to 100%, and verticalScrollbarPolicy set to auto, when you resize the window so the vertical scrollbar is needed, you would expect the content area to adjust to handle the newly added vertical scrollbar, but it doesn't. What happens instead is a horizontal scrollbar appears.
To reproduce this bug:
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*"> <mx:Canvas width="100%" height="700"/> </mx:Application>
Read more...
Flash E4X Tutorial
This is a beginner's guide to E4X.
Flash has some good documentation on using E4X at:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/index.html?XML.html&class-list.html,
but it's hard to digest all that if you're just getting started.
You can download the example attached below and follow along.
Loading xml
Before we begin parsing any xml, I'll explain briefly how to load the xml.
Read more...
Copying typed objects
Attached below is a utility class with 3 static methods:
Clone lets you copy Objects and Arrays. If you copy a different class, the public properties (and recursive public properties) will get transferred, but the private properties won't. Also, the cloned object can only be of type Object or Array.
Compare lets you compare recursively the public properties of two objects or arrays. Useful for multi-dimensional arrays.
Read more...
