Flash

Flash Error 5003 & 5005

Tuesday, August 18th, 2009

“5003: Unknown error generating bye code.”

“5005: Unknown error optimizing byte code”

You may find yourself receiving either of the above errors when working –in the Flash IDE– with FLA files that make use of large amounts of code. These two errors both stem from the same problem; Flash not handling an “Out Of Memory” error exception from Java (from the asc_authoring.jar file). This error will be apparent if compiling using the Flex SDK.

There are several possible solutions you can try to get around this error. Firstly, check that the Flash Optimiser in the Publish Settings dialog box is disabled (select Publish Settings and disable the “Reduce file size and increase performance” option under Script Settings), and recompile. In any other case where you are not getting a 5003 or 5005 error this option should be left enabled.

Another solution you can try, if disabling the Optimiser does not resolve the issue, is to delete the ASO files and recompile (Control -> Delete ASO Files and Test Movie).

Depending on the size of your project it is possible that these two solutions do not resolve the issue. If it is not possible to compile the project using the Flex SDK (which allows you to easily set the Java VM heap memory) you will need to set an environment variable on your system to increase the Java VM heap memory size. How you do this will depend on your system:

Windows:
Right click on My Computer -> Properties -> Advanced -> Environment Vars
Make a new var like this:

JAVA_TOOL_OPTIONS

and its value

-Xmx256M


Mac OS X:
Create the directory and file (if not already there) ‘Users/{your user}/.MacOSX/environment.plist’
Note: The folder will be hidden in finder unless you enabled the view of hidden folders.
The Easiest way to create/edit this file is by using RCEnvironment, which will handle the creation and management of the file for you.

Enter variable JAVA_TOOL_OPTIONS

and its value -Xmx256M

Now Logout/restart.

In our tests we were able to successfully compile with values of -Xmx128M and -Xmx256M. A value of -Xmx512M and higher gave the error “Error initializing JRE. You may need to reinstall Flash”. Your mileage may vary based upon your machine specifications, if you find yourself receiving this error simply reduce the amount of memory allocated to the Java VM heap and restart again. After following the above steps you should be able to compile your project once again with the Optimiser enabled.

N.B. YOU CANNOT RUN FLASH FROM SPOTLIGHT OR OTHER LAUNCHERS
For some reason, Spotlight ignores the environment.plist options. An issue has been logged with Apple regarding this, in the meantime be careful when launching Flash from Spotlight or other application launchers.

Migrate from AS2 to AS3

Tuesday, July 21st, 2009

These are a few links for those who haven’t migrated from AS2 to AS3 yet. Feel free to edit it and expand it as much as you want.

Adobe’s guide. Use it only when you think “where the hell is this AS2 stuff I’ve always used“
http://livedocs.adobe.com/flex/2/langref/migration.html

This is a pdf to boost your morale and see how as3 is not that different from as2.
http://www.adobe.com/devnet/actionscript/articles/as3_migration_cookbook/as3_migration_cookbook.pdf
(PDF)

A tutorial to get started on the basics of AS3 (using FlashCS3):
http://www.senocular.com/flash/tutorials/as3withflashcs3/

Grant’s skinner workshop. A little bit more detailed/difficult than previous links.
http://gskinner.com/talks/as3workshop/

Worth a look through is also Kirupa’s ‘Tip of the day’, good to search through when you come up against problems with AS3:
http://www.kirupa.com/forum/showthread.php?t=223798

I hope that’s enough to start.

For almost anything else you also have:
http://www.kirupa.com/developer/flash/index.htm#ActionScript_Basics

And of course, you can ask us anything you need.
:]

Connect Flash to Drupal

Monday, July 13th, 2009

It’s now possible to connect Drupal to Flash, via a simple AMFPHP and Services module. This allows your Flash application to connect to Drupal and query things like users, pages, menus, etc. This is all performed through a unique sessionID and Drupal installations on different servers can also be queried (keys/permitted domains).

This link provides an overview on what to do.

Flash & Flex Developers Magazine

Friday, July 10th, 2009

We’ve a subscription to the Flash & Flex Developers Magazine that will be delivered to us in PDF format every other month. We have a two year subscription. More details can be seen on their website.

The PDF files will be stored on the server at: \\data\Allofus\Technology\Flash & Flex Developers Magazine

Gaia framework for Flash

Thursday, July 9th, 2009

Gaia is an open-source front-end Flash Framework for AS3 and AS2 designed to dramatically reduce development time.

Using the scaffolding engine in Gaia, you can build a fully-functional Flash site in a few minutes without having to code up any Actionscript. Using techniques borrowed from Ruby, Python and SmallTalk, you code “by exception” – so the standard bits of projects are auto-created for you.

GAIA Framework for Flash

Gaia is packed with features and provides a simple way to do all the things you do on every Flash site including:

  • Navigation
  • Transitions
  • Preloading
  • Asset Management
  • Dynamic Font Loading

Gaia has built-in deeplinking with SWFAddress, and is fully integrated with SWFObject so you don’t have to write any HTML, CSS or Javascript. Gaia also uses SWFWheel which gives you full mouse scroll wheel support on all platforms and browsers.

Gaia is established and used on world-class websites for Clients such as Mercedes, Gillette, Honda and ElectronicArts.

Most Flash frameworks are back-end frameworks; Gaia is a front-end framework, meaning that novices can get to use its power very quickly and seasoned developers don’t feel limited by the framework.