ActionScript 3.0, Adobe Flex

Adobe Flex : There is a bug in the Adobe Flex Framework ToolTipManager Implementation

I have registered it with the Adobe Flex Team.
https://bugs.adobe.com/jira/browse/SDK-15863

When using a CustomToolTip set via the ToolTipmanager.toolTipClass property, “text” is never invoked.
Its easily solved however, it just requires you to override commitProperties and set the text yourself.

override protected function commitProperties():void
  {
   super.commitProperties();
   text = ToolTipManager.currentTarget[ "toolTip" ];
  }

And here is a complete implementation of a custom tooltip.

package
{
 import mx.containers.Canvas;
 import mx.controls.Button;
 import mx.core.IToolTip;
 import mx.managers.ToolTipManager;

 public class CustomToolTip extends Canvas implements IToolTip
 {
  private var _button:Button;

  public function CustomToolTip()
  {
   super();
  }

  override protected function createChildren():void
  {
   super.createChildren();
   _button = new Button();
   addChild( _button );
  }

  override protected function commitProperties():void
  {
   super.commitProperties();
   text = ToolTipManager.currentTarget[ "toolTip" ];
  }

  public function get text() : String
  {
   return _button.label;
  }
  public function set text( value:String ) : void
  {
   _button.label = value;
  }
 }
}

I suppose you can also workaround it by changing the ToolTipManagerImpl class, but I prefer not to change the framework sourcecode for so many reasons that its beyond the scope of this post.

Also, I really dislike every sample out there illustrating how to implement custom tooltips, as they all involve calling a method on a toolTip event and hence requires you to use your custom ToolTip logic everywhere in your system instead of using the framework.

Uncategorized

Flash Player : Mac Player FileUpload Complete event not thrown

I have been raving a long time about the missing Complete event in Mac players, it appears that it is caused by a zero-length response is returned to the client.

Its been there a very long time as I remember having troubles with it during the Flex 1.5 days developing for the Macromedia Central runtime.

A quick and dirty hack on the server is to write something (can be anything) back into the response stream. Clients will ignore the payload and only look for the HTTP status header but the Complete event will be thrown on all players… 🙂

is it not an option to modify the servercode, you can make up for the missing event by listening for the progress event and in the handler comparing the amount of processed bytes with the total amount of bytes.