开启左侧

[CSS] 请教一个flash鼠标点击事件

[复制链接]
发表于 2012-4-13 17:18:08 | 显示全部楼层 |阅读模式
http://t7.dowv.cn/ 这个网站的flash导航,要求点击按钮之后的状态,跟鼠标移动上去的状态是一样的。我对as也不熟悉,不知道咋改,请教哪位大牛给看看,在此谢过

=======================以下是as代码================
Stage.scaleMode = "noScale";
Stage.align = "TL";
import com.greensock.*;
import com.greensock.easing.*;
var locMc = this;
//_root.id = 6;//测试传值
var url_link = new Array("/indexeng.asp", "../../english/cu_space/cu_space.asp", "../../english/cu_pool/cu_pool.asp", "../../english/partners/partners.asp", "../../english/news/news.asp", "../../english/projects/type.asp", "../../english/publications/publications.asp", "../../english/lectures/lectures.asp", "../../english/jobs/jobs.asp","../../english/contact/contact.asp");//主导航连接
var url_link2 = new Array("/english/cu_space/cu_space.asp", "/english/cu_space/exhibitions.asp", "/english/cu_space/symposium.asp", "/english/cu_space/artists.asp");//ID2连接
var url_link3 = new Array("/english/cu_pool/cu_pool.asp", "/english/cu_pool/research.asp", "/english/cu_pool/products.asp", "/english/cu_pool/exhibitions.asp");//ID3连接
var url_link6 = new Array("/english/projects/type.asp", "/english/projects/year.asp", "/english/projects/location.asp", "/english/projects/status.asp");//ID6连接
var itemX = new Array("0", "80", "160", "240", "310", "361", "424", "514", "591", "641");//主导航x轴位置
var itemX2 = new Array("85", "158", "236", "319");//ID2x轴位置
var itemX3 = new Array("85", "149", "221", "290");//ID3x轴位置
var itemX6 = new Array("85", "133", "181", "247");//ID6x轴位置
var haveSub_array = new Array(false, false, false, false, false, false, false, false, false, false);//设置是否有下拉
for (var i = 1; i<=url_link.length; i++) {
var tempMc = locMc["mainMc"+i];
tempMc.mainTxt.gotoAndStop(i);
tempMc.mainBg.gotoAndStop(i);
tempMc._y = 0;
tempMc._x = itemX[i-1];
tempMc.link = url_link[i-1];
tempMc.id = i;
tempMc.haveSub = haveSub_array[i-1];
tempMc.onRollOver = function() {
TweenMax.to(this,0.5,{frame:10});
};
tempMc.onRollOut = tempMc.onReleaseOutside=function () {
TweenMax.to(this,0.5,{frame:1});
};
tempMc.onRelease = function() {
if (this.haveSub) {
subIn(this.id);
} else {
getURL(this.link, "_self");
}
};
}
if (_root.id != undefined) {
subIn(_root.id);
}
///////下拉效果
function subIn(id) {
_global.currentLink = locMc["url_link"+id];
_global.subMcIn = "subIn"+id;
var itemXIn = locMc["itemX"+id];
for (var i = 1; i<=url_link.length; i++) {
var temp = locMc["mainMc"+i];
TweenMax.to(temp,0.5,{_x:"-200", autoAlpha:0, ease:Back.easeOut});
}
TweenMax.to(homeMc,0.5,{_x:0, autoAlpha:100});
for (var i = 1; i<=_global.currentLink.length; i++) {
subMc = locMc.attachMovie(_global.subMcIn, _global.subMcIn+i, i);
subMc.mainTxt.gotoAndStop(i);
subMc.mainBg.gotoAndStop(i);
subMc._x = 0;
subMc._alpha = 0;
TweenMax.to(subMc,0.5,{_x:itemXIn[i-1], autoAlpha:100, ease:Sine.easeInOut});
subMc.link = _global.currentLink[i-1];
subMc.onRollOver = function() {
TweenMax.to(this,0.5,{frame:10});
};
subMc.onRollOut = subMc.onReleaseOutside=function () {
TweenMax.to(this,0.5,{frame:1});
};
subMc.onRelease = function() {
getURL(this.link, "_self");
};
}
}


/////返回首页
homeMc.onRelease = function() {
TweenMax.to(homeMc,0.5,{_x:-85, autoAlpha:0});
for (var i = 1; i<=_global.currentLink.length; i++) {
subMc = locMc[_global.subMcIn+i];
TweenMax.to(subMc,0.5,{_x:"-200", autoAlpha:0, ease:Back.easeOut});
subMc.removeMovieClip();
}
for (var i = 1; i<=url_link.length; i++) {
var temp = locMc["mainMc"+i];
TweenMax.to(temp,0.5,{_x:"200", autoAlpha:100, ease:Back.easeOut});
}
};
homeMc.onRollOver = function() {
TweenMax.to(this,0.5,{frame:10});
};
homeMc.onRollOut = homeMc.onReleaseOutside=function () {
TweenMax.to(this,0.5,{frame:1});
};

//----------------------------------------
平度网:www.pingdu.co 平度论坛:bbs.pingdu.co
您需要登录后才可以回帖 登录 | 会员注册

本版积分规则

 
QQ在线咨询
售前咨询热线
0532-88371356
售后服务微信
pingduwangzhan
快速回复 返回顶部 返回列表