2 Replies Latest reply on Mar 20, 2007 8:19 AM by SPGAnne

    problems with attachMovie

    SPGAnne Level 1
      Well, I must've left some brain cells somewhere while on vacation. I thought I was on a groove swing learning Flash, but I've been hitting the proverbial brick wall all day with this one.

      I have a class which attaches a movie clip in my library. That clip in turn has a clip that I want to control with gotoAndStop stuff. Here's what I have:
      private var item_mc:MovieClip;
      private var cb_mc:MovieClip;
      ...
      private function initItem(proto:String,n:Number):Void{

      item_mc=itemHolder_mc.attachMovie(proto,"item"+n+"_mc",itemHolder_mc.getNextHighestDepth() );
      cb_mc = item_mc.thingInside_mc;//convenience reference to the clip inside the one I attach
      cb_mc.useHandCursor = false; // this works fine, along with other stuff for calling various functions onRollOver, onPress etc.
      I can even set the _width and the _rotation of the cb_mc no problems.

      what doesn't work is cb_mc.gotoAndPlay(...); or .play or .gotoAndStop(...). So when I do a trace
      trace("cb_mc frames: "+cb_mc._totalframes+", type: "+typeof(cb_mc));
      I get cb_mc frames: undefined, type: object

      So for some reason it doesn't think the thingInside_mc is a movieclip. I have double checked the instance name in the symbol library of the clip and it is indeed called thingInside_mc. And it is indeed a movie clip symbol that is in the library. So I give up. What on EARTH am I doing wrong?