I decided to try using a TextLayout component in a SWF loaded into a rather large Flex app that has been in development for some time.. well.. it blowed up.
Main Thread (Suspended: VerifyError: Error #1014: Class flash.text.engine::ContentElement could not be found.)
Here's the weird part...
- The SWF worked fine when viewed directly in the browser (as expected).
- If the SWF was loaded into the Flex app which was launched by "run" or "debug" from FlexBuilder... it broke (as expected, see error above).
- If the SWF was loaded into the Flex app which was viewed directly in the browser ... it broke (as expected, see error above).
- If the SWF was loaded into the Flex app which was launched by "Profile" from FlexBuilder.... it worked (aaahhhh?)
That last one threw me for a loop because the problem was the Flex project was set to compile for Flash Player 9 and the SWF being loaded in with the TextLayout is dependent on some Flash Player 10 tricks. So why then did it work when I did a "Profile" from FB? .. somewhere there must be a setting or some documentation for this (the profile feature probably relies on something FP10 specific) but I'm not looking for it since I'm beyond the issue now.
Anyway, the solution of course was just to set the Flex project to compile for Flash Player 10...
Here’s what it looks like when I click on symbols in the library in CS4..

Those could be symbols of cars, monkeys, baseballs.. it doesn’t matter. I get horizontal lines.
It’s been this way for a while and I’ve just been avoiding the inevitable reinstall and kind of enjoying the little bit of chaos that this brings into my workspace. It’s time for it to end though. I need to see what I’m about to drag out onto the stage instead of it being a surprise. heh. My library is a box of chocolates.. I never know what I’m going to get until I drag it to the stage.
I'm on Seabrook Island and went for a walk on the beach just after sunset last night. It's a very secluded beach, so there were only a handful of people in the mile or so that I could see up and down the beach. On the return there was a nice surprise in seeing lots of little baby turtles running across the beach to the ocean.
I'd seen this on TV before, but seeing it in person was a real treat.. and damn they move fast. All the ones I saw made it safely to the ocean, but after that?? Who knows.
I'm converting some things over from AS2 to AS3 and hitting some walls. One of the things I'm having trouble with is implementing a runtime shared library in AS3. According to everything I've looked at I have everything set up right, but it jsut doesn't work. I've used shared libraries for many years so it's not a new concept to me, and I've always been able to get the right voodoo mix going to make them work well, but this time it's just not happening.
Here's what I'm doing and what's not working... I've got everything set up as in the old AS2 days with a "library" SWF with all the clips that I want to reuse in there set to export for runtime sharing. I've got SWFs that contain those clips and have them set to import from the shared library. So far so good. All works just fine as long as they're movieclips.
Now..... if I make a component and put it into the shared library and set it to export for runtime sharing things get interesting. If my other SWFs don't have that component set to import from the shared library then the class code for the component in the shared library will replace what is used in the other SWFs and the components will show up. BUT... if the other SWFs have that component set to import from the shared library then the component doesn't show up AT ALL. It's in the shared library but it isn't loaded or displayed by the other SWFs.
I've tried having a "main" SWF that first loads the shared library SWF and then loads each of the other SWFs and have it set the ApplicationDomain.currentDomain for all of them to the same. No help there.
Back in the AS2 days the point of a shared library was to reduce the file size of all the SWFs that use the library. If you had a few dozen or few hundred SWFs that all used the same components and those components were all in the shared library then you were saving the user from downloading those components hundreds of times.. a side benefit was that you could change the code in the component in the shared library and it would be a global change across all of the hundreds of SWFs that used that shared library. It seems that with AS3 I can get the components to use the class code from the shared library (so I can make global code changes), but only if they're fully exported in each of the SWFs (so there's no reduction in file size).
The turtles run fast to the sea, but they don't know what they face.
(update below...)
I should have been more specific with the post above (hey, I was on vacation at the beach.. cut me some slack.. ). The wall I hit was with CS3, and I still haven't gotten beyond it. This might sound odd to some, but not everybody has CS4.. so you sometimes have to develop for the least common denominator.
Now, if you're hitting this issue and have access to CS4.. you have some hope. You can specify an "External Library Path" to a SWC file either in the global Preferences, or in the Publish Settings for each FLA. Jesse has some info on setting up that SWC. After doing that the components show up just fine.
Maybe the least common denominator needs to upgrade to CS4..
Oh, and using "Automatically declare stage instances" really mucks things up.
The US space shuttle program is winding down, and being a great procrastinator I’ve waited until the last remaining launches to finally go see one. So I picked STS-127 to try to view a launch. The first scheduled launch was just before dawn (so little chance of weather mucking things up), and all that good stuff. Well, a hydrogen leak ended the first two launch attempts. This past weekend we made the long trek (about 8hr drive) to Cape Canaveral again to watch it launch. (it didn’t.. after two more attempts).
I had a lot of work to do so I spent Friday afternoon working away on Flash coding in the back of a big Yukon. Since the shuttle didn’t launch Saturday and it didn’t scrub until the last minutes of the countdown on Sunday I also spent much of Sunday night and Monday morning pecking away on my laptop as we hurtled along I-95. My laptop is decent for doing coding work.. but not when it’s shaking all over the place.
When I got back today and transferred what I was working on over to my “workstation” and opened it up in Flex I laughed. The code was just sitting there so still and I could see so much of it. I have a 24” monitor turned vertically and set to 1200x1920, and a 19” monitor on either side of it, so I see over 100 lines of code at once. I was SO happy to be home, especially since this afternoon the fifth launch attempt was scrubbed too. If it doesn’t launch this Wednesday it’ll break a record for the number of scrubbed launch attempts.
it’s all about persistence
