steamlin 2006-11-21 11:41
[原创]图片效果系列之二
import flash.filters.ColorMatrixFilter;
import mx.transitions.Tween;
import mx.transitions.easing.*;
var nowI:Number;
smallbg.targetx = (Stage.width-smallbg._width)/2;
function aa(i:Number) {
function brightnessWatcher(prop:String, oldVal:Number, newVal:Number, img_mc:MovieClip):Number {
var brightness_array:Array = [1, 0, 0, 0, newVal, 0, 1, 0, 0, newVal, 0, 0, 1, 0, newVal, 0, 0, 0, 1, 0];
colorMF = new ColorMatrixFilter(brightness_array);
img_mc.filters = [colorMF];
return newVal;
}
this.createEmptyMovieClip("img_mc", 0);
img_mc.attachMovie("pic"+i, "pic"+i, i);
img_mc._x = (Stage.width-img_mc._width)/2;
img_mc._y = (Stage.height-img_mc._height)-40;
img_mc.watch("brightness", brightnessWatcher, img_mc);
var t:Object = new Tween(img_mc, "brightness", Elastic.easeOut, 100, 0, 5, true);
nowI = i;
}
aa(1);
for (j=1; j<7; j++) {
this.smallbg["btnmc"+j].no = j;
this.smallbg["btnmc"+j]._alpha = 80;
this.smallbg["btnmc"+j].useHandCursor = false;
this.smallbg["btnmc"+j].onRelease = function() {
a = this.no;
if (nowI != a) {
aa(a);
}
};
this.smallbg["btnmc"+j].onRollOver = function() {
this._alpha = 100;
};
this.smallbg["btnmc"+j].onRollOut = function() {
this._alpha = 80;
};
}
onEnterFrame = function () {
smallbg._x += (smallbg.targetx-smallbg._x)*0.2;
if (Math.abs(smallbg.targetx-smallbg._x)<=0.2) {
smallbg._x = smallbg.targetx;
delete onEnterFrame;
}
};
stop();
//////////////以下为自动调用外部图片的代码/////////////////////////////////////////////////////////////////////////////////////////////
function aaa(i:Number) {
this.createEmptyMovieClip("img_mc", 10);
var img_mcl:MovieClipLoader = new MovieClipLoader();
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip):Void {
// 使影片剪辑实例在舞台上居中
target_mc._x = (Stage.width-target_mc._width)/2;
target_mc._y = Stage.height-target_mc._height;
target_mc.watch("brightness", brightnessWatcher, target_mc);
// 为 target_mc 影片剪辑添加动画效果,使其亮度在 -100 到 +100 之间变化
var t:Object = new Tween(target_mc, "brightness", Elastic.easeOut, 100, 0, 3, true);
////////设置自动播放影片的代码////////////////////////////////////////////////////////////
//t.onMotionFinished = function() {
//if (i<6) {
//i = i+1;
//} else {
//i = 1;
//}
//trace(ID);
//ID = setInterval(aa, 3000, i);
//};
////////////////////////////////////////////////////////////////////////
};
img_mcl.addListener(mclListener);
img_mcl.loadClip("img/photo"+i+".jpg", img_mc);
function brightnessWatcher(prop:String, oldVal:Number, newVal:Number, target_mc:MovieClip):Number {
var brightness_array:Array = [1, 0, 0, 0, newVal, 0, 1, 0, 0, newVal, 0, 0, 1, 0, newVal, 0, 0, 0, 1, 0];
colorMF = new ColorMatrixFilter(brightness_array);
target_mc.filters = [colorMF];
return newVal;
}
nowI = i;
//if (ID != undefined) {
//clearInterval(ID);
//}
//trace("lID="+ID)
}
///源代码太大了.传不上来.如果有需要.可留下EMAIL,再发给你们.
[[i] 本帖最后由 steamlin 于 2006-11-21 19:26 编辑 [/i]]
steamlin 2006-11-21 19:25
[quote]原帖由 [i]爱你不要你[/i] 于 2006-11-21 18:29 发表
呵呵 虽然有广告嫌疑 楼住人才也 [/quote]
呵呵...确实你这里是上传不了大于600K的文件啊.我没有办法啊.
如果可以上传的.我马上删除了下面的那个啊.
steamlin 2006-11-21 19:33
可不可以加点缘分币啊.这样才有动力一点啦.版主.
steamlin 2006-11-23 17:55
补上源文件
生命献给艺术 2006-11-24 18:13
[quote]原帖由 [i]乐感王[/i] 于 2006-11-24 15:42 发表
有源文件就好,呵呵 [/quote]
呵呵,楼住真的很辛苦了
steamlin 2006-11-25 10:31
好没人气啊.
ylh8000 2006-12-3 18:07
支持你,想看你的源文件!
支持你,想看你的源文件!:a01 :a01 :a01 :a01
steamlin 2006-12-4 16:49
[quote]原帖由 [i]ylh8000[/i] 于 2006-12-3 18:07 发表
支持你,想看你的源文件!:a01 :a01 :a01 :a01 [/quote]
五楼有源文件啊!你没看到?
点点水 2006-12-5 09:16
好东西的收藏~!!
支持~~~~对代码一点都不懂啊~!!
steamlin 2006-12-5 09:21
[quote]原帖由 [i]点点水[/i] 于 2006-12-5 09:16 发表
好东西的收藏~!!
支持~~~~对代码一点都不懂啊~!! [/quote]
呵呵...
就是因为懂才要学啊...
我也不懂的啊..Keke
hefeng330 2008-7-10 19:00
看见了,可是没有YB下载啊abc::08
zhejinhua 2008-7-14 09:47
看不懂哦,都是代码....