1 Reply Latest reply on Jan 12, 2008 9:33 AM by clbeech

    Instantiating class query


      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?

        • 1. Re: Instantiating class query
          clbeech Level 3
          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.