Class instance - MC link problem

Hello,

I am exploring object orented programing in flash.
and here is my first problem I ran into…

I want to link class instance with mc instance.

I want to create… lets say…

class player(){
 function go(){
 ...
 }
}

and then create MC …

lets say…

_root.player_mc

I want to link it so I could do

_root.player_mc.go();

… how to do it?

of course I can…

_root.player_mc.go = class_instance.go();


or something… but it’s not the way I want to use classes in the flash…
:frowning: I do not want to link all properties and all methods that way…
If I will change my class… I will have to corect all such links…

can you sugest eny solution?

Thanks for your time.

GL flashing,
Deril

hi,

Right click the movie clip in the library, (linkage) export for ActionScript, assign it an identifier, and use your class’s name, (player) in AS 2.0 Class (in properties).

Usualy a class’s name starts with upper case: Player, not player.
This is a good practice, but if you don’t follow it, make just you always write it the same way.

and extend MovieClip

THANKS!

its works…

stupid me… I allways new that it is the case… but I was misguided by one material I had…

And thanks for advice about naiming… :slight_smile:
I work with flash programing for 3 years… I know its important… I just skiped that in the post…

thanks, and happy flashing!