Custom Component Class Export

Posted this on Flashcoders, no solution yet.

I have a component that I created, not based on UIComponent. Class is com.bit101.controls.Button.

I export the swc and give it to someone else who does not have my classes. It works fine. They can even use data typing with it, and import my Button class, as long as it is set to export first frame.

If they turn off export first frame, even if there is an instance of the clip on stage, the classes aren’t available to the compiler for importing or checking. The component continues to work just fine. It can see its own classes.

I’ve messed around with export frames for classes, preloading schemes, just about everything else I can think of. It seems that if I distribute a component without the source code, the user must export it first frame to access data typing on its classes.

I may have to resort to creating an intrinsic class file and distributing that with the component, but the thing that bugs me is that it works if it’s first frame export, meaning that the class data is there in the swc and available to the fla. I feel there has to be a way to access it at some point even if it’s not expoted first frame.

Any ideas?

This entry was posted in Flash. Bookmark the permalink.

3 Responses to Custom Component Class Export

  1. Will says:

    I posted a similar problem on FlashCoders. The problem is with some compiled MM classes like DataSet. Where everything works fine when exported on Frame 1 but if one were to export in another frame then the classes are not accessible. There is no source code supplied with these components and I have yet to find a solution.. Let me know what you find out!

  2. Samuel Neff says:

    I think I’ve run into this problem before but didn’t identify it as related to the export in first frame checkbox. I ended up distributing ASI’s.

    If you don’t find another solution and need to create ASI’s, BLDoc can generate ASI files from your component source automatically. Thought you might be interested.

    http://www.blinex.com/products/bldoc

    (does this count as blog spam? It’s advertising.. but it’s also directly on point.. I hope it’s not blog spam, I could never live with myself..)

  3. Keith Peters says:

    haha. I don’t know if it’s blog spam or not, but I’m already a long time bldoc user, and that’s probably what I’ll use to solve the problem, so it’s cool by me!

Comments are closed.