简体   繁体   中英

How to startDrag() a Bitmap?

我已经将一些图像加载到我的swf中,但是我无法让它们开始拖动,startDrag()仅适用于Sprite或MovieClip

Bitmap Object hasn't got some eventListeners which Sprites and MovieClips have. So i think you should do it like that:

    var bitmap_Object:Bitmap;
    var container_sprite:Sprite = new Sprite;

    stage.addChild(container_sprite);
    container_sprite.addChild(bitmap_Object);
    container_sprite.startDrag();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM