Tutorials, extensions, and source files for ActionScript, Flash, and other Adobe products.

 

AS3: Where are function variables declared?

Posted October 20, 2008 by senocular

At the top! Yes, well, maybe you *put* them closer to the bottom, but Flash still declares them at the top of the function. Confused? Lets take a look at some examples.

Flash CS4: Animation Workflow Warning

Posted October 17, 2008 by senocular

This is something I had meant to post for a while now, but didn't, and after FlashCamp this past weekend, I regret having waited since I know a lot of people had problems with this...

I don't know about you (and I know a lot of people are different), but every time I create a motion tween in Flash, I have a specific workflow. That workflow is, creating a symbol, adding a keyframe in the timeline at the end point of the tween (using F6), modifying the symbol at that location, then right-clicking in the generated span and selection "Create Motion Tween". Tah-dah! a motion tween! Of course now, whenever I do that in CS4, the end result is a stagnant timeline that screams "You fail at life!"

Flash Player 10 Spinning Earth Redeux

Posted October 17, 2008 by senocular

I've slightly reworked the spinning earth (globe) example in the FlashCamp samples, dropping the custom 3D transformation function in favor of using new native APIs including Matrix3D, PerspectiveProjection, and the oh-so-important Utils3D.projectVectors. In turn, the code should be a little easier to read with less going on (the new APIs handling much of the work).

From Fireworks to Flash Player 10 IGraphicsData

Posted October 16, 2008 by senocular

During FlashCamp over the weekend, I mentioned that for one of my examples I managed to get path data out of Fireworks with a simple script. I have now posted that script online.

There isn't any interface for using it at this stage - it just reads the points and dumps them to Fireworks' JavaScript's standard out (which usually goes nowhere). But you can easily get the desired results by running it in the command prompt panel (in Tutorials and sample files).

Nice use of SWFReader: swfversion.com

Posted October 15, 2008 by senocular

Just caught wind of a site that allows you to check the SWF version (among other things) of a SWF online or from your desktop using the SWFReader class. It's called http://swfversion.com/ and even allows you to specify which SWF you want to check via URL; example: http://swfversion.com/?u=http://senocular.com/flash/files/bubblegrid.swf

Ahhh... those good ole days where we dealt with the 21/31 fps Mac bug.

Flash Player 10 Final now Public

Posted October 15, 2008 by senocular

If you've been keeping yourself up to date with news and blogs, you probably already know this by now, but it is my obligation to make sure you know it again. Flash Player 10 is here!

Along with all the fancy new features, Flash Player 10 also sports some improved stability and boatload of bug fixes. Get your copy today.

FlashCamp: Enhanced Drawing API

Posted October 13, 2008 by senocular

First I want to say I had a blast at FlashCamp. Despite it lasting all weekend, there still wasn't enough time. A special thanks goes out to Dom for organizing the event as well as to all of those who participated in the hackathon contest. It truly was a chore to have to pick a winner. Congratulations to those who won, and a job well done to everyone else.

In case anyone missed it (either FlashCamp, or my presentation), I have all my "Enhanced Drawing API" files available on http://typeof.info/flashcampdapi/. This includes the presentation itself (pptx and pdf formats) as well as all of the source files for the demos.

Flash CS4: The Overhead of 3D

Posted October 06, 2008 by senocular

Its no secret that Flash Player 10 now supports "3D Effects" - a new feature allowing developers manipulate display objects in a 3D coordinate space. The Flash CS4 authoring tool allows you to apply these effects to display objects on the stage and animate them over time using the timeline. If you do this, however, you may notice a dramatic jump in file size for your SWF. As soon as you make anything 3D, you've instantly added at least 13K to your published SWF. But why?

AS3: SWFReader Class

Posted October 03, 2008 by senocular

I originally made this class to get information from a SWF such as stage size (as defined by the authoring tool) and background color which are not available through ActionScript APIs, but I have extended it to include other information - basically everything in the SWF header, XMP metadata, and information from SWF tags specific to certain options such as local playback security, script timeout limit, and even the hardware acceleration mode for Flash Player 10 SWFs.

AS3: Layout classes update

Posted October 02, 2008 by senocular

I've just posted updated Layout classes. The primary change includes a fix taking care of an ambiguous error when used with newer compilers, notably CS4/Flash Player 10. There have been some other updates as well such as a new maintainAspectRatioPolicy property that determines how constrained scaling is applied to objects whose aspect ratio is being retained. The 4 options are favorWidth, favorHeight, favorLargest, and favorSmallest - each of which have respective constants in the LayoutConstraint class.