# Problem drawing a Movie Clip with the Bitmap class

**URL:** <https://forum.kirupa.com/t/problem-drawing-a-movie-clip-with-the-bitmap-class/214113>\
**Category:** Uncategorized\
**Created:** [January 25, 2007, 5:15pm UTC](https://forum.kirupa.com/t/problem-drawing-a-movie-clip-with-the-bitmap-class/214113 "2007-01-25T17:15:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![coche](https://avatars.discourse-cdn.com/v4/letter/c/a88e4f/32.png) [@coche](https://forum.kirupa.com/u/coche)\
**Post date:** [January 25, 2007, 5:15pm UTC](https://forum.kirupa.com/t/problem-drawing-a-movie-clip-with-the-bitmap-class/214113/1 "2007-01-25T17:15:02Z")

</div>

Hello everybody, I’m trying to do some kind of transition effect based in a senocular’s source FLA’s (great effect by the way). The transition basically takes a brush and paints the element you want to appear, in my case a movie clip. The problem is that in the partial code I have, the movie clip appears clipped. Could be because my movie clip is a little big (800x500px)?, or I don’t know. Maybe somebody could give me some help. Thanks. I post my code below:

[COLOR=Blue]import flash.display.BitmapData[/COLOR];  
[COLOR=Blue]import flash.geom.Point[/COLOR];

[COLOR=Blue]Stage.scaleMode[/COLOR] = ‘noScale’;  
[COLOR=Blue]var[/COLOR] speed\_factor = 3;

[COLOR=Blue]var[/COLOR] basepoint = [COLOR=Blue]new Point/COLOR;

[COLOR=Blue]this.attachMovie/COLOR; [COLOR=SeaGreen]// the movie clip I want to display[/COLOR]

displayBitmap = [COLOR=Blue]new BitmapData[/COLOR](intro\_mc.[COLOR=Blue]\_width[/COLOR], [COLOR=Blue]intro\_mc[/COLOR].[COLOR=Blue]\_height[/COLOR], [COLOR=Blue]true[/COLOR], 0x00FFFFFF);

displayBitmap.[COLOR=Blue]draw/COLOR;  
intro\_mc.[COLOR=Blue]\_visible[/COLOR] = [COLOR=Blue]false[/COLOR];

transBitmap = [COLOR=Blue]new BitmapData[/COLOR](intro\_mc.\_width, intro\_mc.\_height);  
paintingBitmap = [COLOR=Blue]new BitmapData[/COLOR](intro\_mc.\_width, intro\_mc.\_height);

[COLOR=SeaGreen]// the animation that “paints” the above “intro\_mc”  
[/COLOR][COLOR=Blue]this.attachMovie[/COLOR](“painting”, “painting\_mc”, 1);  
painting\_mc.[COLOR=Blue]\_visible[/COLOR] = [COLOR=Blue]false[/COLOR];

[COLOR=Blue]this.createEmptyMovieClip[/COLOR](“display\_mc”, 2);  
display\_mc.[COLOR=Blue]attachBitmap[/COLOR](displayBitmap, 1);

[COLOR=SeaGreen]// the frame of the painting (appears above the painting)  
[/COLOR]frame\_mc.[COLOR=Blue]swapDepths/COLOR;

startTransition();

[COLOR=Blue]function[/COLOR] startTransition() {  
painting\_mc.[COLOR=Blue]gotoAndStop/COLOR;  
brushDrawToDisplay();  
[COLOR=Blue]onEnterFrame[/COLOR] = tranOnEnterFrame;  
}

[COLOR=Blue]function[/COLOR] transOnEnterFrame() {  
[COLOR=Blue]var[/COLOR] i = speed\_factor;  
[COLOR=Blue]while/COLOR {  
painting\_mc.[COLOR=Blue]nextFrame/COLOR;  
brushDrawToDisplay();  
[COLOR=Blue]if[/COLOR](painting\_mc.[COLOR=Blue]\_currentframe[/COLOR] \>= painting\_mc.[COLOR=Blue]\_totalframes[/COLOR]) {  
displayBitmap.[COLOR=Blue]draw/COLOR;  
[COLOR=Blue]delete this.onEnterFrame[/COLOR];  
[COLOR=Blue]break[/COLOR];  
}  
}  
}

[COLOR=Blue]function[/COLOR] brushDrawToDisplay() {  
paintingBitmap.[COLOR=Blue]fillRect[/COLOR](paintingBitmap.rectangle, 0);  
paintingBitmap.[COLOR=Blue]draw/COLOR;  
displayBitmap.[COLOR=Blue]copyPixels[/COLOR](transBitmap, transBitmap.[COLOR=Blue]rectangle[/COLOR], basepoint, paintingBitmap, basepoint, [COLOR=Blue]true[/COLOR]);  
}
