Silly problem in Flash CS5 / Flash Builder workflow
After a really long time without running Flash CS5, today I decided to do so in order to generate some graphic assets for a game I’m planning to develop. I do all my ActionScript code with Flash Builder 4.5, so I decided to follow the nice instructions found in this article by Big SpaceShip.The article is rather old, but still I’ve found this workflow pretty useful in the past, so decided to give it a go.
Basically, what you do is set up a Flash Builder project with all your code base on one side, and a Flash (*.fla) file containing all graphic stuff (MovieClips) in the other. Some simple code in the *.fla file allows compiling from there (nice if you want to test things straight away ) while still being able to compile from Flash Builder as well (which is what you’ll probably want to do more often than not, given its far superior debugging/coding capabilities).
The mentioned article is easy to follow, and going through the instructions step by step will get you a running draft in few minutes. However, chances are that after compiling and running the project in Flash Builder you get an error like this:
ReferenceError: Error #1069:
Property assets_container not found on Test3_fla.MainTimeline__Preloader__ and there is no default value.
When I got this in the console panel, first thing I thought was: WTF? “__Preloader__”? Did I put anything remotely similar to that in my *.fla file? Of course, I searched for that both in the timeline and library; double checked that the fla’s main timeline actually contained an instance named “assets_container”, that the swf had been recently published, and so on. After a few minutes trying to find what was going on, Google got me this answer from Adobe’s support pages:
When loading child SWFs that contain Text Layout Framework (TLF) content into a parent SWF, you receive reference errors due to the preloading methods used by TLF.
I had no idea I was using the TLF thingie at all, but indeed I had some textfields around, so looked like this could help me solve the problem. However, the suggested solutions in that article are:
- Complicated procedure involving specific asset linkage method, preloading frames, and other devils
- Using a custom Loader class (available attached to the article)
Maybe these are really the only options for certain project configurations. In my case, though, having a really simple Flash file with a few MovieClips here and there, I could solve it just by publishing the swf again, this time as a Flash 9 movie:
File -> Publish Settings -> Flash -> Player: Flash Player 9 (instead of Flash Player 10, which is what you’ll probably have by default)