Archive for the “Flex” Category

Rick Moranis as Louis Tully in Ghostbusters.

Dana Barrett: Are you the Keymaster?
Dr. Peter Venkman: Yes. Actually I'm a friend of his, he asked me to meet him here.

-Ghostbusters

It's been a whole year since I needed to use the KeyManager class and from comments I've been made aware of bugs in my script.
I was hoping the scripts would be a sufficient start that should issues arrive, others would come up with work-a-rounds. (Thank you to all who noted solutions and problems.)

Lately I was needing to write some keyboard interactivity again and I wanted to add some features to help simplify newer task...also fix a couple of things in the process.
In Flex, a lot of coding deals with listening to events. The KeyManager needed events for the tasks I was working on. Callback functions where ok at first but adding "KEY_DOWN", "KEY_UP" and "KEY_SEQUENCE" events help make the class more useful for monitoring status. Monitoring events give more options for handling keyboard activity in one handler function versus using a separate function for each keyboard combination. So now I've updated the class to have both.
Read the rest of this entry »

Vote in HexoSearch

Comments 2 Comments »

For most situations when I want to only execute code of an application running from the editor, I use regular expressions to check the application's url.
You could use other regular expressions for your own situation.

In Flash Builder 4

 
 
                        public static function isDevEnvironment():Boolean
			{
				return mx.core.FlexGlobals.topLevelApplication.url.search(/^file|^\w:\\ig/) != -1;
			}
 

In Flex Builder 3

 
			public static function isDevEnvironment():Boolean
			{
				return mx.core.Application.application.url.search(/^file|^\w:\\ig/) != -1;
			}
 
Vote in HexoSearch

Comments No Comments »

I like using MXML because it is quicker than writing ActionScript for a lot tasks.
When you create a TitleWindow in MXML, it is not draggable.
To make a TitleWindow draggable you have to create the window in ActionScript using the PopUpManager methods "createPopUp" or "addPopUp"
I wanted this process simpler so that next time I wanted a draggable window, I could just use a simple MXML tag.

Here I extended the TitleWindow to make it be automatically added with the PopUpManager.
Also all the child components get carried over after PopUpManager is used.
I did this so I could lazily use MXML and all references to this component instance stay intact, because the PopUpManager is using the same instance of the MXML component.

Get Adobe Flash player

The "Move Left" and "Move Right" buttons show that the references are ok.

Read the rest of this entry »

Vote in HexoSearch

Comments 3 Comments »

Thanks for visiting www.keith-hair.net