Skip to main content
January 12, 2008
Question

Instantiating class query

  • January 12, 2008
  • 1 reply
  • 194 views
Hi,

I'm fairly new to oop and I would like to create a movieclip instance that I attach to the stage dynamically as there will be several of these attached to the stage. However, each movieclip will load in some text dynamically from a text file. There will be several text files for each movieclip. I thought it would be best to create a class to handle this. My question is when I instanstiate the class (presumably this will happen when I attach an instance of the movieclip to the stage in the code) how do I pass a variable to the class?

Thanks
This topic has been closed for replies.

1 reply

clbeech
Inspiring
January 12, 2008
it will depend on which way you are using your class: if you instantiate a new class member through code, you can pass the value in the constructor and within the class' constructor method, assign the value to a var. if you're class is attached to an Objec,t then you can pass the a value to the named public variable in the attachMovie initObject.