1 Reply Latest reply on Aug 16, 2007 1:12 AM by richtextformat

    subclassing Sprite with maintimeline MC's

    richtextformat Level 1
      wow, what a day. day 2 of learning AS3 by diving in the deep end!


      ok, so if i'm gonna make a display object class then i'm gonna extend Sprite. cool, this much understood. the problem ihave is that the project is for an arts organisation and some of the artists there are gonna appreciate the work a lot more if they can actually SEE what their proposed screens look like in the FLA itself. to that end, i've inherited an FLA that has a bunch of mcs - single frame containers essentially with the odd button / textinput / image inside - that are to serve as the actual screen furniture themselves

      or, in short, i'm not creating the display objects dynamically with AS3: they're already sitting there for me on the stage.

      so the question is: what's gonna be the best way of incorporating these mcs into a class that extends Sprite? in my - possibly naive, i have no idea (only been doing this for 2 days!!!) - view these classes WOULD ACTUALLY BE these mcs. like i had some container called 'screen1_mc' and that somehow became:

      public class FirstScreen extends Sprite

      so if i pass them in via the constructor, like:

      var screen1:FirstScreen = new FirstScreen( screen1_mc )

      thats not going to do it is it? then screen1_mc will simple become a property of FirstScreen.as, not FirstScreen.as itself, like:

      public function FirstScreen ( firstScreen:Sprite )
      _firstScreen = firstScreen;

      hmm............ hows this done then? :S