Lanny McNie

As the dev mgr, Lanny oversees the technical day-to-day details of production and makes sure things get out the door.

@astrostyle

Extension Melee (Part 3)

Looking over all our extensions, it is clear that the #1 thing we automate is quick access to files. gProject was initially created to give us a quick-open file listing. OpenBoundClasses and FindInLibrary also find us symbols and classes with a keystroke. Even gSearch helps us find the files or symbols we are looking for.

To round off the “Quick-Open” extensions (part 1, part 2), here are two small commands that give us two more ways to open and find files.

IV. QuickOpen

The QuickOpen panel is a proxy to your recent files. Apparently we thought click “File > Open Recent” menu wasn’t enough, so we created a popup list that you can bind to a keyboard shortcut. QuickOpen is an easy access, keyboard-accessible shortcut to the recent files. Unfortunately flash will not give focus to XUL dialogs on the Mac, so you have to click it in order to use your keyboard. Works great on PC though.

Download this extension

V. QuickOpenImport

Despite the similar name, QuickOpenImport is completely different. Often, when working on a class file (or FLA), we come across a class that we would like to open, but are unsure where it is. This extension pops up a dialog with a TextInput, and opens the class path you enter.

Download this extension

QuickOpenImport requires that you have your classes in a normal class path, since flash 7 and 8 will not tell us where it looks when compiling. Supported paths are relative to your FLA (“./”), “./classes”, “../classes”, and the flash classes directory (for components, etc). You can add paths by manually editing the JSFL, which is located in the configuration directory in the Commands folder.

That’s it for today. Look forward to more extension goodness next week!

Extension Melee (Part 2)

To continue the extension goodness (see part 1), here is another handy extension that’s sure to boost your productivity.

Find In Library

One of the most common workflows when working in FLAs is the need to find the library item for a symbol on the stage. Simply select a symbol on stage, and run the Find in Library command, and the appropriate library symbol is selected. This command is most useful when bound to a keyboard shortcut, such as CTRL-E.

Download the FindInLibrary Extension

To add an extra bit of functionality, install the OpenBoundClasses extension as well: if a class is bound to the symbol, it will automatically open when you run the FindInLibrary command.

You must have your library open for this extension to work. Additionally, Flash will not scroll the library to the selected symbol.

If you’re looking for an opposite workflow, finding stage instances with a specific symbol or linkage, I recommend checking out gSearch, part of our first Panel Pack, which includes a powerful Timeline search tool.

We got Dugg.

Puki 3D made the front page of Digg…. cool! I think this is our first front page Digging, and I somehow missed it (it hit the front page 2 days ago). 50,000 visitors in one day, and as far as I can tell the server stayed up – kudos to Media Temple! Here’s a link to the Digg topic.

While I’m blogging about Puki, here’s a trick: Type “oldskool” before you start a game (make sure you’ve clicked to focus the game first), and you’ll get classic arcade graphics.

One day I’d like to revisit this game. Maybe with Papervision3D.

Extension Melee (Part 1)

Since the advent of Flash MX 2004 and JSFL, we have invested a great deal of time into JSFL extensions, panels, and other time-saving utilities for use on internal projects. Some of them have evolved into products, such as gProject and Panel Pack 1, but very few have been released for public use. A couple months ago we updated our products site with selected extensions, classes and components intended for sharing with the community, but between client work and foosball, they never were given the final QA pass to be released.

Over the next few weeks, we hope to finally publish the extensions to our site, and invite anyone interested to download, share, and comment on them. None of them are as fancy as gProject, but all of them have saved us a ton of time.

I. GraphicButton

To kick off the extension exodus, we have made available one of our classes found in almost every AS2 project we have delivered. The GraphicButton class is a simple MovieClip extension that adds

  1. AS2 EventDispatcher, and events for click, over, down
  2. Frame-based state management: Add “up”, “over”, “down”, “disabled” frames to your timeline to easily create states, and the class does the rest.

Download the GraphicButton class

II. CreateGraphicButton

To supplement the GraphicButton class is a JSFL script that turns any MovieClip into a GraphicButton. Simply select a MovieClip in your library and run the script, and the necessary layers, frames, and stop actions are added to the symbol’s timeline. The class is then bound to the GraphicButton class, and the class file copied relative to your project.

Download the CreateGraphicButton MXP

Flex Loves Flash? Embed and Beyond.

Last week I had the pleasure of speaking at the 360Flex conference at EBay’s North Campus in San Jose. My presentation was titled “Flex Loves Flash? Embed and Beyond.”, where I explored the different methods available to Flex developers to work with rich assets. I started by covering existing approaches like asset embed, and Flash symbol embed, and discussed strategies for organizing those assets. From there I looked at more advanced techniques for using Flash content, like “shake and bake SWFs” (embedding a SWF as a bytearray, then extracting full classes from it), and using classes/symbols from SWFs that are loaded at runtime. I finished off by looking at new integration techniques that will work with Flash CS3, and some of the approaches I am working with Adobe to develop that will help simplify this integration. I also touched on some related topics like font / svg embed issues, data embedding, and how to use bitmap fonts in Flex.

You can check out the session notes at gskinner.com/talks/.

Over the next few days I will release some of the code I showed, and blog about a couple of the more important topics, like Shake and Bake swfs. You’ll have to wait for some of the more advanced pieces until after Flash CS3 ships though.

Above all, I want to get people thinking about this topic. Flex applications are so much cooler when Flash is involved in the workflow. If you have any tips or ideas on enhancing this workflow, please feel free to leave them in the comments.

The Coolest Flash 3D Demo Ever!

Last week, I was hunting around for a compelling speed comparison demo that I could use to show how much faster AS3 execution was than AS2 for the MacWorld Flash Forward keynote. I wanted something exciting and very visual that ran in both AS2 and AS3. Remembering that the awesome open source Paper vision 3D project by Carlos Ulloa and John Grden had recently been updated to AS3, I pinged John to see whether he could put together a cool demo in the meager 4 days I had before the session. Let me tell you… the man came through with gusto! Not only did he throw together an amazing demo contrasting AS2 rendering 900 faces at 5fps versus AS3 rendering almost 8000 faces at 25fps, but he did it in only two days, while doing normal work and accommodating all of my anal retentive requests (admit it John, those requests were the cilantro in your salsa *grin*).

The demo totally blew away the audience at MacWorld. Not only is it an amazing speed demo, but it’s the coolest piece of 3D I have seen to date in Flash. 7 x-wing fighters, 7 tie fighters, 1 death star, and Endor all flying around a star field with a chase-plane style camera.

If you want to see a stunning example of AS3’s speed gains, or just want to check out where 3d in Flash is headed, you should click over to John’s blog. Then, head over the OSFlash page for the Papervision3D project for more great demos and info.

(btw – the demo runs beautifully in full screen mode on a MacBook – as John says, Flash doesn’t look like Flash anymore)

Flash opens the wrong panel: An automated fix

Since we released gProject, we receive about 2 emails each month reporting that opening the panel causes a different panel to open. This can cause duplicate panels, or panels that NEVER open. This is a flash issue, which has been widely reported. The solution is simple, although a little hard to explain, especially to people who have no idea where the flash configuration folder is.

Internally, we use a nifty little extension that automatically fixes the issue for you, for whatever version of flash you run it in.

For anyone who doesn’t know, flash indexes the panels in an XML file located in a file called panelset.xml in your flash configuration directory. Adding panels sometimes messes up those indices, but deleting the file will fix the issue. It will also remove your saved workspaces, but I think its worth it.

Our JSFL file toasts the xml file, and automatically restarts flash. The extension is by no means complex or ingenious. It is handy however. I hope someone out there finds this useful. If not, at least I can point people to this blog entry in the future.

Please note that this may delete your saved workspaces!

Download the file here