Posts tagged flex

Firefox 3.6 breaks Flex’s doubleClick event

6

I’m surprised that no one’s mentioned this yet as I couldn’t find anything online. This morning I noticed that I couldn’t double click on a list component that is part of a work project. I had recently done some changes to the app so I initally panicked thinking I had broken something. After noticing that everything still worked perfection in Safari, I remembered that I had just upgraded to the latest firefox release 3 days ago (3.6) and that perhaps one of the plugins were not working correctly. I disabled all my plugins but unfortunately it had no effect, which leaves FF 3.6 itself as the culprit. I asked Adrian to test it using 3.5.7 and sure enough it worked as expected.

Try it

This should affect all flex applications that are being run with Firefox 3.6 Seems to be OS dependent and only affecting the OSX folks. You can test it out yourself here: Double Click button @ FlexExamples (Scroll down a bit to find the app)

My output using Safari:

[13:02:08 GMT-0800] click
[13:02:08 GMT-0800] doubleClick
[13:02:08 GMT-0800] click
[13:02:08 GMT-0800] doubleClick
[13:02:09 GMT-0800] click
[13:02:09 GMT-0800] doubleClick

My output using Firefox 3.6:

[13:02:43 GMT-0800] click
[13:02:43 GMT-0800] click
[13:02:44 GMT-0800] click
[13:02:44 GMT-0800] click
[13:02:44 GMT-0800] click
[13:02:44 GMT-0800] click

I’m not sure if there’s anything we can do. I even tried using the latest beta flash player (10.1) but it didn’t help. I also started a thread over at actionscript.org, maybe someone knowledgeable can chime in there.

Hopefully Mozilla/Adobe can fix this issue soon.

Flex: Using the RichTextEditor’s ToolBar class as a flowlayout container

0

So I needed to have a container with a flowlayout implementation for its children and came upon Flexlib’s FlowBox class, which was exactly what I needed. Unfortunately the implementation has its own set of issues, the major one being that the height of the FlowBox grows as you add items into it. Furthermore, whenever the row wraps it does not respect the padding information defined in the css and will just stick the item all the way against the border. Since I wasn’t really in the mood to go through the code to fix it, I did some more googling and turns out the ToolBar class also does the same thing.

Perfect! Well… almost. When I started using it, it certainly does what I wanted it to but I was unable to access the methods through code hinting on Flex Builder. According to a post by Tianzhen Lin from the link above, the ToolBar class is marked as [ExcludeClass] and is thus excluded from the code hinting (excerpt from sdks/3.x/frameworks/projects/framework/src/mx/controls/richTextEditorClasses/ToolBar.as):

package mx.controls.richTextEditorClasses
{
 
import mx.controls.VRule;
import mx.core.Container;
import mx.core.EdgeMetrics;
import mx.core.IUIComponent;
 
//--------------------------------------
//  Styles
//--------------------------------------
 
/**
 *  Number of pixels between children in the horizontal direction.
 *  The default value is 8.
 */
[Style(name="horizontalGap", type="Number", format="Length", inherit="no")]
 
/**
 *  Number of pixels between children in the vertical direction.
 *  The default value is 8.
 */
[Style(name="verticalGap", type="Number", format="Length", inherit="no")]
 
//--------------------------------------
//  Other metadata
//--------------------------------------
 
[ExcludeClass]

The solution is just to subclass it as something else. Create a new .as file like so:

package com.gp.controls
{
	//Get around the ExcludeClass by reimplementation
	import mx.controls.richTextEditorClasses.ToolBar;
 
	public class CustomFlowBox extends ToolBar
	{
		public function CustomFlowBox()
		{
			super();
		}
 
	}
}

and use that instead.

Go to Top