The other Andrew Hunt

Another Flash Blog!

Archive for the ‘AS3 Development’ Category

Geting line numbers for runtime exceptions in Flash Player

without comments

This is a simple technique I learned from co-worker Miguel Cordones that was a surprise to me, but obvious one I knew it. I did a quick survey and a surprising number of the other developers didn’t know it either:

When you publish your SWF turn debugging on!

With this option turned on, you will get some very useful information: the line number of all runtime exceptions.

Turning on the debug option

Flash IDE: Publish Settings->Flash Tab->Permit debugging

MXMLC: set option debug =”true”

Of course, when you’re ready to do a release build, turn off the debug option! Using the debug option adds a bunch of debugging junk to your files, makes them substantially bigger and affects performance.

Written by admin

October 30th, 2009 at 7:51 am

Posted in AS3 Development

The Dreaded VerifyError #1014 Message!

without comments

I’ve been working on a project with many SWF files.

To keep file size down, I’ve been using the “load-externs” option with mxmlc to exlude classes during compilation of SWFs that are loaded later in the application. This was working fine, and I could see that the classes were indeed being excluded.

On IE6/IE7 (of course!), I would consistently get the VerifyError saying that a certain class was not defined. On Firefox this worked flawlessly. If I cleared cache on the IE browsers, the file load was fine. If I reloaded the page without clearing the cache, I would consistently get the VerifyError.

We tracked this problem down to file load order, which is obvious in retrospect.

I use the handy Bulkloader class to load the SWFs and other assets. This class is supposed to load the files in the order specified. For some reason, the order was not consistent on IE browsers.

Solution: use the priority option in Bulkloader to make sure your library SWFs are loaded first.

If you’re seeing the VerifyError #1014 and excluding classes in your compile, its most likely a similar issue. Check that your files are being loaded in the order you expect!

Written by admin

August 19th, 2009 at 7:11 am

Posted in AS3 Development

Tagged with

Excluding Classes with CS4 IDE, is it possible?

with one comment

I had some mysterious trouble with my MXMLC-generated SWFs and my attempts to exclude files. I thought it might be productive to try to exclude classes by compiling in the IDE.

In the ActionScript 3.0 settings for my FLA, I set a path to the correct SWC in the “External LIbrary Path” window.

The final SWF, however, did not exclude these classes at all.

Does anybody know if this feature actually works? Do I have to do something else to get this to work properly?

It would be a great feature if I could get it to work!

OK, back to using the mxmlc compiler I guess.

Written by admin

August 19th, 2009 at 6:44 am

Posted in AS3 Development

Tagged with

Introduction to Augmented Reality

with 3 comments

Here are links for everything we (me & Itai Asseo, also of Digitas) presented last night for flashcodersny, in the glamorous downstairs basement of Think Coffee.

Big thanks to Itai for co-presenting, to Lisa Larson-Kelley for setting everything up, my lovely wife Fanny for joining us, and for all who endured the stuffy heat of the basement last night.

Theory

Augmented Reality Wiki Page

A big AR Conference, in Orlando of course

Historical Examples

From that movie, what’s it called again?

Hitchhiking ghosts

How Ubiquitous is AR?

Gratuitous Celebrity Politicians Demoing AR (seemingly unaware that they are doing so)

NYTimes article from 03/09 on Topps baseball cards

Another video of the Topps baseball cards

The Underlying Technology

The Original AR ToolKit

Many ports of AR ToolKit to other languages

FLARToolKit, the Flash port of AR ToolKit. Almost Everything you see on the web uses this!

A very good diagram of the AR rendering process that I forgot to show last night.

Interactive Demos, you need a webcam and a printer for these

The Katamari Damacy themed 09 NY demo that got everyone excited

Who wants to hold the baby? (fun Boffswana animated critter)

GE Smart Grid Demos

Toyota iqReality Car Demos (downloadable demo)

FLAR Drums (from the prolific folks at squidder.com)

A Funky Brazilian Santa, really.

German Cabriolet demo that doesn’t seem to work, but show nice usage/execution in the video.

Videos

Fiducial markers on T-shirts, squidder again

Lots more AR with cars

Little driving car demo, uses marker in interesting manner, squidder again!

AR Tutorials Galore, most modern first

squidder.com: A bunch of great stuff! These guys seem to be posting stuff every day, keep an eye on them!

Great getting started series of tutorials, from Mikko Haapoja

The original tutorial set, haven’t tried it yet, saqoosha.net

Making Custom Fiducial Markers

squidder.com, again

saqoosha.net again: The AIR app for generating markers (this worked well for us)

Source Code Samples You Can Download and Play With!

Source for the amazing 09 New Year’s demo, good luck getting it to compile!

Boffswana animated critter demo code (this is what we started with)

Squidder.com’s demo of using multiple markers (very easy to compile and set up)

Eric Socolofsky’s very new FLARManager. This sounds awesome, but requires either CS4 or Flex Builder set up to target FP10, so have not been able to play with it yet. (Here are 2 links for how to set up FB3 to target FP10, here and here)

Wait, update: Eric has released a new version of his FLARManager for FP9! See his comment below of follow the link for more info. Thanks, Eric!

Just in right now! Itai sent this to me and it looks very promising, another AR demo with sourcecode.

Augmented Reality Blogs Worth Following

The original and very worthy Augmented Reality Blog

Squidder.com, putting out awesome AR demos apparently every 30 minutes.

A More game-oriented AR blog

Where it all began, saqoosha.net

Special Bonus Links, Check Out the Amazing Libspark library!

Lots of great stuff here, including the Marilena Object Recognition AS3 library that people are using for Flash face recognition.

I’m adding stuff to my delicious links all the time as they come in. You can see my up to date AR links at: http://delicious.com/shinyamos/ar

Written by admin

March 12th, 2009 at 2:26 pm

Using ANT in your Flash Development and Be a Better Person! Part 1

with 2 comments

OK, long time coming, but here we go. There’s too much material for one blog post, so I’m going to break it down over a few blog entries. This series is based on a talk that I gave to the fabulous flashcodersny group, on Aug 13 2008.

ANT is a fantastic tool for automating your Flash development workflow. ANT allows you to write powerful tasks to do just about anything you could desire: compiling Flash (AS2 or AS3), file system operations, ftp’ing files, setting version numbers, generate code documentation, play annoying sounds, etc.

I’ve been hearing about ANT for a while, but only came to adopting it after some frustration with the Flex Builder workflow. At my shop, we have Flash developers who use FDT and, more recently, Flex Builder. We like to check the final SWF into SVN when we have a release build. This allows us to just export a copy of our build files and push them to the server when we want to deploy. Works well enough, and it means that I don’t have to be present for weekend pushes!

I’ve heard compelling arguments about why putting SWFs into version control is a bad idea, but it’s really very convenient, and you don’t need a developer with the fully configured environment for deployments. Anybody who knows how to use the version control system can perform a deploy.

But, Flex Builder will not let you work this way! The default workflow creates a bin-debug folder where your compiled SWFs end up. You cannot check this directory into SVN. I understand their rationale for this, but it’s annoying, and has tripped up a lot of developers. And you can’t customize the workflow too much with Flex Builder, you have to do it their way. Also, the default version that Flex Builder compiles is a debug version, not a release version, so you would not want to check it in anyway. Also, I wanted our developers to be able to use FDT, Flash, or Flex Builder as they wished, on the same project, and the Flex Builder workflow made this difficult.

So, I turned to ANT to get around these issues, which I was able to work out. But, then I realized how much more I could get from ANT, and I find I’m using it more and more with every project, and it’s especially made my life much easier with complicated deployments (4 different server environments requiring different configurations). I’m using ANT on every project now and it’s become widely adopted in my department.

The solution to a unified workflow was to adopt ANT tasks for all Flash compilation. We compile projects the same way whether we’re using FDT, Flex Builder, or Flash. You can execute all of these tasks from within Eclipse, or from the command line if that’s how you roll. The entry on compiling Flash (AS2 or AS3) is part 4 of this series.

Part 2 will introduce basic ANT functionality and the files for my sample project.

Useful Links

You can get the full story on ANT here.

I found these 2 posts very useful for getting set up with ANT in Eclipse/Flex Builder:

Jody Brewster’s Installing Ant in Flex Builder 3

Ryan Taylor’s article on using ANT with FDT3

Written by admin

July 21st, 2008 at 6:26 pm

Posted in AS3 Development

Tagged with , , , , ,