PDA

View Full Version : Intrinsic classes



darnpunk
April 10th, 2009, 02:32 PM
Hi,

I need advice on development process that involves using intrinsic classes.

The intrinsic classes allow them to see the properties and methods offered by the class but not the inner workings and also prevent editing. Using FlashDevelop, I am able to create the intrinsic-like classes.

Now the question is, when the programmer tries to compile for testing, won't the application not work as it should, since the intrinsic classes does not have any function body?

I recall a while back using Zinc and its intrinsic class to use some of its methods. But to get it working, I need to compile it with the tool itself. How do I achieve this with the Flash IDE itself?

To make myself more clear: I have a few classes that allows you to draw/modify a monster avatar. Another programmer is supposed to create the monster's AI. He does not need to know how the monster is drawn but he needs to access some properties of the monster (name, height etc). Using intrinsic classes, he can check the properties and methods offered by the avatar class but during compile, how can he test without the real function body?

Thanks in advance!

Regards,
darnpunk

JonnyR
April 10th, 2009, 02:43 PM
Hi Darnpunk,

I believe what you are trying to create here is a SWC file which includes your code (IDE's will then be able to create the intrinsic "stub-code" for them). I have not done this myself, but I remember Essential AS3 touched on the subject: http://my.safaribooksonline.com/0596526946/distributing_a_class_library_as_a_swc_file

Regards
Jonny.

darnpunk
April 10th, 2009, 02:59 PM
Hi JonnyR,

Thanks for link! I will try that out :)

Cheers,
darnpunk

darnpunk
April 11th, 2009, 01:15 PM
After trying it out, it seems to work well except now I need to know how to exclude the intrinsic classes during compilation.

For example, during development, the programmer imports the intrinsic classes for code hinting and so on in his/her own IDE. During compilation, these classes are compiled as well overriding the already compiled classes from the SWC file. I can skip the classes by not adding the intrinsic sources to the classpath in the FLA settings but this can be quite troublesome if there are some classes that we actually need to use.

Is there a way to exclude a list of classes from compiling together in Flash CS3? I know there's the exclude.xml for but seems like it does not work for CS3 and there isn't a clear workaround out there. Anyone knows a way to achieve this?