Archive for the “Flex” Category

When I am writing a flash app or game which uses the keyboard to control a character's movement, there is a situation that becomes annoying while controlling the character. I do not know the proper term for it ("sticky keys"?) but I will describe it...keyboard

When an app or game is written we "expect" the user to precisely press the proper key or key combination at a time to execute programmatic actions. However, most of us have ten fingers and we use more than one finger to press more than one button on the keyboard. The expected program reaction from multiple fingered keyboard input might not occur because you have another function executing when you expect just one at a time.
Read the rest of this entry »

Comments 2 Comments »

If everyone got a turn, would you take your turn the same as the others or be different?

I've seen lots of really great knobs, dials, and gauge components. The intended way a person would build their app to use one would most likely be varied . That makes each of these kinds of controls  special because its difficult to make a control that fits a very broad range of functionality/look-n-feel, and probably why I have yet to see "one knob to rule them all".   Sliders, and Buttons are pretty straight forward, but not the "Knob" type of control.

Get Adobe Flash player

Read the rest of this entry »

Comments 2 Comments »

Dynamically listing the properties of a class is pretty cool and useful. There are many things you could do by generating a list of existing properties. One example is you can make your class instances represent themselves dynamically in a custom format of your choosing. Like how "toString()" is use with the Array class or how Point is represented when toString() is called from it. Going further, listing current properties could be used to save the current values of the class as a "save point".

In the Flex framework, there is ObjectUtil.getClassInfo().properties, but I feel is more useful to just use the XML returned from the describeType method. I like using decribeType for both plain AS3 or when using the Flex framework because its accessible in both.
Since the return of describeType is XML I have more options with E4X filtering/Regular Expressions, than using getClassInfo(). With describeType I can get info on methods as well but to keep things simple I'm only talking about accessor properties in this post. Using the "listProperties" function, I am listing the properties between 3 different classes. This is a function I wrote to show how you can make your own way to use the XML of decribeType.

In the example SWF below, there are 3 classes under inspection. The Helicopter class is a custom class extending Sprite. By setting the parameters of listProperties you can list the properties of Helicopter, or all of the properties it has by being subclassed from Sprite. The other classes are a TextField and a Sprite class. Changing the options lists a different set of properties based on type of Class of properties listed and what class its properties are declared by.

Get Adobe Flash player


Read the rest of this entry »

Comments 1 Comment »

Thanks for visiting www.keith-hair.net