Flash: Create a Video background pattern in Flash 8
October 12th, 2005 by LuisSomeone ask me about creating a background pattern with video, which it is not a big deal since we can use MovieClip.beginBitmapFill method in order to fill a drawing area with a bitmap image or like in this case with a video by using the BitmapData.draw method.
SWF sample (You need a webcam):
[flash]http://www.blog.lessrain.com/wp-content/upload/tilebackground3.swf,400,200[/flash]
Actionscript:
- import flash.display.BitmapData;
- var w:Number = Stage.width;
- var h:Number = Stage.height;
- var columns:Number = 6;
- var rows:Number = 3;
- this.attachMovie("videoContainer", "myVideoContainer", 10);
- var my_cam:Camera = Camera.get();
- myVideoContainer.video.attachVideo(my_cam);
- myVideoContainer.video._width = Math.round(w/columns);
- myVideoContainer.video._height =Math.round(h/rows);
- var pattern:BitmapData = new BitmapData(myVideoContainer.video._width, myVideoContainer.video._height, false, 0);
- function createTiles():Void {
- with (_level0) {
- beginBitmapFill(pattern);
- moveTo(0, 0);
- lineTo(w, 0);
- lineTo(w, h);
- lineTo(0, h);
- lineTo(0, 0);
- endFill();
- }
- }
- createTiles();
- this.onEnterFrame=function() {
- pattern.draw(myVideoContainer);
- }


February 20th, 2006 at 7:39 pm
Cool
February 22nd, 2006 at 4:06 pm
[…] international television. Versatile programming products on digital video. lessrain blog Blog Archive Flash: Create a Video background Flash: Create a Video background pattern […]
March 27th, 2006 at 4:31 pm
[…] Articles. Related entries: - Flash: About Cue points - Flash: Standalone Video Player - Flash: Create a Video background pattern in Flash 8 - Flash: Video Articles - Flash: How to de-interlace vide […]
April 8th, 2006 at 5:27 am
i like flash ,i like video, sounds your method is good, but i also have one, use tools to find at http://www.yaodownload.com/video-design/video/ , do your movie and flash by yourself!
May 22nd, 2008 at 10:17 pm
Is it possible to use a real video and use it as a background(if the viewer had the bandwith for it)? Lets say you had a 10 sec video loop? Could you have a menu on top of it with text and stuff?