RSS Valid
XHTML Valid
CSS Valid

Forcing ComboBox Component Open Direction in Flex

Tuesday, October 14th, 2008

The ComboBox component is neat because it automatically determines if there is enough space for it to open down and if there isn’t, it’ll tween upwards instead. However, I came across an issue recently where I needed to force it to open up or down. Unfortunately, the displayDropdown method is private, so overriding and re-writing the code is out of the question. You could override keyDownHandler, close, open, and downArrowButton_buttonDownHandler and then replace displayDropdown with a custom function in each, but that seems annoying to me! I’m not sure why the displayDropdown function is private, but anyway, here’s a simple solution to force direction.

Read the rest of this entry »

Flash API versus Flex Framework: Thoughts

Friday, October 3rd, 2008

When I first started using the Flex framework I figured it would be really easy to work with in Flash and vice versa. The truth is, it requires a bit of work to get both to play nicely. For example, if you’re used to the Flash API, you might do something like:

var container:Sprite = new Sprite;
var sprite:Sprite = new Sprite;

container.addChild(sprite);

to add a sprite to the parent container. You can do this in Flex as well. But say you wanted to add this container to a Flex Component. You can’t directly add Sprites and the like to components because their children must extend UIComponent or implement the IUIComponent interface (From the documentation … “The IUIComponent interface defines the basic set of APIs that you must implement to create a child of a Flex container or list.”). Workarounds for this include wrapping a Sprite in a UIComponent:

Read the rest of this entry »

Background disappearing with TabNavigator in Flex

Sunday, August 10th, 2008

Was having an issue with the TabNavigator component in Flex today. When switching to a new Tab, the background of the whole application would turn white and parts of the Tabs were not rendering correctly. Through a little googling, I found a similar bug reported on adobe. The working around seems to work pretty nicely until the “bug” is resolved:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
	<mx:Script>
		<![CDATA[
			/**
			 * Force main app to redraw
			 * @return void
			 */
			private function hackToFixBgBug():void {
				this.alpha = 0.99; 
				this.alpha = 1.0;
			}
		]]>
	</mx:Script>	
	<mx:TabNavigator id="tabNavigator" mouseDown="hackToFixBgBug()">
		<!--tab windows go here-->
	</mx:TabNavigator>
</mx:Application>
Basically, it looks like you’re just forcing the main swf to “redraw” whenever you click on the TabNavigator.

svn and Flex, hiding folders

Sunday, August 3rd, 2008

I found that after working for a day with Flex and commiting my changes to subversion that the bin-debug folder had a ‘S’ status code next to it. This one was unfamiliar to me, but after looking it up it seems like it’s a code for “traversing branches” or that you’ve (s)witched your working copy to a new branch. Apparently, since html-template is used to publish to bin-debug, the .svn files in bin-debug are being overwritten (and seems to modify them to look like a switch).

To avoid this conflict, you just do not want the two folders to be included under version control. To “ignore” them when you commit your changes, modify the svn:ignore property (in this case I’ve cd‘ed into my Flex project directory that contains ‘bin-debug’ using Terminal):

svn propedit svn:ignore .

The EDITOR property of your shell should open a file. My EDITOR is set to 'mate -w' (open the file with TextMate and wait for it to close)…in the file you want to add these two lines:

bin-debug
html-template

There may be other directories and files to include after publishing the release build, but I haven’t reached that stage in my project quite yet. Anyway, once saved and closed it outputs:

Set new value for property 'svn:ignore' on '.'

In a GUI such as Zigversion, you can right-click your project directory, select “Ignore Properties…” and add the same two lines using the ‘+’ button.

Hiding .svn files in Flex Builder

This may sound silly, but Eclipse is so unintuitive, it took me a while to figure out how to accomplish hiding typically hidden files in the ‘Flex Navigator’ panel. Click on the downwards pointing arrow (third from the right)

flex hidden files

and select “Filters…”. Then check the box next to “.*”. Now any hidden files will be not shown. If anyone has any ideas how to customize these filters, please let me know.

UPDATE: just found this awesome post which had some solutions for still including the bin-debug and html-template folders!

10.5.3 vs. Flex

Wednesday, June 11th, 2008

I’ve been getting heavily into Flex development recently and found that after installing Mac OS update 10.5.3 that it seems to have either deleted or overwritten the debugger version of the Flash player that Flex uses to debug SWFs. A simple reinstall of the debugger seems to fix it (get the latest here):

Adobe Flash Player 9 — Debugger Versions (aka debug players or content debuggers) for Flex and Flash Developers 4/8/2008 Updated debugger versions of Flash Player 9 (aka debug players or content debuggers) are available for Flex Builder 3 users and Flash CS3 Professional users. These new players are version 9.0.124.0.

Here’s hoping that there aren’t any other underlying issues that would warrant a reinstall of the whole application.

Availability

We'd love to hear about your project! Please see the services and contact sections for more information or for work inquiries.