0 Replies Latest reply on Nov 14, 2007 12:01 PM by FlashForumName

    addChild

    FlashForumName
      Hello all. I have an mx:image created as so:

      <mx:Image x="41" y="10" source="zoomIn.PNG" id="mc_zoomIn2" autoLoad="true" visible="false"/>

      The image loads, everything is great. The problem is, when a user clicks on a button, I want that image to be drug instead of the mouse. This also works by doing this:

      public function zoomInDrag(event:Event):void // start dragging that zoomin icon
      {
      Mouse.hide();
      mc_zoomIn2.visible = true;
      // addChild(mc_zoomIn2);
      // this.setChildIndex(this.getChildByName("mc_zoomIn2"), this.numChildren);
      //this.setChildIndex(mc_zoomIn2, this.numChildren);
      //addChild(mc_zoomIn2 as DisplayObject);
      //addChild(DisplayObject(mc_zoomIn2));
      mc_zoomIn2.startDrag();
      }

      The problem is, by that time, the picture is not at the right depth. Other objects are on top of it so when I drag it, it is covered up. I know I can remedy this problem if I do an addChild on it to bring it to the top layer/depth but it's looking for a displayObject and this image does not fit the criteria. All those things commented out have failed for me. My question is, how do I get this image to the top depth/layer so I can always see it while dragging it around the screen? Thanks in advance!