Create | interaction
Interestingly, the author was at a party, inspired by a friend's advice, to create an interactive video. The author realizes the tracking of the video by using the pixel color value function in the video. Specifically, the "draw" method is used in each "Onenterframe" event to realize the interactive application of the video. The results are still successful, although some areas need to be optimized. The author uses it in parallel with cameras and web movies to create the following simple and fascinating little video named "Air Piano".
The author also passed on the record of FLV, to see it, note that the video of the three red circles, is to get the image pixel position.
/uploadpic/2007-7/2007781123179.swf
Here's the code for it.
_root.map = new Flash.display.BitmapData (0);
_root.createemptymovieclip ("Fake\", 2);
_root.fake.attachbitmap (map, 0, \ "auto\", true);
_root.fake._visible = false;
balls = [];
for (var i = 0; i < 3; i++)
{
Balls[i] = _root[\ "ball\" + i];
}
_root.my_video.gotoandplay (1);
_root.onenterframe = function ()
{
Map.draw (My_video);
for (var i = 0; i < 3; i++)
{
var clr = _root.map.getpixel (balls[i]._x, balls[i]._y);
BALLS[I].OUTCLR = CLR;
if (CLR < 12895941)
{
Balls[i].kill ();
}
}
};