Flash有趣实验:用视频阻挡泡泡特效_Flash教程
教程Tag:暂无Tag,欢迎添加,赚取U币!
缂傚倸鍊搁崐椋庣矆娴h娲晝閸屾氨鍔电紓浣插亾闁硅京顒CMS闂備浇宕甸崰鎰版偡閵夈儙娑樷攽鐎c劉鍋撻崒鐐查唶闁哄洨鍋為悗顒€鈹戦悙鍙夘棡闁搞劎鍠栧濠氭晸閿燂拷婵犵數鍋為崹璺侯潖鐟欏嫮鐝堕柛鈩冪☉閻撴﹢鏌″搴″箺闁抽攱甯¢弻銊╂偆閸屾稑顏� 缂傚倸鍊风粈渚€藝闁秴绐楅柟閭﹀墾閼板潡鏌涢妷顔煎缂佲偓婢舵劖鐓冮柕澶堝妽閻濐亪鏌e┑鎾村 闂傚倸鍊风欢锟犲磻閸曨垁鍥ㄦ綇閳哄啰顦繝銏f硾閺堫剟宕楀⿰鍫熺厸闁搞儯鍔嶉惃鎴︽⒒婢跺﹦效闁哄被鍊栧ḿ蹇涘Ω閿旂粯顥涚紓鍌欑劍閸炲骞忛敓锟� 闂傚倷绀侀幖顐﹀疮閻楀牊鍙忛柟缁㈠枛濡炰粙鏌″搴′簽闁告纰嶇换娑㈠幢濡闉嶅┑顕嗙稻閸旀鍩€椤掑喚娼愰柟顔肩埣瀹曟洟鏌嗗鍛厬闂佽法鍣﹂幏锟�,闂傚倷娴囬惃顐﹀礋椤愩垹袘闂佽姘﹂~澶嬬箾婵犲偆鍤曢柛顐f礀缁€鍐┿亜閺傚灝鎮戞い蹇曞枑缁绘盯骞嬮悙鏉戠殤闂佺ǹ顑嗛幑鍥ь潖閸濆嫧鏋庨柟顖嗗嫮浜梻浣告啞閻熴儳鎹㈠Ο渚殨濠电姵纰嶉弲鎼佹煥閻曞倹瀚�!
推荐:模糊、缓冲、顺序加载、XML等的混合运用简单实例
放假了,没多少事,发个模糊、缓冲、顺序加载、XML等的混合运用简单实例,作品粗糙,给我等新手们参考,抛砖引玉吧,假如你觉得可以一定记得要顶帖。第一帧上
有摄像头才可以试验哦!!
下面是代码:
cam.setMode(cam.width, cam.height, 25);
video.attachVideo(cam);
var depth_num:Number = 0;
var list_array:Array;
list_array = new Array();
m = new flash.geom.Matrix();
now = new flash.display.BitmapData(video._width, video._height);
out = new flash.display.BitmapData(video._width, video._height);
this.createEmptyMovieClip("out_mc", 50);
out_mc.attachBitmap(out, 1);
out_mc._x = 160;
this.onEnterFrame = function() {
now.draw(video, m);
done = now.clone();
done.draw(before, m, null, "difference");
done.threshold(done, done.rectangle, done.rectangle.topLeft, ">", 4.279309E 009, 4.294902E 009, 16777215, false);
list_array.push(done.clone());
if (list_array.length>5) {
list_array.shift().dispose();
}
var r_num9 = list_array.length;
var r_num8 = 255;
var r_num7;
out.fillRect(out.rectangle, 0);
before = now.clone();
for (var c:Number = 0; c<r_num9; c ) {
r_num7 = c*r_num8;
out.threshold(list_array[c], out.rectangle, out.rectangle.topLeft, "==", 4.294902E 009, -16777216 | r_num7 << 16 | 0 | 0, 16777215, false);
}
depth_num ;
attachMovie("pao_mc", "pao_mc" depth_num, depth_num 100, {_x:Math.random()*550, _y:Math.random()*400, _xspeed:3-(Math.random()*6 1), _yspeed:Math.random()*3 1, _scale:Math.random()*20 20});
var color:Color = new Color(this["pao_mc" depth_num]);
color.setRGB(Math.random()*0xffffff);
this["pao_mc" depth_num]._xscale = this["pao_mc" depth_num]._yscale=this["pao_mc" depth_num]._xscale._scale;
this["pao_mc" depth_num].onEnterFrame = function() {
this._xscale = this._scale/60;
this._yscale = this._xscale;
this._alpha = 166-this._xscale;
trace(out.getPixel(this._x, this._y));
if (out.getPixel(this._x, this._y)<=0) {
this._x -= this._xspeed;
this._y -= this._yspeed;
}
if (this._x<=0 || this._y<=0 || this._x>=550) {
this.removeMovieClip();
}
};
};
stop();
分享:网页中Flash出现“单击激活并使用此控件”的解决方法
在网页中插入的Flash,在进行页面浏览时会有讨人嫌的提示“单击激活并使用此控件”,Flash文件的四周具有边框显示,必须单击该Flash才能消除该提示,着实很麻烦
/所属分类:Flash教程/更新时间:2008-03-05

相关Flash教程:
- 相关链接:
- 教程说明:
Flash教程-Flash有趣实验:用视频阻挡泡泡特效
。