Search code examples
actionscript-3flashpapervision3d

FLASH AS3 change bitmap on click


I'm hoping one of the many helpful FLASH genius' on this site can share the code bit necessary to update the bitmap in this sample code: http://www.flashmo.com/preview/flashmo_096_3d_cylinder_box When clicked I want to have any of the picture's (bitmap) changed to something else (another bitmap) upon the click event.
Thank you greatly for any assistance you can provide!!


Solution

  • var ExampleBitmapData:BitmapData = ExampleBD();
    var anotherBitmapData:BitmapData = anotherBD();
    
    var bitmap_Holder:Bitmap;
    
    bitmap_Holder.bitmapData = ExampleBD();
    
    stage.addChild(bitmap_Holder);
    
    stage.addEventListener(MouseEvent.MOUSE_CLICK, function(event:MouseEvent):void{
    bitmap_Holder.bitmapData = anotherBD();
    });
    

    this can give you an idea i think.