A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: CS4/AS3 gTween & bitmapData - HELP!!!

  1. #1
    anyone else hear that? flashpipe1's Avatar
    Join Date
    Jan 2003
    Location
    Upstate NY
    Posts
    1,929

    CS4/AS3 gTween & bitmapData - HELP!!!

    I'm using Grant Skinner's gTween and need to capture the tweened clip using bitmapData, but can't figure out how to make it work!!

    Here's the code, and I attached a sample...

    Code:
    //importing packages--------------------------
    import flash.events.MouseEvent;
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    
    import com.gskinner.motion.GTweeny;
    import fl.motion.easing.*;
    
    //var----------------------------------------------
    var myBitmapData:BitmapData=new BitmapData(draw_mc.width,draw_mc.height);
    
    //Capture function---------------------------------
    function capture(event:Event) {
    	myBitmapData.draw(draw_mc);
    	var bmp:Bitmap=new Bitmap(myBitmapData);
    	this.addChild(bmp);
    	draw_mc.visible=false;
    	bmp.x=draw_mc.x;
    	bmp.y=draw_mc.y+draw_mc.height;
    }
    function click_Handler(event:MouseEvent) {
    	capture(event);
    }
    but.addEventListener(MouseEvent.MOUSE_DOWN, click_Handler);
    
    //rotate function
    stage.addEventListener(Event.ENTER_FRAME,handleTick);
    function handleTick(evt:Event):void {
    	draw_mc.rotationY += ((mouseX-150)*+0.2 - draw_mc.rotationY)*0.45;
    }
    Attached Files Attached Files
    Love like you've never been hurt, live like there's no tomorrow and dance like nobody's watching.

  2. #2
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    BitmapData.draw() captures objects without their transformations - it looks like you want to be drawing the stage or else you need to add a wrapper around the draw_mc to capture the distortion.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center