PDA

View Full Version : Component domain...I don't get it...


joshstrike
04-29-2008, 10:17 AM
Hey all, quick one here...

I generally use two .swf files for my sites, let's call them Initialize and Core. Initialize just reads external vars and runs a loads Core, then runs an init function on it (so users just get a blank instance if they load Core without loading Initialize).

Easy. And when I'm running things from Core, my root is Core, that's the application domain, and everything's cool. If Core has an item in the library called Something that's exported for AS, then I can call new Something() without a problem.

The only time this doesn't work is for components. For some reason beyond my understanding, the components that are run are the ones that are in the Initialize library, and they have to be there. This sucks, because the components use up something like 100k that there's no reason I'd want to spend time loading before Initialize launches.

I'm not placing anything on the stage, I'm just saying, new ScrollPane() or whatever. How can a new ScrollPane be drawn from the Initialize library, even if ScrollPane is in the Core library as well, when a new Something is drawn from the Core library, even if it's in the Initialize library? Something doesn't add up...

Thanks for any help,
Josh

joshstrike
04-29-2008, 10:47 AM
Also, what the HELL is so special about ComponentShim that it won't copy over when you bring the Component Assets folder from one library to another?@! This only crops up because for some damn reason, my DataGrid in the Initialize.swf just decided to stop working; null reference in BaseScrollPane. Anger and frustration.

joshstrike
04-30-2008, 12:59 AM
Really? Nobody knows the answer to this question?

joshstrike
04-30-2008, 08:27 AM
This is still killing me. The problem is exacerbated by the fact that I can't extend DataGrid in a class instantiated by the loaded .swf. Throws an error from somewhere deep in BaseScrollPane. Even though both libraries match. Something bad in ComponentShim I think, but then there's no way to tell because no one ever documented what that little magic bullet does. Contains references to component classes? What else? Arg!