Archive for the ‘ActionScript 3’ Category

Flex Builder/Eclipse MXML/AS3 Source Formatter

Way back in April, I had been looking for an Eclipse plugin to format MXML and came up blank.  Today I found one (thanks to Digital Media Minute) and it works great. I just used to clean up some old code of mine, plus reformat some code I inherited from another developer.

Flex Formatter:  http://flexformatter.sourceforge.net/ Download the .jar file and place in your Flex Builder or Eclipse plugins folder and restart FB or Eclipse.  There is a pretty extensive configuration panel that you can use to modify the formatting to your standards (Window > Preferences > Flex Formatter). Additional information on the formatting options is here: http://sourceforge.net/docman/display_doc.php?docid=137421&group_id=248408. You can also import/export your settings so you can share with your team.

FXG Complex Rectangle Experiment

I’m a bit late to the party, but started really looking at Flex4 this week … FXG in particular. I looked over the few basic FXG Shapes (Rect, Ellipsis, and Line) and thought it looked pretty limited. I had used Degrafa on a few projects and really got used to the Round Rectangle Complex and the ability to set each rectangle corner with a different radius.  The FXG Rect has the ability to set corner radius, but its every corner and lacks the the control.  So… i figured with FXG the new standard for Adobe, I’d look at how hard it would be to create a custom FXG class.

Well, not too hard at all.  I started by looking at the Rect class in Flex, and then had to hunt around for simulate Cubic Beziers using the curveTo method (Thanks Senocular for that answer).

If you want to play around with it (requires Flash Player 10):Â View Source

AMFEXT on OSX? Anyone?

Has anyone been able to get AMFEXT for OSX?   I read a few posts regarding AMFEXT on OSX, but it didnt help out too much.

AMFEXT is a PHP extension written in C that implements encoding and decoding of AMF and AMF3 messages for the PHP language. It has been based on some of the experience gained with AMFPP, a native code for encoding and decoding C. The native encoding and decoding is extremely fast and memory efficient respect existing PHP implementation, and the flexibility has been provided using callbacks to the PHP code.

Lee’s New Event Generator Extension for Flash CS3!

If you are new to ActionScript 3.0 in Flash CS3, check out Lee’s new Flash CS3 extension for writing the event code.  Very handy if you are starting out. Based on initial response and Lee providing the source code, I’m sure we’ll see some great enchancements to this extension.

http://theflashblog.com/?p=331

AS3: Getting the path of the HTML hosting the SWF

I was trying to get the full path of the HTML that is hosting the SWF in ActionScript 3. I found this post by Abdul Qabiz detailing how to use ExternalInterface to call JS and return the location.  In his post, Abdul also details how to get any of the query string variables as well.

Since I’m sure I’ll use it again and don’t want to hunt it down, I’m posting it here for myself and well as everyone else who may find it useful.

 [code]
import flash.external.ExternalInterface;

var t:TextField = new TextField();
t.autoSize = TextFieldAutoSize.LEFT;
var full:String = ExternalInterface.call("window.location.href.toString");
t.text = full;
addChild(t);
[/code]

Return top