0
function showpic(e:Event):void
{
    if(bitmap != null)
    {
        removeChild(bitmap);
    }

    var originalWidth:int = Bitmap(e.currentTarget.content).width;
    var originalHeight:int = Bitmap(e.currentTarget.content).height;

    bitmapdata = new BitmapData(originalWidth,originalHeight);
    bitmap = new Bitmap(bitmapdata);
    bitmap.bitmapData = Bitmap(e.currentTarget.content).bitmapData;

    bitmap.width = this.stage.stageWidth;
    bitmap.height = (originalHeight * this.stage.stageWidth) / originalWidth;

    bitmap.x = 0;
    bitmap.y = stage.stageHeight/3;

    sp = new Sprite();
    sp.addChild(bitmap);

    addChildAt(sp,0);
    }

sp.addEventListener(MouseEvent.MOUSE_DOWN, movingstart);
function movingstart(e:MouseEvent):void
{
sp.startDrag();
}

sp.addEventListener(MouseEvent.MOUSE_UP, movingstop);
function movingstop(e:MouseEvent):void
{
sp.stopDrag();
}

look!! I succeeded display my sp on screen. but It didn't moves when I did mouse down and mouse up.

I know that bitmap couldn't take MouseEvent. so I addChild it as Sprite.

1 Answers1

0

Try to use targe or currentTarget instead of sp