But these classes are unknown to the library swf, where the symbols are plain MovieClips. I was hoping there would be a way to associate each of them on run-time load with a class in my AS3 project, just as the Embed directive does at compile time. If I understand you, that's not possible, and I need to go through the following steps: 1. remove the classes from the class path of the AS3 project (the top-level domain) 2. take out the Embed directives 3. add the classes to the Flash9 class path 4. change the linkage properties of each symbol (by making the Base class property refer to those classes?) 5. Add framework.swc to my AS3 project's library path to make mx.controls.SWFLoader available to it (or will Loader do?) And then I can use SWFLoader and the ApplicationDomain as you suggest.
Is that right? Thanks again. -A On Tue, Feb 26, 2008 at 11:30 PM, Alex Harui <[EMAIL PROTECTED]> wrote: > If you're using Flash CS3 and publish for player 9, then you can simply > use SWFLoader to load the SWF and then make instances of the classes. You > should use a LoaderContext(false, ApplicationDomain.currentDomain) to get > the classes into the top-level application domain > > > ------------------------------ > > *From:* [email protected] [mailto:[EMAIL PROTECTED] *On > Behalf Of *Alan Shaw > *Sent:* Tuesday, February 26, 2008 5:17 PM > *To:* [email protected] > *Subject:* [flexcoders] Run-time loading of library symbols as custom > class instances: How? > > > > I'm working on a pure AS3 project in FlexBuilder 3. All graphical assets > are provided as symbols (with no AS code) in a library swf, exported as this > example: symbol Name: cloud01, Class: cloud01, Base class: > flash.display.MovieClip. The corresponding class looks like this: > > package com.my.package > { > [Embed(source="/path/to/library.swf", symbol="cloud01")] > public class Cloud01 extends Cloud > { > public function Cloud01() > { > super(); > } > > } > } > > Most of these ultimately derive from a custom Animation class whose API > allows various manipulations of the playhead. > > Since the assets are all embedded, trying out new versions of the > animations requires recompilation. It is desirable to get around that > requirement so the animators themselves, not programmers, can make a new > library swf using the Flash IDE and see the effects. I haven't found > anything that works yet, although there have been hints in the big fat Moock > book (p.795) and in Grant Skinner's blog that it is possible to load these > assets at run time and have them come in as instances of the desired types. > > Any help? > > Thanks, > -A > > >

