PDA

View Full Version : The use of non component flash oop.


Stimpson
06-06-2003, 07:13 PM
Haven't seen a specific flash-oop forum so i'll post this here. Point me elsewhere if I'm wrong.

Please stay with me, i've been wondering about this for a while now.
I've been working with oop and flash for a while now, and I'm working fairly easy with it now. But it it always ends up to be classes , not surprisingly, with a movieclip superclass.
And the only way, I know atleast, to actually use them is to put the class code in a component with linkage id and a object.registerclass and them attach them on stage.

My question is what the use would be of oop in flash which is not in a component, this in the sense of a complete block of class code just on stage for example. Having a complete block of class code with:

className.prototype=new MovieClip();

in it, and then just doing:

var clip=new className();

does not create a new movieclip on stage with wich you can work with. So far I know it only works when you attach a instance of a clip on stage, with the class code in it.

So is the only way to really work with oop and movieclip instances, via components? Not that that is ineffective, it works great, but I was just wondering. Seems odd oop in flash really only has use in combination with components, but perhaps I'm missing something here.

jaybee
06-17-2003, 03:06 PM
abstract classes can be extremely useful, esp in a reasonably complex RIAs, but like you say it's usually possible to combine them with the visual class, ie the component........that doesn't mean they're not useful though and you can use them without having to create a whole component. Also, everything in flash is an object and you can code with/add to any object, so everytime you add a method to the string object for instance, you're taking advantage of that.....