Mike Chambers

Syndicate content
code = joy
Updated: 11 min 46 sec ago

Updated ActionScript 3 RIA API Guide

Tue, 11/18/2008 - 12:44

We have just posted an updated PDF of the Flash Platform ActionScript 3 RIA API Guide. The new guide includes updated apis for Adobe AIR 1.5, Flex 3.2 and Flash Player 10.

You can find more information on the guide, as well as download the PDF from the developer center.

You can view some images of the previous guide here.

We also have printed versions of the guide. If you are MAX, you can find one in your goodie bag. If you are not at max, I will be sending some guides and new eboy sticker sheets next week. Watch my twitter account for more info on how to get one.

New Flash Platform Stickers (designed by eboy)

Mon, 11/17/2008 - 16:28

Flash Platform Sticker Sheet

We will have some out each day at the Adobe booth at MAX.

fyi, I am going to mail some of these out next week (along with updated AS3 RIA Guides). Ill post more info next week on my twitter account.

Adobe AIR 1.5 is out

Mon, 11/17/2008 - 09:15

We just released Adobe AIR 1.5. While this is a point release, it is a pretty significant update. You can find an overview of new features and updates in this article on the developer center, and in this blog post.

What is my favorite feature of AIR 1.5? Bug fixes! In particular URL clicks are now handled correctly (correct browser is opened, and links open in new tab in Firefox as appropriate).

You can grab the latest version here, or you will be prompted to update it the next time you run an AIR application.

Show us your AIR / Flex / ColdFusion apps at MAX

Sat, 11/15/2008 - 11:25

If you are working on an AIR app, and will be attending MAX 2008 this week, make sure to stop by the booth to show us your app. We have a station setup called “Developer Spotlight” where you can come and show your app to AIR Team members and evangelists (as well as ask any questions you might have).

Anyone who comes by and shows us their app will get either a new ColdFusion or AIR tshirt (both created by eboy).

Ill be around Monday afternoon, but the booth will be staffed all of the time (Ben Forta is there on Tuesday afternoon).

See you at MAX.

Growl support for Adobe AIR applications

Thu, 11/13/2008 - 10:39

One of the top feature requests that end users have been asking for from AIR applications (on Mac) is the ability for those applications to leverage the open source Growl notification framework on Mac. However, this was not previously possible due to how applications are required to communicate with Growl.

I am really excited to announce that Adobe has been working with the Growl team to add support to Growl for Adobe AIR and Flash applications. Among other things, this will enable Adobe AIR applications to leverage the Growl notification framework on Mac. The best part, is that it is implemented in a way that is not just limited to use by Flash and AIR.

The new functionality is not yet in the release version of Growl, but if you are a developer you can download a nightly source build of Growl with the support. This will allow you to play around with the functionality and begin to add Growl support to your application.

In addition, I have put together a new open source ActionScript project, named as3growl, which provides an API for working with the new Growl functionality. The project is hosted at Google code and already contains the complete API source, API docs, examples, documentation, unit tests and other information.

I have posted information on how to grab the correct Growl source and compile it. You can find it in the Known Issues section of the as3growl Release Notes.

If you find any issues, or have any feature requests, you can log them here.

You can find more info about Growl on their site.

Update (November 17, 2008) : I created a mailing list for the project here.

As3CoreLib .92 Posted

Fri, 11/07/2008 - 10:58

I have just posted a new build and zip file of the ActionScript 3 CoreLib Library (as3corelib). This in an open source library that contains a number of classes and utilities for working with ActionScript 3.

This is release .92 and includes a number of bug and performance fixes, as well as some new functionality.

One thing to note is that we have added support for some AIR specific classes. Anything in the com.adobe.air package will only run within Adobe AIR. I am looking to do the same for Flex classes, which would make it much easier to determine which classes work where. The majority of the classes do not require Flex or AIR.

You can download the new build, which includes the SWC, source and api docs from the project page.

If you find any issues, please make sure to log them on the issues page. If you would like to contribute to the project, we are always looking for people to help out.

Getting the File URI of a File in an AIR app’s install directory

Thu, 11/06/2008 - 13:57

I am currently working on some code that runs in Adobe AIR where I need to access the File URL (file:/) of a file located in the AIR app’s install directory.

Normally, you could get the URI, by accessing the url property of the File object which will return a well formed, absolute file:/ URL. However, this doesn’t work for files located in the AIR app’s install directory.

var f:File = new File("app:/icon.png"); trace(f.url); //app:/icon.png

 

While the app:/ URI will work within your AIR application, it will not work if you need to pass that URI to a non AIR application.

Here is the workaround for how to get the File URL of a file in the application install directory:

var fPath:String = new File(new File("app:/icon.png").nativePath).url; trace(fPath);

 

This will give you an absolute file URI similar to:

file:///Users/mesh/Documents/Flex%20Builder%203/AppName/bin-debug/icon.png

 

Of course, this is a bit of a hack, and not that efficient (requires two File instances), but it works.

Is ActionScript 2 Development Faster than ActionScript 3 Development?

Wed, 10/29/2008 - 09:04

I got a ton of feedback in response to my question about the continued use of ActionScript 1 and 2. One thing that consistently came up was that some felt that it was faster to develop within ActionScript 2 than 3. However, it wasn’t clear from the commenters if this was because they already knew ActionScript 2 and were not as comfortable with AS3, or if there were things that were just harder / more tedious in ActionScript 3.

So, my next question is : do you think ActionScript 2 development is faster than ActionScript 3 development? If yes, do you know ActionScript 3 already? Can you give specific examples of things that you feel are faster / easier in ActionScript 2 (for example, playing a sound, or working with events)?

Post any input in the comments.

Complete List of new Flash Player 10 APIs

Mon, 10/27/2008 - 09:23

I am working on updating the ActionScript RIA Reference Guide. As part of that, I have to figure add all of the new APIs added to Flash Player 10.

Below is a list of such APIs generated and parsed from the APIs docs. I figured I would post it here as a reference, and also a sanity check (if you see anything wrong or missing, please post in the comments).

Update : I just updated the list and added a bunch of missing APIs. Thanks for all of the input.

--------------------------------Flash Player------------------------ --------------------------------Flash Player------------------------ --------------------------------Flash Player------------------------ Vector p:Top Level ->Object Implements: Fields length:uint fixed:Boolean ------------- Static Fields ------------- Static Methods ------------- Methods ------------- concat():Vector.<T> every():Boolean filter():Vector.<T> forEach():void indexOf():int join():String lastIndexOf():int map():Vector.<T> pop():T push():uint reverse():Vector.<T> shift():T slice():Vector.<T> some():Boolean sort():Vector.<T> splice():Vector.<T> toString():String toLocaleString():String unshift():uint ------------------------------------------- ------------------------------------------- NetStreamPlayOptions p:flash.net ->EventDispatcher Implements: Fields ------------- len:Number oldStreamName:String start:Number streamName:String transition:String Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- BlendMode p:flash.display ->Object Implements: Fields ------------- Static Fields ------------- SHADER:String Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- Event p:flash.events ->Object Implements: Fields ------------- Static Fields ------------- CLEAR:String COPY:String CUT:String PASTE:String SELECT_ALL:String Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- FontType p:flash.text ->Object Implements: Fields ------------- Static Fields ------------- EMBEDDED_CFF:String; Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- ApplicationDomain p:flash.system ->Object Implements: Fields ------------- domainMemory:ByteArray Static Fields ------------- MIN_DOMAIN_MEMORY_LENGTH:uint Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- DisplayObject p:flash.system ->EventDispatcher Implements: IBitmapDrawable Fields ------------- blendShader:void rotationX:Number rotationY:Number rotationZ:Number scaleZ:Number z:Number Static Fields ------------- Static Methods ------------- Methods ------------- globalToLocal3D():Vector3D local3DToGlobal():Point ------------------------------------------- ------------------------------------------- Microphone p:flash.media ->EventDispatcher Implements: Fields ------------- codec:String encodeQuality:int framesPerPacket:int Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- MovieClip p:flash.display ->Sprite Implements: Fields ------------- currentFrameLabel:String Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- NetConnection p:flash.net ->EventDispatcher Implements: Fields ------------- farID:String farNonce:String maxPeerConnections:uint nearID:String nearNonce:String protocol:String unconnectedPeerStreams:Array Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- ShaderParameter p:flash.display ->Object Implements: Fields ------------- index:int type:String value:Array Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- Sound p:flash.media ->EventDispatcher Implements: Fields ------------- Static Fields ------------- Static Methods ------------- Methods ------------- extract():Number ------------------------------------------- ------------------------------------------- Mouse p:flash.ui ->Object Implements: Fields ------------- cursor:String Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- NetStream p:flash.net ->EventDispatcher Implements: Fields ------------- farID:String info:NetStreamInfo nearNonce:String farNonce:String peerStreams:Array Static Fields ------------- DIRECT_CONNECTIONS:String; CONNECT_TO_FMS:String Static Methods ------------- Methods ------------- onPeerConnect():Boolean play2():void ------------------------------------------- ------------------------------------------- NetStreamInfo p:flash.net ->Object Implements: Fields ------------- audioBufferByteLength:Number audioBufferLength:Number audioByteCount:Number audioBytesPerSecond:Number audioLossRate:Number byteCount:Number currentBytesPerSecond:Number dataBufferByteLength:Number dataBufferLength:Number dataByteCount:Number dataBytesPerSecond:Number droppedFrames:Number maxBytesPerSecond:Number playbackBytesPerSecond:Number SRTT:Number videoBufferByteLength:Number videoBufferLength:Number videoByteCount:Number videoBytesPerSecond:Number Static Fields ------------- EMBEDDED_CFF:String; Static Methods ------------- Methods ------------- toString():String ------------------------------------------- ------------------------------------------- DigitCase p:flash.text.engine ->Object Implements: Fields ------------- Static Fields DEFAULT:String LINING:String OLD_STYLE:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- FontWeight p:flash.text.engine ->Object Implements: Fields ------------- Static Fields NORMAL:String BOLD:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- Kerning p:flash.text.engine ->Object Implements: Fields ------------- Static Fields ON:String OFF:String AUTO:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- FontDescription p:flash.text.engine ->Object Implements: Fields renderingMode:String fontLookup:String fontName:String fontPosture:String fontWeight:String cffHinting:String locked:Boolean ------------- Static Fields ------------- Static Methods ------------- isFontCompatible():Boolean Methods ------------- FontDescription() clone():FontDescription ------------------------------------------- ------------------------------------------- LigatureLevel p:flash.text.engine ->Object Implements: Fields ------------- Static Fields NONE:String MINIMUM:String COMMON:String UNCOMMON:String EXOTIC:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- RenderingMode p:flash.text.engine ->Object Implements: Fields ------------- Static Fields NORMAL:String CFF:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- TextElement p:flash.text.engine ->ContentElement Implements: Fields text:String ------------- Static Fields ------------- Static Methods ------------- Methods ------------- replaceText():void ------------------------------------------- ------------------------------------------- FontPosture p:flash.text.engine ->Object Implements: Fields ------------- Static Fields NORMAL:String ITALIC:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- TextLineValidity p:flash.text.engine ->Object Implements: Fields ------------- Static Fields VALID:String POSSIBLY_INVALID:String INVALID:String STATIC:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- TextLineCreationResult p:flash.text.engine ->Object Implements: Fields ------------- Static Fields SUCCESS:String EMERGENCY:String COMPLETE:String INSUFFICIENT_WIDTH:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- BreakOpportunity p:flash.text.engine ->Object Implements: Fields ------------- Static Fields AUTO:String ANY:String NONE:String ALL:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- ContentElement p:flash.text.engine ->Object Implements: Fields userData:* textBlock:TextBlock textBlockBeginIndex:int elementFormat:ElementFormat eventMirror:EventDispatcher groupElement:GroupElement rawText:String text:String textRotation:String ------------- Static Fields GRAPHIC_ELEMENT:uint ------------- Static Methods ------------- Methods ------------- ContentElement() ------------------------------------------- ------------------------------------------- TabStop p:flash.text.engine ->Object Implements: Fields alignment:String position:Number decimalAlignmentToken:String ------------- Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- TabAlignment p:flash.text.engine ->Object Implements: Fields ------------- Static Fields START:String CENTER:String END:String DECIMAL:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- JustificationStyle p:flash.text.engine ->Object Implements: Fields ------------- Static Fields PUSH_IN_KINSOKU:String PUSH_OUT_ONLY:String PRIORITIZE_LEAST_ADJUSTMENT:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- FontMetrics p:flash.text.engine ->Object Implements: Fields emBox:Rectangle strikethroughOffset:Number strikethroughThickness:Number underlineOffset:Number underlineThickness:Number subscriptOffset:Number subscriptScale:Number superscriptOffset:Number superscriptScale:Number ------------- Static Fields ------------- Static Methods ------------- Methods ------------- FontMetrics() ------------------------------------------- ------------------------------------------- TextLineMirrorRegion p:flash.text.engine ->Object Implements: Fields textLine:TextLine nextRegion:TextLineMirrorRegion previousRegion:TextLineMirrorRegion mirror:EventDispatcher element:ContentElement bounds:Rectangle ------------- Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- TextLine p:flash.text.engine ->DisplayObjectContainer Implements: Fields userData:* textBlock:TextBlock hasGraphicElement:Boolean nextLine:TextLine previousLine:TextLine ascent:Number descent:Number textHeight:Number textWidth:Number textBlockBeginIndex:int rawTextLength:int specifiedWidth:Number unjustifiedTextWidth:Number validity:String atomCount:int mirrorRegions:Vector.<TextLineMirrorRegion> ------------- Static Fields MAX_LINE_WIDTH:int ------------- Static Methods ------------- Methods ------------- getMirrorRegion():TextLineMirrorRegion flushAtomData():void getAtomIndexAtPoint():int getAtomIndexAtCharIndex():int getAtomBounds():Rectangle getAtomBidiLevel():int getAtomTextRotation():String getAtomTextBlockBeginIndex():int getAtomTextBlockEndIndex():int getAtomCenter():Number getAtomWordBoundaryOnLeft():Boolean getAtomGraphic():DisplayObject getBaselinePosition():Number dump():String ------------------------------------------- ------------------------------------------- CFFHinting p:flash.text.engine ->Object Implements: Fields ------------- Static Fields NONE:String HORIZONTAL_STEM:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- ElementFormat p:flash.text.engine ->Object Implements: Fields alignmentBaseline:String alpha:Number baselineShift:Number breakOpportunity:String color:uint dominantBaseline:String fontDescription:FontDescription digitCase:String digitWidth:String ligatureLevel:String fontSize:Number kerning:String locale:String textRotation:String trackingRight:Number trackingLeft:Number typographicCase:String locked:Boolean ------------- Static Fields ------------- Static Methods ------------- Methods ------------- ElementFormat() getFontMetrics():FontMetrics clone():ElementFormat ------------------------------------------- ------------------------------------------- GraphicElement p:flash.text.engine ->ContentElement Implements: Fields graphic:DisplayObject elementHeight:Number elementWidth:Number ------------- Static Fields ------------- Static Methods ------------- Methods ------------- GraphicElement() ------------------------------------------- ------------------------------------------- DigitWidth p:flash.text.engine ->Object Implements: Fields ------------- Static Fields DEFAULT:String PROPORTIONAL:String TABULAR:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- TextJustifier p:flash.text.engine ->Object Implements: Fields locale:String lineJustification:String ------------- Static Fields ------------- Static Methods ------------- getJustifierForLocale():TextJustifier Methods ------------- clone():TextJustifier ------------------------------------------- ------------------------------------------- TextBlock p:flash.text.engine ->Object Implements: Fields userData:* applyNonLinearFontScaling:Boolean baselineFontDescription:FontDescription baselineFontSize:Number baselineZero:String content:ContentElement bidiLevel:int firstInvalidLine:TextLine firstLine:TextLine lastLine:TextLine textJustifier:TextJustifier textLineCreationResult:String lineRotation:String tabStops:Vector.<TabStop> ------------- Static Fields ------------- Static Methods ------------- Methods ------------- findNextAtomBoundary():int findPreviousAtomBoundary():int findNextWordBoundary():int findPreviousWordBoundary():int getTextLineAtCharIndex():TextLine createTextLine():TextLine releaseLines():void dump():String ------------------------------------------- ------------------------------------------- GroupElement p:flash.text.engine ->ContentElement Implements: Fields elementCount:int ------------- Static Fields ------------- Static Methods ------------- Methods ------------- getElementAt():ContentElement setElements():void groupElements():GroupElement ungroupElements():void mergeTextElements():TextElement splitTextElement():TextElement replaceElements():Vector.<ContentElement> getElementAtCharIndex():ContentElement getElementIndex():int ------------------------------------------- ------------------------------------------- TypographicCase p:flash.text.engine ->Object Implements: Fields ------------- Static Fields DEFAULT:String TITLE:String CAPS:String SMALL_CAPS:String UPPERCASE:String LOWERCASE:String CAPS_AND_SMALL_CAPS:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- EastAsianJustifier p:flash.text.engine ->TextJustifier Implements: Fields justificationStyle:String ------------- Static Fields ------------- Static Methods ------------- Methods ------------- clone():TextJustifier EastAsianJustifier() ------------------------------------------- ------------------------------------------- LineJustification p:flash.text.engine ->Object Implements: Fields ------------- Static Fields UNJUSTIFIED:String ALL_BUT_LAST:String ALL_INCLUDING_LAST:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- SpaceJustifier p:flash.text.engine ->TextJustifier Implements: Fields letterSpacing:Boolean ------------- Static Fields ------------- Static Methods ------------- Methods ------------- clone():TextJustifier ------------------------------------------- ------------------------------------------- FontLookup p:flash.text.engine ->Object Implements: Fields ------------- Static Fields DEVICE:String EMBEDDED_CFF:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- TextRotation p:flash.text.engine ->Object Implements: Fields ------------- Static Fields ROTATE_0:String ROTATE_90:String ROTATE_180:String ROTATE_270:String AUTO:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- TextBaseline p:flash.text.engine ->Object Implements: Fields ------------- Static Fields ROMAN:String ASCENT:String DESCENT:String IDEOGRAPHIC_TOP:String IDEOGRAPHIC_CENTER:String IDEOGRAPHIC_BOTTOM:String USE_DOMINANT_BASELINE:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- TriangleCulling p:flash.display ->Object Implements: Fields ------------- Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- ShaderData p:flash.display ->Object Implements: Fields ------------- Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- GraphicsEndFill p:flash.display ->Object Implements: IGraphicsFill IGraphicsData Fields ------------- Static Fields ------------- Static Methods ------------- Methods ------------- GraphicsEndFill() ------------------------------------------- ------------------------------------------- ColorCorrectionSupport p:flash.display ->Object Implements: Fields ------------- Static Fields UNSUPPORTED:String DEFAULT_ON:String DEFAULT_OFF:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- ShaderInput p:flash.display ->Object Implements: Fields input:Object width:int height:int channels:int index:int ------------- Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- GraphicsGradientFill p:flash.display ->Object Implements: IGraphicsFill IGraphicsData Fields colors:Array alphas:Array ratios:Array matrix:Matrix focalPointRatio:Number type:String spreadMethod:String interpolationMethod:String ------------- Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- GraphicsPathWinding p:flash.display ->Object Implements: Fields ------------- Static Fields EVEN_ODD:String NON_ZERO:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- GraphicsStroke p:flash.display ->Object Implements: IGraphicsStroke IGraphicsData Fields thickness:Number pixelHinting:Boolean miterLimit:Number fill:IGraphicsFill caps:String joints:String scaleMode:String ------------- Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- ShaderParameterType p:flash.display ->Object Implements: Fields ------------- Static Fields FLOAT:String FLOAT2:String FLOAT3:String FLOAT4:String INT:String INT2:String INT3:String INT4:String BOOL:String BOOL2:String BOOL3:String BOOL4:String MATRIX2X2:String MATRIX3X3:String MATRIX4X4:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- IGraphicsStroke p:flash.display ->Object Implements: Fields ------------- Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- ShaderJob p:flash.display ->EventDispatcher Implements: Fields shader:Shader target:Object width:int height:int progress:Number ------------- Static Fields ------------- Static Methods ------------- Methods ------------- start():void cancel():void ------------------------------------------- ------------------------------------------- GraphicsBitmapFill p:flash.display ->Object Implements: IGraphicsFill IGraphicsData Fields bitmapData:BitmapData matrix:Matrix repeat:Boolean smooth:Boolean ------------- Static Fields ------------- Static Methods ------------- Methods ------------- GraphicsBitmapFill() ------------------------------------------- ------------------------------------------- IGraphicsData p:flash.display ->Object Implements: Fields ------------- Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- Shader p:flash.display ->Object Implements: Fields byteCode:ByteArray data:ShaderData precisionHint:String ------------- Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- GraphicsPath p:flash.display ->Object Implements: IGraphicsPath IGraphicsData Fields commands:Vector.<int> data:Vector.<Number> winding:String ------------- Static Fields ------------- Static Methods ------------- Methods ------------- moveTo():void lineTo():void curveTo():void wideLineTo():void wideMoveTo():void ------------------------------------------- ------------------------------------------- IGraphicsFill p:flash.display ->Object Implements: Fields ------------- Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- GraphicsShaderFill p:flash.display ->Object Implements: IGraphicsFill IGraphicsData Fields shader:Shader matrix:Matrix ------------- Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- ShaderPrecision p:flash.display ->Object Implements: Fields ------------- Static Fields FULL:String FAST:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- IDrawCommand p:flash.display ->Object Implements: Fields ------------- Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- GraphicsTrianglePath p:flash.display ->Object Implements: IGraphicsPath IGraphicsData Fields indices:Vector.<int> vertices:Vector.<Number> uvtData:Vector.<Number> culling:String ------------- Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- ColorCorrection p:flash.display ->Object Implements: Fields ------------- Static Fields DEFAULT:String ON:String OFF:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- GraphicsPathCommand p:flash.display ->Object Implements: Fields ------------- Static Fields NO_OP:int MOVE_TO:int LINE_TO:int CURVE_TO:int WIDE_MOVE_TO:int WIDE_LINE_TO:int ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- IGraphicsPath p:flash.display ->Object Implements: Fields ------------- Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- GraphicsSolidFill p:flash.display ->Object Implements: IGraphicsFill IGraphicsData Fields color:uint alpha:Number ------------- Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- ShaderFilter p:flash.filters ->BitmapFilter Implements: Fields shader:Shader leftExtension:int topExtension:int rightExtension:int bottomExtension:int ------------- Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- NetStreamPlayTransitions p:flash.net ->Object Implements: Fields ------------- Static Fields APPEND: RESET: SWITCH: SWAP: STOP: ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- SoundCodec p:flash.media ->Object Implements: Fields ------------- Static Fields NELLYMOSER:String SPEEX:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- ContextMenuClipboardItems p:flash.ui ->Object Implements: Fields cut:Boolean copy:Boolean paste:Boolean clear:Boolean selectAll:Boolean ------------- Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- MouseCursor p:flash.ui ->Object Implements: Fields ------------- Static Fields AUTO:String ARROW:String BUTTON:String HAND:String IBEAM:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- ClipboardTransferMode p:flash.desktop ->Object Implements: Fields ------------- Static Fields ORIGINAL_PREFERRED:String ORIGINAL_ONLY:String CLONE_PREFERRED:String CLONE_ONLY:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- Clipboard p:flash.desktop ->Object Implements: Fields formats:Array ------------- Static Fields generalClipboard:Clipboard ------------- Static Methods ------------- Methods ------------- clear():void clearData():void setData():Boolean setDataHandler():Boolean getData():Object hasFormat():Boolean ------------------------------------------- ------------------------------------------- ClipboardFormats p:flash.desktop ->Object Implements: Fields ------------- Static Fields TEXT_FORMAT:String HTML_FORMAT:String RICH_TEXT_FORMAT:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- ShaderEvent p:flash.events ->Event Implements: Fields bitmapData:BitmapData byteArray:ByteArray vector:Vector.<Number> ------------- Static Fields COMPLETE:String ------------- Static Methods ------------- Methods ------------- clone():Event toString():String ------------------------------------------- ------------------------------------------- SampleDataEvent p:flash.events ->Event Implements: Fields position:Number data:ByteArray ------------- Static Fields SAMPLE_DATA:String ------------- Static Methods ------------- Methods ------------- clone():Event toString():String ------------------------------------------- ------------------------------------------- Vector3D p:flash.geom ->Object Implements: Fields x:Number y:Number z:Number w:Number length:Number lengthSquared:Number ------------- Static Fields X_AXIS:Vector3D Y_AXIS:Vector3D Z_AXIS:Vector3D ------------- Static Methods ------------- angleBetween():Number distance():Number Methods ------------- clone():Vector3D dotProduct():Number crossProduct():Vector3D normalize():Number scaleBy():void incrementBy():void decrementBy():void add():Vector3D subtract():Vector3D negate():void equals():Boolean nearEquals():Boolean project():void toString():String ------------------------------------------- ------------------------------------------- Orientation3D p:flash.geom ->Object Implements: Fields ------------- Static Fields EULER_ANGLES:String AXIS_ANGLE:String QUATERNION:String ------------- Static Methods ------------- Methods ------------- ------------------------------------------- ------------------------------------------- PerspectiveProjection p:flash.geom ->Object Implements: Fields fieldOfView:Number projectionCenter:Point focalLength:Number ------------- Static Fields ------------- Static Methods ------------- Methods ------------- toMatrix3D():Matrix3D ------------------------------------------- ------------------------------------------- Matrix3D p:flash.geom ->Object Implements: Fields rawData:Vector.<Number> position:Vector3D determinant:Number ------------- Static Fields ------------- Static Methods ------------- interpolate():Matrix3D Methods ------------- clone():Matrix3D append():void prepend():void invert():Boolean identity():void decompose():Vector.<Vector3D> recompose():Boolean appendTranslation():void appendRotation():void appendScale():void prependTranslation():void prependRotation():void prependScale():void transformVector():Vector3D deltaTransformVector():Vector3D transformVectors():void transpose():void pointAt():void interpolateTo():void ------------------------------------------- ------------------------------------------- Utils3D p:flash.geom ->Object Implements: Fields ------------- Static Fields ------------- Static Methods ------------- projectVector():Vector3D projectVectors():void pointTowards():Matrix3D Methods ------------- ------------------------------------------- ------------------------------------------- JPEGLoaderContext p:flash.system ->LoaderContext Implements: Fields deblockingFilter:Number ------------- Static Fields ------------- Static Methods ------------- Methods ------------- ------------------------------------------- -------------------------------------------

Are you still using ActionScript 2? (or 1)?

Fri, 10/24/2008 - 11:50

If so, why?

Flash Player 10 Release is Out

Tue, 10/14/2008 - 21:11

We have just released the shipping version of Flash Player 10 (Mac, Windows and Linux). You can find more information on all of the new features on the Flash Player product page.

You can download the player for Mac, Windows and Linux players from here.

You can grab debug and standalone players from here.

You can grab the release notes from here.

Video interview with eBoy from on AIR Tour

Mon, 10/13/2008 - 10:18

Adobe AIR Launch TShirtWhile in Berlin this summer for the on AIR Tour, Lee Brimelow and I got the opportunity to visit their eBoy studio and chat with the guys about how they create their work. Lee has just posted a video of the visit on his blog.

I have always been a huge fan of eBoy’s work and art (best know for their pixel art). We worked with them to design the Adobe AIR launch t-shirt and poster (both of which have been very popular), and most recently, on a new AIR tshirt (which we gave out in Asia).

You can view the entire video here. You can check out eBoy’s work on their site.

Bash Scripts for working with ActionScript 3 in TextMate

Thu, 10/09/2008 - 11:41

I have switched over to using TextMate for some of my experimentations with ActionScript. I like how lightweight it is, its extensibility, command completion functionality, and ease of setting up new projects. I find it is perfect for quickly testing new code and ideas.

I have put together a couple of bash scripts, which coupled with the ActionScript 3 and Flex TextMate bundles have made working in TextMate a little easier for me.

The first script is called autocompile, which takes a class file, and compiles it anytime the file changes. This is really useful in TextMate as you can see any compile errors as you code.

autocompile

#!/bin/bash # mxmlc autocompile bash script # create by mike chambers # http://www.mikechambers.com #how often it check for changes in seconds LOOP_INTERVAL=2 #make sure that a file name was passed in if [ -z $1 ];then echo "You must specify a file to compile" exit 0 fi #make sure that the file exists if [ ! -e $1 ]; then echo "$1 does not exist" exit 0; fi #function to call mxmlc function compile() { mxmlc $1 } #compile on load compile $1 #get and store the last modified date of the file MODDATE=`stat -f %m $1` #loop every 2 seconds while [ true ] do #get the modified date TDATE=`stat -f %m $1` #check to see if it has changed if [ "$TDATE" != "$MODDATE" ]; then #file changed. Store new date MODDATE=$TDATE #compile compile $1 fi #sleep until we check file again sleep $LOOP_INTERVAL done

 

Using the script is easy, just pass in the name of the file you want it to compile:

autocompile Foo.as

The next script is called as. Basically, it takes the name of an ActionScript class file, generates the file from a template, opens it within a new project in TextMate, and automatically compiles the file when it is changed. This makes it very simple to setup a new project and start coding.

#!/bin/bash # script for creating and setting up ActionScript projects in # TextMate # create by mike chambers # http://www.mikechambers.com #make sure that a file name was passed in if [ -z $1 ];then echo "You must specify a Class file name" exit 0 fi #get the class name (remove .as) classname=`echo $1 | cut -d'.' -f1` #dir that contains the as.template file #make sure to set this #there should be a way to get this automatically wdir="/Users/mesh/bin/astmp" #write the contents of the template to the class file. cat $wdir/as.template | sed s/CLASSNAME/$classname/ > $1 #open the current directory and file in textmate mate . #begin to autocompile it autocompile $1

 

This requires that the following as.template file is in the directory referenced in the script (in the wdir variable).

as.template

package { import flash.display.Sprite; public class CLASSNAME extends Sprite { public function CLASSNAME() { } } }

 

In order to create the new project, create a new directory, cd to it and run the as command, passing in the name of the ActionScript class file you want it to create.

mkdir Foo cd Foo as Foo.as

 

This will create a new File.as file that contains the stub code for the Foo class. It will then open the Foo.as file in a new project in TextMate, and will compile the class anytime it changes (printing any compile errors and warnings to the terminal).

Note that I could automate the directory creation also, although I decided not to do that right now.

Couple of notes:

  • You must have the TextMate command line tools installed and in your path (TextMate > Help > Terminal Usage).
  • as and autocompile must be placed within your path.
  • You must update the wdir variable in the as script to point to the path where the as.template file is stored.
  • Make sure to set the as and autocompile script to be executable : chmod 755
  • The Flex SDK must be installed with the bin directory (that contains mxmlc) added to your path.

I also have the ActionScript 3 and Flex bundles installed within TextMate. I setup my mm.cfg so that it writes trace statements and warnings to the flashlog.txt file, and then I open that file in the Console so I can view runtime debug info (you can also just tail -f the file in terminal). (You can open the console from the ActionScript 3 Bundle in TextMate : Bundles > ActionScript 3 > Debug > Open Flash Log in Console)

Finally, I modify the Run command for the file in TextMate to open the SWF in the standalone debug Flash player (which I have set to be the default handler for the swf file type). In order to do this, I just modified the ActionScript 3 Bundle Run command (CMD-R) to execute:

name=`echo $TM_FILEPATH | cut -d'.' -f1` open $name.swf

 

So, now as I type, I can see the errors as I make them, and can just hit CMD-R to test the SWF and see the runtime debug info in the console.

One additional thing I might do is to modify the autocompile script to play a sound when the compile fails.

Post any questions, suggestions or errors in the comments.

Functions, activation objects and ‘this’ in ActionScript 3

Wed, 10/08/2008 - 12:10

I have been reading through Colin Moock’s Essential ActionScript 3 book, taking my time on each chapter to make sure I get the most out of it. I have been using ActionScript 3 pretty consistently for a couple of years (about a year before it was public), but I have been pleasantly surprised with how much stuff I am learning from reading Moock’s book.

Anyways, I am currently reading Chapter 5 on Functions which among other things covers function scope and closures activation objects (although the book goes into more detail in Chapter 16). This is one of the things that frequently trips up new developers. When creating a function, the function has access to all of the variables within its scope, even if the function is passed to and called within another scope. However, one thing to watch out for is that when using function closures, this always points to the Global object, and not to the object / instance that the function is called within.

For example:

FunctionClosureTest.as

package { import flash.display.Sprite; public class FunctionClosureTest extends Sprite { public function FunctionClosureTest() { var f:Function = function():void { trace(this); } f();//call function trace(this);//trace current scope var k:Foo = new Foo(); k.runFunction(f);//call function in different instance } public override function toString():String { return "FunctionClosureTest"; } } } class Foo { public function runFunction(f:Function):void { f(); } } //rewrite toString for Global object this.toString = function():String { return "Global" }

 

Outputs:

Global FunctionClosureTest Global

However, this doesn’t mean that we cant access the original scope that this points to. We just need to copy that to the local scope in a variable, so it is stored and accessible within the function closure.

Here is the updated example:

FunctionClosureTest.as

package { import flash.display.Sprite; public class FunctionClosureTest extends Sprite { public function FunctionClosureTest() { var scope:Object = this; var f:Function = function():void { trace(scope); } f();//call function trace(this);//trace current scope var k:Foo = new Foo(); k.runFunction(f);//call function in different instance } public override function toString():String { return "FunctionClosureTest"; } } } class Foo { public function runFunction(f:Function):void { f(); } } //rewrite toString for Global object this.toString = function():String { return "Global" }

 

The only change is to store a reference to the current this in a variable, and then access that variable from the function closure activation object.

var scope:Object = this; var f:Function = function():void { trace(scope); }

 

This now outputs:

FunctionClosureTest FunctionClosureTest FunctionClosureTest

By storing the this reference in a local variable, we are able to then access it later from the function closure activation object, regardless of which scope the function is called within.

Flash Camp this weekend in San Francisco

Mon, 10/06/2008 - 14:21

If you are in the San Francisco Bay area (or not too far away), then make sure to check out Flash Camp this weekend, being held in the Adobe San Francisco office by the Flash team.

This is an all weekend event that will go in depth over the new Flash Player 10 and Flash Authoring features. Its a great chance to get up to speed really quickly on all of the new APIs and features, as well as hang out and have a few beers with the Flash team.

Plus, everyone attending will get a Free copy of Flash CS4 Professional!

You can find more information on the Flash Camp blog.

Why Adobe chose FXG over SVG

Tue, 09/30/2008 - 16:25

I am currently on a speaking and press tour in Asia talking about some of the new stuff we are doing in Flex 4. One of the things that people seem to be really excited about is FXG and Thermo, and the improved designer / developer workflow that they promise. However, I have received a couple of questions about why we didnt just choose to use SVG instead of creating a new format.

This is actually addressed in the specification:

When initial work on an XML-based graphics interchange format began, the natural first thought was to use SVG. However, there are key differences between SVG and Flash Player’s graphics capabilities. These include core differences in SVG and Flash’s rendering model with regards to filters, transforms and text. Additionally, the interchange format needed to be able to support future Flash Player features, which would not necessarily map to SVG features. As such, the decision was made to go with a new interchange format, FXG, instead of having a non-standard implementation of SVG. FXG does borrow from SVG whenever possible.

Essentially, SVG didnt map well to the Flash world.

Our initial work around the format actually focused on SVG and Mark Anders has just posted a blog post describing in detail some of the issues that we ran into that led us to finally decide to pursue FXG over SVG.

You can read his post here.

Video overview of new features in Flash CS4

Thu, 09/25/2008 - 15:55

Lee Brimelow has put together a video demonstrating some of the new features of Flash CS4. My favorites thus far include the new UI, inverse kinematics (really cool when applied to shapes), new animation tools and features, and Flex created SWCs working in CS4.

You can view the entire video here.

You can find more information on Flash CS4 here.

ActioScript 3 Vector / Array Performance Comparison

Wed, 09/24/2008 - 16:48

In my original post on the new Flash Player 10 Vector class, I did a simple example that showed Vectors being slightly faster than Array when just populating and looping through collections.

Below is another example that shows a more significant performance increase when using Vectors. In this example, I populate an Array and Vector with 5 million random numbers, and then loop through them and average all of the numbers.

Running the test on my MacBook Pro, the Vector is about 60% faster:

Vector 1.824
Array 2.938
62.08 %

Here is the code:

package { import flash.display.Sprite; import __AS3__.vec.Vector; public class VectorPerformance extends Sprite { private static const LENGTH:int = 5000000; public function VectorPerformance() { //vector performance var vectorStartTime:Number = getTime(); var v:Vector.<Number> = generateVector(); var vAvg:Number = averageVector(v); var vectorTime:Number = (getTime() - vectorStartTime) / 1000; //array performance var arrayStartTime:Number = getTime(); var a:Array = generateArray(); var aAvg:Number = averageArray(a); var arrayTime:Number = (getTime() - arrayStartTime) / 1000; trace("Vector", vectorTime); trace("Array", arrayTime); trace((vectorTime/arrayTime) * 100 + " %"); } private function generateVector():Vector.<Number> { var v:Vector.<Number> = new Vector.<Number>(LENGTH, true); for(var i:int = 0; i < LENGTH; i++) { v[i] = Math.random() * 100000; } return v; } private function averageVector(v:Vector.<Number>):Number { var sum:Number = 0; var len:int = v.length; for(var i:int = 0; i < LENGTH; i++) { sum += v[i]; } return (sum / len); } private function generateArray():Array { var a:Array = new Array(LENGTH); for(var i:int = 0; i < LENGTH; i++) { a[i] = Math.random() * 100000; } return a; } private function averageArray(arr:Array):Number { var sum:Number = 0; var len:int = arr.length; for(var i:int = 0; i < LENGTH; i++) { sum += arr[i]; } return (sum / len); } private function getTime():Number { return (new Date()).getTime(); } } }

Of course, this is only one test. Depending on what you are doing, Vectors may be even faster, or slower.

One interesting note, originally my test had each collection sorted before they were averaged, but it turned out that sorting Vector was slower than sorting the Array. Not sure if this is a bug, but I have reported it to the player team.