6 Replies Latest reply on Oct 23, 2009 2:06 PM by s007767

    subclassing MovieClip not working: stumped


      I've got a legacy app I'm trying to update a bit. I'd like to get more of the actionscript into class files and off the various time lines. The problem is I can't make it work. I have a class file called dezynworks.aegis.TextPanelContainer. I have a MovieClip in my library called TextScrollWinow. Linkage for TextScrollWindow: Identifier, TextScrollWindow; class: dezynworks.aegis.TextPanelContainer. Now I read on a web site that dragging the clip to the stage would retain the class association. That is news to me. I thought you had to use attach. Regardless, neither way seems to work.


      dummy = this.attachMovie( "TextScrollWindow", "scrollWindow", getNextHighestDepth() );
      trace( dummy instanceof TextPanelContainer );
      dummy._x = 2;
      dummy._y = 22;
      dummy.attachMovie("TextPanel","tp",getNextHighestDepth() );


      The attach works. The clips appear on the stage, but the class is gone. dummy.init() (a method of the TextPanelContainer class) is never called and the instanceof statement returns false. There are no compiler errors. There are no runtime errors. I've set up test cases in a new Flash file and it all works like I expect.


      I've tried deliberately gumming up the class name and introducing syntax errors into the class file. It seems Flash is finding the file okay. Something must be failing silently, but I have no clue what and I'm out of ideas.


      Does someone have any suggestions as to how I can trouble shoot this? Are there any gotchas I need to be aware of?


      Thanks in advance.