- UID
- 116281
- 积分
- 1793
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2004-3-22
- 最后登录
- 1970-1-1
|
发表于 2004-8-27 23:03:38
|
显示全部楼层
[php] #initclip 3
function NavButton() {
this.init();
}
NavButton.prototype = new MovieClip ();
Object.registerClass("NavButton", NavButton);
NavButton.prototype.init = function () {
var _local1 = this;
_local1.nextDepth = 10;
_local1.label = ((_local1.label == undefined) ? "button" : (_local1.label));
_local1.createTextField("btnLabel", _local1.nextDepth++, 1, 0, 0, 0);
var btnLabel = _local1.btnLabel;
btnLabel._x = 8;
btnLabel._y = 7;
btnLabel.text = _local1.label;
btnLabel.autoSize = true;
var _local3 = new TextFormat ();
_local3.font = _local1.fontFace;
_local3.size = _local1.fontSize;
_local3["color"] = 0;
_local1.btnLabel.setTextFormat(_local3);
_local1.drawTab();
_local1.attachMovie("invisibleBtn", "bg", 1);
var _local2 = _local1.bg;
_local2._x = 0;
_local2._y = 0;
_local2._width = _local1.tab._width;
_local2._height = 32;
_local2._alpha = 0;
};
NavButton.prototype.onKeyDown = function () {
if (Key.getCode() == 40) {
var subnav = this._parent[this.subnavName];
var subnavBtn = subnav.btn0;
if (subnavBtn != undefined) {
Selection.setFocus(eval (subnavBtn));
}
}
};
NavButton.prototype.drawTab = function () {
var _local2 = this;
var parent = ((_local2.id == "Search") ? (_local2._parent._parent) : (_local2._parent));
_local2.tab = parent["tabHolder" + _local2.id];
var _local1 = _local2.tab;
var _local3 = false;
var tabLeft = (_local3 ? "pillNavLeft" : "navLeft");
var tabMiddle = (_local3 ? "pillNavMiddle" : "navMiddle");
var tabRight = (_local3 ? "pillNavRight" : "navRight");
_local1.attachMovie(tabLeft, "btnLeft", 1);
_local1.attachMovie(tabMiddle, "btnMiddle", 2);
_local1.btnMiddle._x = _local1.btnLeft._x + _local1.btnLeft._width;
_local1.btnMiddle._width = _local2.btnLabel._width;
_local1.attachMovie(tabRight, "btnRight", 3);
_local1.btnRight._x = _local1.btnMiddle._x + _local1.btnMiddle._width;
_local1._x = _local2.x;
_local1._y = _local2.y;
if (_local2.id == 0) {
_local1._x = _local1._x - 4;
}
_local1._alpha = 0;
};
NavButton.prototype.setTabPosition = function (obj) {
var _local1 = obj;
var _local2 = this.tab;
if (_local1.x != undefined) {
_local2._x = _local1.x;
}
if (_local1.y != undefined) {
_local2._y = _local1._y;
}
};
NavButton.prototype.onSetFocus = function () {
this._parent.tabEvent(this);
};
NavButton.prototype.onRollOver = function () {
this._parent.navEvent(this, "rollOver");
};
NavButton.prototype.onRollOut = function () {
this._parent.navEvent(this, "rollOut");
};
NavButton.prototype.onReleaseOutside = function () {
this._parent.navEvent(this, "rollOut");
};
NavButton.prototype.onRelease = function () {
this._parent.getOnReleaseFunc(this.url);
};
#endinitclip[/php]
第一帧动作脚本:
[php] this.locale = "中国";
this.welcomeGuestLabel = "来宾";
this.welcomeUserLabel = "欢迎,";
this.yourAccountLabel = "你的账户";
this.signInLabel = "登录";
this.signOutLabel = "登出";
this.intlLabel = "国际网站";
this.intlURL = "/go/gnav_intl_cn";
this.helpLabel = "帮助";
this.helpURL = "/go/gnav_help_cn";
this.searchLabel = "搜索";
this.homepageURL = "/go/gnav_home_cn";
this.flashMsgLabel_pre = "为尽可能确保最佳的 Internet 体验,请下载最新的";
this.flashBtnLabel = "Macromedia Flash Player";
this.flashMsgLabel_post = "播放器免费版本。";
this.flashBtnURL = "/go/gnavtray_dl_flashpl_cn";
this.membershipLink = "/go/gnav_your_account_cn";
this.searchLink = "/go/gnav_search?loc=zh_cn";
this.cartLink = "/go/gnav_cart_cn";
this.buttonArray = new Array ();
this.homeObj = new Object ();
this.homeObj.label = "首页";
this.homeObj.subnavName = "home";
this.homeObj.url = "/go/gnav_home_cn";
this.homeObj.tabStyle = "pill";
this.buttonArray.push(this.homeObj);
this.productObj = new Object ();
this.productObj.label = "产品";
this.productObj.subnavName = "products";
this.productObj.url = "/go/gnav_products_cn";
this.productObj.linkArray = new Array ();
this.productObj.linkArray.push({label:"产品首页", url:"/go/gnavtray_products_home_cn"});
this.productObj.linkArray.push({label:"Studio", url:"/go/gnavtray_studiomx_home_cn"});
this.productObj.linkArray.push({label:"Dreamweaver", url:"/go/gnavtray_dwmx_home_cn"});
this.productObj.linkArray.push({label:"Flash", url:"/go/gnavtray_flashmx_home_cn"});
this.productObj.linkArray.push({label:"ColdFusion*", url:"/go/gnavtray_cfmx_home_cn"});
this.productObj.linkArray.push({label:"Contribute*", url:"/go/gnavtray_contribute_home_cn"});
this.productObj.linkArray.push({label:"Breeze*", url:"/go/gnavtray_breeze_home_cn"});
this.productObj.linkArray.push({label:"Director*", url:"/go/gnavtray_director_home_cn"});
this.productObj.linkArray.push({label:"Flex", url:"/go/gnavtray_flex_home_cn"});
this.productObj.linkArray.push({label:"产品购买", url:"/go/gnavtray_products_buy_cn"});
this.productObj.linkArray.push({label:"更多信息 ?", url:"/go/gnavtray_products_more_cn"});
this.buttonArray.push(this.productObj);
this.showcaseObj = new Object ();
this.showcaseObj.label = "应用案例";
this.showcaseObj.subnavName = "showcase";
this.showcaseObj.url = "/go/gnav_showcase_cn";
this.showcaseObj.linkArray = new Array ();
this.showcaseObj.linkArray.push({label:"应用案例首页", url:"/go/gnavtray_showcase_home_cn"});
this.showcaseObj.linkArray.push({label:"成功应用案例*", url:"/go/gnavtray_show_csp_cn"});
this.showcaseObj.linkArray.push({label:"更多信息 ?", url:"/go/gnavtray_showcase_more_cn"});
this.buttonArray.push(this.showcaseObj);
this.supportObj = new Object ();
this.supportObj.label = "技术支持";
this.supportObj.subnavName = "support";
this.supportObj.url = "/go/gnav_support_cn";
this.supportObj.tabStyle = "pill";
this.buttonArray.push(this.supportObj);
this.devnetObj = new Object ();
this.devnetObj.label = "开发人员";
this.devNetObj.subnavName = "devnet";
this.devNetObj.url = "/go/gnav_devnet_cn";
this.devnetObj.linkArray = new Array ();
this.devnetObj.linkArray.push({label:"开发人员首页", url:"/go/gnavtray_devnet_cn"});
this.devnetObj.linkArray.push({label:"DevNet 订阅", url:"/go/gnavtray_dev_subscriptions_home_cn"});
this.devnetObj.linkArray.push({label:"Exchange", url:"/go/gnavtray_dev_exchange_home_cn"});
this.devnetObj.linkArray.push({label:"更多信息 ?", url:"/go/gnavtray_devnet_more_cn"});
this.buttonArray.push(this.devnetObj);
this.solutionsObj = new Object ();
this.solutionsObj.label = "解决方案";
this.solutionsObj.subnavName = "solutions";
this.solutionsObj.url = "/go/gnav_solutions_cn";
this.solutionsObj.linkArray = new Array ();
this.solutionsObj.linkArray.push({label:"解決方案首页", url:"/go/gnavtray_sol_home_cn"});
this.solutionsObj.linkArray.push({label:"合作伙伴", url:"/go/gnavtray_sol_partners_cn"});
this.solutionsObj.linkArray.push({label:"辅助功能", url:"/go/gnavtray_sol_access_cn"});
this.solutionsObj.linkArray.push({label:"eLearning*", url:"/go/gnavtray_sol_elearning_cn"});
this.solutionsObj.linkArray.push({label:"更多信息 ?", url:"/go/gnavtray_sol_more_cn"});
this.buttonArray.push(this.solutionsObj);
this.downloadsObj = new Object ();
this.downloadsObj.label = "下载中心";
this.downloadsObj.subnavName = "downloads";
this.downloadsObj.url = "/go/gnav_downloads_cn";
this.downloadsObj.linkArray = new Array ();
this.downloadsObj.linkArray.push({label:"下载中心首页", url:"/go/gnav_downloads_cn"});
this.downloadsObj.linkArray.push({label:"产品升级", url:"/go/gnavtray_dl_updates_cn"});
this.downloadsObj.linkArray.push({label:"下载 Flash Player", url:"/go/gnavtray_dl_flashpl_cn"});
this.downloadsObj.linkArray.push({label:"Macromedia Exchange", url:"/go/gnavtray_dl_ex_home_cn"});
this.downloadsObj.linkArray.push({label:"更多信息 ?", url:"/go/gnav_downloads_cn"});
this.buttonArray.push(this.downloadsObj);
this.companyObj = new Object ();
this.companyObj.label = "关于我们";
this.companyObj.subnavName = "company";
this.companyObj.url = "/go/gnav_company_cn";
this.companyObj.linkArray = new Array ();
this.companyObj.linkArray.push({label:"关于我们首页", url:"/go/gnavtray_company_home_cn"});
this.companyObj.linkArray.push({label:"新闻中心", url:"/go/gnavtray_company_news_cn"});
this.companyObj.linkArray.push({label:"投资回报*", url:"/go/gnavtray_company_investor_cn"});
this.companyObj.linkArray.push({label:"社区事务*", url:"/go/gnavtray_company_community_cn"});
this.companyObj.linkArray.push({label:"职位招聘*", url:"/go/gnavtray_company_jobs_cn"});
this.companyObj.linkArray.push({label:"市场活动", url:"/go/gnavtray_company_events_cn"});
this.companyObj.linkArray.push({label:"联系我们", url:"/go/gnavtray_company_contact_cn"});
this.companyObj.linkArray.push({label:"更多信息 ?", url:"/go/gnavtray_company_more_cn"});
this.buttonArray.push(this.companyObj);
this.storeObj = new Object ();
this.storeObj.label = "产品购买";
this.storeObj.subnavName = "store";
this.storeObj.url = "/go/gnav_store_cn";
this.storeObj.tabStyle = "pill";
this.buttonArray.push(this.storeObj);
this.isFR = false;
this.isJP = false;
this.isKR = false;
this.isZH = true;
var version = System.capabilities.version.split(" ");
this.bMac = ((version[0] == "MAC") ? true : false);
this.fpVersion = version[1];
var ver = version[1].split(",");
this.majorVer = ver[0];
this.minorVer = ver[2];
this.tabSpacing = -4;
if (this.isJP) {
this.fontFace = "_sans";
this.fontSize = 10;
this.navFontSize = 11;
} else if (this.isKR) {
if (this.bMac) {
this.fontFace = "AppleGothic";
this.fontSize = 11;
this.navFontSize = 12;
} else {
this.fontFace = "_sans";
this.fontSize = 11;
this.navFontSize = 12;
}
} else if (this.isZH) {
this.fontFace = "_sans";
this.fontSize = 11;
this.navFontSize = 12;
} else {
this.fontFace = "Verdana";
this.fontSize = 9;
this.navFontSize = 10;
}
this.bShowLocaleLabel = ((this.isJP || (this.isKR)) ? false : true);
this.fpReqMajor = ((this.fpReqMajor == undefined) ? 6 : (this.fpReqMajor));
this.fpReqMinor = ((this.fpReqMinor == undefined) ? 65 : (this.fpReqMinor));
this.bCartEnabled = false;
this.bSmartCartEnabled = false;
this.bSetFlash = false;
this.search_mc._visible = false;
this.bCartListener = false;
this.bTrapEnter = ((this.isJP == true) ? false : true);
this.init = function () {
var _local1 = this;
var _local2 = _global;
_local1.bMaximized = true;
_local1.tf = new TextFormat ();
_local1.tf.font = _local1.fontFace;
_local1.tf.size = _local1.fontSize;
_local1.tf["color"] = 16777215 /* 0xFFFFFF */;
_local1.nextDepth = 10;
_local1.currentNav = null;
_local1.newNav = null;
_local1.bSubActive = false;
_local1.ticks = 0;
_local1.width = 756;
_local1.fadeInAmt = ((_local1.bMac || (_local1.bAppView)) ? 2 : 4);
_local1.fadeOutAmt = ((_local1.bMac || (_local1.bAppView)) ? 2 : 6);
if (_level0 == _local1) {
_local1.inShell = false;
_local1.loc = _local1.loc.toLowerCase();
if (_local1.loc == undefined) {
_local1.loc = "en_us";
}
_local2.requestVars = new Object ();
_local1.cr = "";
} else {
_local1.inShell = true;
if (_local1.homepage == "true") {
_local1.isHomepage = true;
_local1.loc = _level0.loc.toLowerCase();
} else {
_local1.loc = _local2.requestVars.loc.toLowerCase();
}
if (_local1.loc == undefined) {
_local1.loc = "en_us";
}
_local1.cr = "";
}
if (_local2.focusRect_obj == undefined) {
_local1.addFocusListener();
}
_local1.macromediaLogo.onRelease = function () {
this._parent.getOnReleaseFunc(this._parent.homepageURL);
};
if (_local1.bSetFlash == true) {
clearInterval(_local1.setFlashID);
_local1.setFlashID = setInterval(_local1, "setFlash", 15000);
}
_local1.layout();
_local1.configureSearch();
};
this.addFocusListener = function () {
_focusrect = false;
_global.focusRect_obj = new Object ();
focusRect_obj.onSetFocus = function (oldFocus, newFocus) {
var _local1 = newFocus;
if (_local1.myOnSetFocus == undefined) {
_local1.createEmptyMovieClip("focusRect", 16001);
Drawing.drawHaloFocusRect(_local1.focusRect, 0, -2, _local1._width, _local1._height + 4);
}
oldFocus.focusRect.removeMovieClip();
};
Selection.addListener(focusRect_obj);
};
this.setFlash = function () {
clearInterval(this.setFlashID);
getURL (("javascript:setFlash(\'" + this.fpVersion) + "\');");
};
this.configureSearch = function () {
var _local1 = this;
var searchInput = _local1.search_mc.searchInput;
var searchBG = _local1.search_mc.searchBG;
searchBG.setStatus = function (state) {
var _local1 = this;
var _local2 = state;
_local1.left.gotoAndStop(_local2);
_local1.middle.gotoAndStop(_local2);
_local1.right.gotoAndStop(_local2);
};
searchInput.onSetFocus = function () {
this._parent.searchBG.setStatus("selected");
};
searchInput.onKillFocus = function () {
var _local1 = this;
if (_local1.text != "") {
_local1._parent.searchBG.setStatus("filled");
} else {
_local1._parent.searchBG.setStatus("active");
}
};
if (_local1.isJP == true) {
var jpTF = new TextFormat ();
jpTF.font = "_sans";
jpTF.size = 12;
searchInput.setNewTextFormat(jpTF);
}
var _local2 = new Object ();
_local2.label = _local1.searchLabel;
_local2.tabStyle = "bluePill";
_local2.fontFace = _local1.fontFace;
_local2.fontSize = _local1.navFontSize;
_local2.id = "Search";
_local2.x = 0;
_local2.y = _local1.topTray._y;
_local1.search_mc.attachMovie("NavButton", "search", 10, _local2);
var searchBtn = _local1.search_mc.search;
searchBtn._x = (searchInput._x + searchInput._width) + 3;
searchBtn._y = 0;
searchBtn.onRollOver = function () {
var _local1 = this;
Animation.tween(_local1.tab, "_alpha", _local1.tab._alpha, 100, _local1._parent._parent.fadeInAmt, "exp");
};
searchBtn.onRollOut = function () {
var _local1 = this;
Animation.tween(_local1.tab, "_alpha", _local1.tab._alpha, 0, _local1._parent._parent.fadeOutAmt, "exp");
};
searchBtn.onReleaseOutside = function () {
var _local1 = this;
Animation.tween(_local1.tab, "_alpha", _local1.tab._alpha, 0, _local1._parent._parent.fadeOutAmt, "exp");
};
searchBtn.onRelease = function () {
var _local2 = this;
var _local1 = (_local2._parent._parent.searchLink + "&term=") + escape(_local2._parent.searchInput.text);
_local2._parent._parent.getOnReleaseFunc(_local1);
};
var searchTab = searchBtn.tab;
if (_local1.bTrapEnter) {
_local1.gnavkeyListener = new Object ();
_local1.gnavkeyListener.controller = _local1;
_local1.gnavkeyListener.onKeyDown = function () {
var _local3 = this;
var _local1 = Selection.getFocus();
if (Key.isDown(13) && ((_local1 == "_level0.globalnav.search_mc.searchInput") || (_local1 == "_level0.search_mc.searchInput"))) {
var _local2 = (_local3.controller.searchLink + "&term=") + escape(_local3.controller.search_mc.searchInput.text);
var enactSearch = _local3.controller.getOnReleaseFunc(_local2);
enactSearch();
}
};
}
Key.addListener(_local1.gnavkeyListener);
var _local3 = _local1.search_mc;
_local3._x = _local1.width - (_local3._width + 8);
_local1.search_mc.search.setTabPosition({x:_local3._x + _local3.search._x});
var lastBtn = _local1["btn" + (_local1.buttonArray.length - 1)];
var searchX = (lastBtn._x + lastBtn._width);
var offsetX = ((searchX > _local3._x) ? (searchX - _local3._x) : 0);
if (offsetX > 0) {
_local3.div._x = _local3.div._x + offsetX;
searchInput._width = searchInput._width - offsetX;
searchInput._x = searchInput._x + offsetX;
searchBG.left._x = searchBG.left._x + offsetX;
searchBG.middle._width = searchBG.middle._width - offsetX;
searchBG.middle._x = searchBG.middle._x + offsetX;
searchBG.right._x = searchBG.middle._x + searchBG.middle._width;
}
_local3._visible = true;
};
this.onStoreLoaded = function () {
var _local1 = this;
if (((_local1.bCartListener != true) && (_local1.bCartEnabled)) && (_local1.bSmartCartEnabled)) {
_global.store.cart.addListener(_local1);
_local1.bCartListener = true;
}
};
this.layout = function () {
var _local1 = this;
var btnY = _local1.topTray._y;
var divY = (_local1.topTray._y + 8);
var subY = ((_local1.topTray._y + _local1.topTray._height) + 4);
var tabSpacing = ((_local1.tabSpacing == undefined) ? 1 : (_local1.tabSpacing));
if ((_local1.localeLabel != undefined) || (_local1.bShowLocaleLabel == true)) {
_local1.createTextField("localeLabel", _local1.nextDepth++, (_local1.macromediaLogo._x + _local1.macromediaLogo._width) + 12, 8, 100, 12);
var localeLbl = _local1.localeLabel;
localeLbl.text = _local1.locale;
localeLbl.autoSize = true;
localeLbl.setTextFormat(_local1.tf);
}
_local1.layoutUtil();
_local1.attachMovie("invisibleBtn", "bottomTray", _local1.nextDepth++);
var tray = _local1.bottomTray;
tray._x = 0;
tray._y = _local1.topTray._y + _local1.topTray._height;
tray._height = _local1._height - tray._y;
tray._width = _local1._width;
tray._alpha = 0;
var len = _local1.buttonArray.length;
var _local2 = 0;
while (_local2 < len) {
var _local3 = _local1["div" + (_local2 - 1)];
var divDepth = (_local1.nextDepth++);
var btnDepth = (_local1.nextDepth++);
_local1.buttonArray[_local2].fontFace = _local1.fontFace;
_local1.buttonArray[_local2].fontSize = _local1.navFontSize;
_local1.buttonArray[_local2].id = _local2;
_local1.buttonArray[_local2].x = ((_local2 == 0) ? 12 : ((_local3._x + _local3._width) + tabSpacing));
_local1.buttonArray[_local2].y = btnY;
_local1.attachMovie("NavButton", "btn" + _local2, btnDepth, _local1.buttonArray[_local2]);
var btn = _local1["btn" + _local2];
bnt.bIsNav = true;
btn._x = ((_local2 == 0) ? 8 : ((_local3._x + _local3._width) + tabSpacing));
btn._y = btnY;
if (_local2 < (len - 1)) {
_local1.attachMovie("navDivider", "div" + _local2, divDepth);
var div = _local1["div" + _local2];
div._x = (btn._x + btn._width) + tabSpacing;
div._y = divY;
}
if (_local1.buttonArray[_local2].linkArray.length > 0) {
_local1["btn" + _local2].bHasSubnav = true;
_local1.attachMovie("SubNav", "sub" + _local2, _local1.nextDepth++, _local1.buttonArray[_local2]);
var sub = _local1["sub" + _local2];
sub._y = subY;
_local1[_local1.buttonArray[_local2].subnavName] = sub;
} else {
_local1["btn" + _local2].bHasSubnav = false;
}
_local2++;
}
if ((_local1.majorVer < _local1.fpReqMajor) || ((_local1.majorVer == _local1.fpReqMajor) && (_local1.minorVer < _local1.fpReqMinor))) {
_local1.showFlashMessaging();
}
_local1.createEmptyMovieClip("mask", _local1.nextDepth++);
var clip = _local1.mask;
clip.clear();
clip.moveTo(0, 0);
clip.beginFill(7504523);
clip.lineTo(_local1._width, 0);
clip.lineTo(_local1._width, _local1.bottomTray._height);
clip.lineTo(0, _local1.bottomTray._height);
clip.lineTo(0, 0);
clip.endFill();
clip._y = _local1.bottomTray._y;
clip._visible = false;
_local1.mask.onTween = function () {
if (this._alpha == 0) {
this._visible = false;
}
};
_local1.checkForServicesAvailable();
};
this.layoutUtil = function () {
var _local1 = this;
_local1.attachMovie("SubNavButton", "helpButton", _local1.nextDepth++, {label:_local1.helpLabel, url:_local1.helpURL, gn:_local1, fontFace:_local1.fontFace, fontSize:_local1.fontSize});
var _local2 = _local1.helpButton;
_local2._x = (_local1._width - 16) - _local2._width;
_local2._y = 8;
var helpDiv = _local1.attachMovie("subDivider", "helpDivider", _local1.nextDepth++);
helpDiv._x = _local2._x;
helpDiv._y = 10;
_local1.attachMovie("SubNavButton", "intlButton", _local1.nextDepth++, {label:_local1.intlLabel, url:_local1.intlURL, gn:_local1, fontFace:_local1.fontFace, fontSize:_local1.fontSize});
var _local3 = _local1.intlButton;
_local3._x = helpDiv._x - _local3._width;
_local3._y = 8;
var intlDiv = _local1.attachMovie("subDivider", "intlDivider", _local1.nextDepth++);
intlDiv._x = _local3._x;
intlDiv._y = 10;
if (_local1.bCartEnabled == true) {
_local1.layoutCart();
}
_local1.utilDivider = ((_local1.bCartEnabled == true) ? (_local1.cartDivider) : (intlDiv));
_local1.utilDivider._visible = false;
};
this.layoutCart = function () {
var _local1 = this;
_local1.createEmptyMovieClip("cartButton", _local1.nextDepth++);
var _local2 = _local1.cartButton;
_local2.attachMovie("cartEmpty", "empty", 1);
_local2.attachMovie("cartFilled", "full", 2);
_local2.full._visible = false;
if (_local1.bAppView && (_local1.bSmartCartEnabled)) {
_local1.tfCart = new TextFormat ();
_local1.tfCart.font = _local1.fontFace;
_local1.tfCart.size = _local1.fontSize;
_local1.tfCart["color"] = 17527;
_local2.createTextField("cartCount", _local1.nextDepth++, 20, -2, 100, 12);
var _local3 = _local2.cartCount;
_local3.text = 0;
_local3.autoSize = true;
_local3.setTextFormat(_local1.tfCart);
}
_local2._x = _local1.intlDivider._x - (_local2._width + 16);
_local2._y = 10;
var cartDiv = _local1.attachMovie("subDivider", "cartDivider", _local1.nextDepth++);
cartDiv._x = _local2._x - 16;
cartDiv._y = 10;
_local2.onRelease = function () {
this._parent.getOnReleaseFunc(this._parent.cartLink);
};
};
this.updateCart = function () {
var _local1 = this;
var _local2 = _local1.cartButton;
var cartCount = _local1.cartButton.cartCount;
var empty = _local1.cartButton.empty;
var _local3 = _local1.cartButton.full;
cartCount.text = _local1.itemsInCart;
cartCount.setTextFormat(_local1.tfCart);
_local3._visible = _local1.itemsInCart > 0;
empty._visible = !_local3._visible;
_local2._x = (_local1.intlDivider._x - ((_local1.intlDivider._x - _local1.cartDivider._x) / 2)) - (_local2._width / 2);
};
this.layoutUserDataMinimal = function () {
var _local1 = this;
if (_local1.account_mc != undefined) {
_local1.account_mc.removeMovieClip();
}
_local1.createEmptyMovieClip("account_mc", _local1.nextDepth++);
var _local3 = _local1.account_mc;
_local1.utilDivider._visible = true;
_local3.attachMovie("SubNavButton", "yourAccountButton", _local1.nextDepth++, {label:_local1.yourAccountLabel, url:_local1.membershipLink, fontFace:_local1.fontFace, fontSize:_local1.fontSize});
var _local2 = _local3.yourAccountButton;
_local2._x = _local1.utilDivider._x - _local2._width;
_local2._y = 8;
_local1.setTabOrder(_local1.startIndex);
};
this.layoutUserDataLoggedIn = function () {
var _local1 = this;
if (_local1.isJP == true) {
_local1.layoutUserDataMinimal();
} else {
if (_local1.account_mc != undefined) {
_local1.account_mc.removeMovieClip();
}
_local1.createEmptyMovieClip("account_mc", _local1.nextDepth++);
var _local2 = _local1.account_mc;
_local1.utilDivider._visible = true;
_local2.attachMovie("SubNavButton", "signoutButton", _local1.nextDepth++, {label:_local1.signOutLabel, url:_local1.membershipLink, fontFace:_local1.fontFace, fontSize:_local1.fontSize});
var signoutBtn = _local2.signoutButton;
signoutBtn._x = _local1.utilDivider._x - signoutBtn._width;
signoutBtn._y = 8;
signoutBtn.onRelease = function () {
this._parent._parent.signOut();
};
_local1.logout_Result = function () {
var _local2 = this;
if (_local2.homepageURL != undefined) {
var _local1 = _local2.getOnReleaseFunc(_local2.homepageURL);
_local1();
}
};
_local1.signOut = function () {
this.remoteMembershipService.logout();
};
_local2.attachMovie("SubNavButton", "yourAccountButton", _local1.nextDepth++, {label:_local1.yourAccountLabel, url:_local1.membershipLink, fontFace:_local1.fontFace, fontSize:_local1.fontSize});
var _local3 = _local2.yourAccountButton;
_local3._x = (signoutBtn._x - 6) - _local3._width;
_local3._y = 8;
_local2.createTextField("welcomeMessage", _local1.nextDepth++, _local3._x - 5, 8, 100, 12);
var welcomeMsg = _local2.welcomeMessage;
welcomeMsg.text = _local1.nickname;
welcomeMsg.autoSize = true;
welcomeMsg.setTextFormat(_local1.tf);
welcomeMsg._x = (_local3._x - 5) - welcomeMsg._width;
_local1.setLogInComplete(true);
_local1.setTabOrder(_local1.startIndex);
}
};
this.layoutUserDataLoggedOut = function () {
var _local1 = this;
if (_local1.isJP == true) {
_local1.layoutUserDataMinimal();
} else {
if (_local1.account_mc != undefined) {
_local1.account_mc.removeMovieClip();
}
_local1.createEmptyMovieClip("account_mc", _local1.nextDepth++);
var acc = _local1.account_mc;
_local1.utilDivider._visible = true;
acc.attachMovie("SubNavButton", "signinButton", _local1.nextDepth++, {label:_local1.signInLabel, url:_local1.membershipLink, fontFace:_local1.fontFace, fontSize:_local1.fontSize});
var _local2 = acc.signinButton;
_local2._x = _local1.utilDivider._x - _local2._width;
_local2._y = 8;
_local2.onRelease = function () {
this._parent._parent.getOnReleaseFunc(this._parent._parent.membershipLink);
};
acc.createTextField("welcomeMessage", _local1.nextDepth++, accountBtn._x - 5, 8, 100, 12);
var _local3 = acc.welcomeMessage;
_local3.text = (_local1.welcomeUserLabel + " ") + _local1.welcomeGuestLabel;
_local3.autoSize = true;
_local3.setTextFormat(_local1.tf);
_local3._x = (_local2._x - 5) - _local3._width;
_local1.setLogInComplete(false);
_local1.setTabOrder(_local1.startIndex);
}
};
this.minimize = function (bMinimize) {
var _local2 = this;
var _local3 = !bMinimize;
_local2.bMaximized = _local3;
_local2.topTray._visible = _local3;
_local2.search_mc._visible = _local3;
_local2.bg._visible = _local3;
_local2.mask._visible = _local3;
_local2.mask._x = (_local3 ? 0 : 1600);
var len = _local2.buttonArray.length;
var _local1 = 0;
while (_local1 < len) {
_local2["btn" + _local1]._visible = _local3;
_local2["btn" + _local1].tab._visible = _local3;
_local2["div" + _local1]._visible = _local3;
if (bMinimize) {
_local2["sub" + _local1]._visible = false;
}
_local1++;
}
};
this.showFlashMessaging = function () {
var _local1 = this;
_local1.createEmptyMovieClip("flashMessaging_mc", _local1.nextDepth++);
var _local2 = _local1.flashMessaging_mc;
_local2._x = 0;
_local2._y = _local1.topTray._y + _local1.topTray._height;
_local2._visible = true;
var _local3 = _local2.attachMovie("gfIcon", "gfIcon_mc", 8);
_local3._x = 10;
_local3._y = 0;
_local3.arrow_mc.arrowMoveCount = 0;
_local3.arrow_mc.gn = _local1;
_local1.moveArrow = function () {
clearInterval(this.gfID);
var _local1 = this.flashMessaging_mc.gfIcon_mc.arrow_mc;
Animation.tween(_local1, "_x", 1, 12, 72, "exp");
};
_local1.resetArrow = function () {
this.flashMessaging_mc.gfIcon_mc.arrow_mc._x = 1;
};
_local3.arrow_mc.onTween = function () {
var _local1 = this;
if (_local1.arrowMoveCount < 1) {
_local1.arrowMoveCount++;
clearInterval(_local1.gn.gfID);
_local1.gn.gfID = setInterval(_local1.gn, "moveArrow", 600);
} else {
_local1.arrowMoveCount = 0;
}
};
_local1.moveArrow();
_local2.createTextField("msgPre_mc", 10, (_local3._x + _local3._width) + 3, 2, 100, 12);
var msgPre = _local2.msgPre_mc;
msgPre.text = _local1.flashMsgLabel_pre;
msgPre.autoSize = true;
msgPre.setTextFormat(_local1.tf);
_local2.attachMovie("SubNavButton", "getFlashBtn", 12, {label:_local1.flashBtnLabel, url:_local1.flashBtnURL, fontFace:_local1.fontFace, fontSize:_local1.fontSize});
var flBtn = _local2.getFlashBtn;
flBtn.hilight.left._x = flBtn.hilight.left._x + 6;
flBtn.hilight.right._x = flBtn.hilight.right._x - 4;
flBtn._x = (msgPre._x + msgPre._width) - 7;
flBtn._y = 2.5;
if (_local1.flashMsgLabel_post != undefined) {
_local2.createTextField("msgPost_mc", 13, (flBtn._x + flBtn._width) + 4, 2, 100, 12);
var msgPost = _local2.msgPost_mc;
msgPost.text = _local1.flashMsgLabel_post;
msgPost.autoSize = true;
msgPost.setTextFormat(_local1.tf);
if (_local1.flashMsgLabel_post == ".") {
msgPost._x = msgPost._x - 4;
}
}
};
this.showNav = function (bShow) {
var _local1 = this;
var tab = _local1.currentNav.tab;
var finalVal = ((bShow == true) ? 100 : 0);
var numFrames = ((bShow == true) ? (_local1.fadeInAmt) : (_local1.fadeOutAmt));
Animation.tween(tab, "_alpha", tab._alpha, finalVal, numFrames, "exp");
var sub = _local1[_local1.currentNav.subnavName];
sub._visible = bShow;
var _local3 = _local1.flashMessaging_mc;
if (_local3 != undefined) {
if (_local1.currentNav.tabStyle == "pill") {
_local3._visible = true;
} else {
_local3._visible = !bShow;
if (!bShow) {
_local1.moveArrow();
} else {
_local1.resetArrow();
}
}
}
if (_local1.currentNav.tabStyle != "pill") {
var _local2 = _local1.mask;
_local2._visible = true;
var numFrames = ((_local1.isHomepage && (_local1.bMac)) ? (_local1.fadeInAmt) : (_local1.fadeInAmt * 3));
_local2._alpha = 100;
Animation.tween(_local2, "_alpha", _local2._alpha, 0, numFrames, "circ");
}
};
this.navEvent = function (btn, event) {
var _local1 = this;
var _local2 = btn;
var _local3 = event;
var mouseY = _local1._ymouse;
var tray = _local1.bottomTray;
if ((_local3 == "rollOver") && (_local1.currentNav == null)) {
_local1.currentNav = _local2;
_local1.newNav = null;
_local1.showNav(true);
} else if ((_local3 == "rollOver") && (_local2 != _local1.currentNav)) {
Animation.tween(_local2.tab, "_alpha", _local2.tab._alpha, 24, _local1.fadeInAmt, "exp");
_local1.newNav = _local2;
} else if ((((_local3 == "rollOut") && (mouseY < _local2._y)) || (_local2.tabStyle == "pill")) && (!_local1.bSubFocus)) {
Animation.tween(_local2.tab, "_alpha", _local2.tab._alpha, 0, _local1.fadeOutAmt, "exp");
_local1.killCurrentNav();
} else if (((_local3 == "rollOut") && (_local2 != _local1.currentNav)) && (!_local1.bSubFocus)) {
Animation.tween(_local2.tab, "_alpha", _local2.tab._alpha, 0, _local1.fadeOutAmt, "exp");
return;
}
};
this.onMouseMove = function () {
var _local1 = this;
clearInterval(_local1.moveID);
_local1.moveID = setInterval(_local1, "onMouseStop", 100);
};
this.onMouseStop = function () {
var _local1 = this;
clearInterval(_local1.moveID);
var mouseX = _local1._xmouse;
var _local3 = _local1._ymouse;
var _local2 = _local1.bottomTray;
var bOverTray = ((((mouseX > _local2._x) && (mouseX < (_local2._x + _local2._width))) && (_local3 > _local2._y)) && (_local3 < ((_local2._y + _local2._height) - 10)));
var current = _local1.currentNav;
var bOverBtn = ((((mouseX > current._x) && (mouseX < ((current._x + current._width) - 5))) && (_local3 >= current._y)) && (_local3 < (current._y + current._height)));
var newBtn = _local1.newNav;
var bOverNew = ((((mouseX > newBtn._x) && (mouseX < (newBtn._x + newBtn._width))) && (_local3 > newBtn._y)) && (_local3 < (newBtn._y + newBtn._height)));
if (bOverTray || (bOverBtn)) {
if (!bOverNew) {
_local1.newNav = null;
}
} else if (bOverNew) {
_local1.killCurrentNav(_local1.newNav);
_local1.showNav(true);
} else if ((_local3 > ((_local2._y + _local2._height) - 8)) && (!_local1.bSubActive)) {
clearInterval(_local1.idleID);
_local1.idleID = setInterval(_local1, "onMouseIdle", 1000);
} else if (!_local1.bSubActive) {
if (_local1.currentNav != null) {
_local1.killCurrentNav();
return;
}
}
};
this.onMouseIdle = function () {
var _local1 = this;
clearInterval(_local1.idleID);
var _local3 = _local1._ymouse;
var _local2 = _local1.bottomTray;
if (((_local3 > ((_local2._y + _local2._height) - 8)) && (!_local1.bSubActive)) && (_local1.currentNav != null)) {
_local1.killCurrentNav();
return;
}
};
this.killCurrentNav = function (newNav) {
var _local1 = this;
if (_local1.bSubFocus) {
} else {
_local1.showNav(false);
_local1.currentNav = null;
_local1.newNav = null;
if (newNav != undefined) {
_local1.currentNav = newNav;
}
return;
}
};
this.tabEvent = function (btn) {
var _local1 = this;
clearInterval(_local1.idleID);
_local1.killCurrentNav(btn);
_local1.showNav(true);
_local1.setTabOrder(_local1.startIndex);
};
this.getOnReleaseFunc = function (URL) {
if (this.inShell) {
_level0.mmViewManager.createView(URL);
} else {
getURL (URL, "_self");
}
};
this.setLogInComplete = function (bLoggedIn) {
var _local1 = this;
if (_local1.Status == undefined) {
_local1.Status = new Object ();
}
_local1.isLoggedIn = bLoggedIn;
_local1.Status.isLoggedIn = _local1.isLoggedIn;
if (_level0.mmMemoryManager != undefined) {
_level0.mmMemoryManager.writeSharedData("UserStatus", _local1.Status);
}
};
this.setLogIn = function (bLoggedIn) {
var _local1 = this;
if (bLoggedIn) {
_local1.remoteNavService.getNavData();
} else if (_local1.isLoggedIn) {
_local1.layoutUserDataLoggedOut();
}
};
this.getRemotingData = function () {
var _local1 = this;
if (_local1.isHomepage || (!_local1.bAppView)) {
_local1.getNavData_Status();
} else if (_local1.remoteNavService == undefined) {
if (!_local1.inShell) {
_local1.gatewayURL = _level0.gatewayURL;
NetServices.setDefaultGatewayUrl(_local1.gatewayURL);
_local1.connection = NetServices.createGatewayConnection();
} else if (_local1.inShell) {
_local1.connection = _level0.mmLocaleManager.getLocalizedGatewayConnection();
}
_local1.remoteMembershipService = _local1.connection.getService("membership.membershiphub", _local1);
_local1.remoteNavService = _local1.connection.getService("nav.navservice", _local1);
if (_local1.remoteNavService != undefined) {
_local1.remoteNavService.getNavData();
} else {
_local1.getNavData_Status();
}
}
};
this.onServicesAvailable = function () {
var _local1 = this;
if (_local1.waitingForServices == true) {
_local1.getRemotingData();
} else {
_local1.servicesAvailable = true;
}
};
this.checkForServicesAvailable = function () {
var _local1 = this;
if ((!_local1.inShell) && (_local1.bAppView)) {
_local1.createEmptyMovieClip("localeManager", _local1.nextDepth++);
_local1.createEmptyMovieClip("d65net", _local1.nextDepth++);
_local1.localeManager.loadMovie("/swf/lib/d65localemanager.swf");
if (!_local1.isHomepage) {
_local1.d65net.loadMovie("/swf/lib/d65net.swf");
}
var bOldPlayer = ((_local1.majorVer <= 6) && (_local1.minorVer <= 65));
var times = 0;
_local1.onEnterFrame = function () {
var _local1 = this;
var _local3 = _local1.localeManager.getBytesTotal() + _local1.d65net.getBytesTotal();
var _local2 = _local1.localeManager.getBytesLoaded() + _local1.d65net.getBytesLoaded();
if (((_local2 > 10) && (_local2 >= _local3)) && (NetServices.createGatewayConnection != undefined)) {
_level0.mmLocaleManager = new classes.shell.LocaleManager();
_level0.mmLocaleManager.setLocale(_local1.loc);
_local1.getRemotingData();
_local1.onEnterFrame = null;
}
times++;
if (((times >= 200) && (_local2 < 10)) || (bOldPlayer)) {
_local1.layoutUserDataMinimal();
_local1.onEnterFrame = null;
}
};
} else if (_local1.bAppView) {
_local1.servicesAvailable = _global.servicesAvailable;
if (_local1.servicesAvailable) {
_local1.getRemotingData();
} else {
_local1.waitingForServices = true;
}
} else {
_local1.layoutUserDataMinimal();
}
_level0.onNavLoad();
};
this.getNavData_Result = function (result) {
var _local1 = this;
var _local2 = result;
_local1.authLevel = _local2.authLevel;
if ((_local1.bCartEnabled == true) && (_local1.bSmartCartEnabled == true)) {
_local1.itemsInCart = _local2.itemsInCart;
if (_local1.itemsInCart == undefined) {
_local1.itemsInCart = 0;
}
_local1.updateCart();
}
_local1.nickName = "";
_local1.nickname = _local2.navGreeting;
_local1.storeID = _local2.storeID;
if ((_local1.authLevel == 1) || (_local1.authLevel == 2)) {
_local1.layoutUserDataLoggedIn();
} else {
_local1.layoutUserDataLoggedOut();
}
};
this.getNavData_Status = function (status) {
this.layoutUserDataMinimal();
};
this.setScreenName = function (result) {
this.remoteNavService.getNavData();
};
this.truncate = function (theString, len) {
var _local1 = theString;
var _local2 = len;
if (_local1.length > _local2) {
if (_local1.charAt(_local2) == " ") {
_local1 = _local1.substr(0, _local2) + " ...";
} else {
_local1 = _local1.substr(0, _local2) + "...";
}
}
return (_local1);
};
this.onCartEvent = function (obj) {
var _local1 = this;
_local1.itemsInCart = obj.itemCount;
if (_local1.bSmartCartEnabled) {
_local1.updateCart();
}
};
this.setTabOrder = function (startIndex) {
var _local2 = startIndex;
this.startIndex = _local2;
if (_local2 == undefined) {
_local2 = 1;
}
this.macromediaLogo.tabIndex = _local2++;
var acc = this.account_mc;
acc.yourAccountButton.tabIndex = _local2++;
acc.signoutButton.tabIndex = _local2++;
acc.signinButton.tabIndex = _local2++;
this.cartButton.tabIndex = _local2++;
this.intlButton.tabIndex = _local2++;
this.helpButton.tabIndex = _local2++;
var btnLen = this.buttonArray.length;
var _local1 = 0;
while (_local1 < btnLen) {
var btn = this["btn" + _local1];
btn.tabIndex = _local2++;
var _local3 = this["sub" + _local1];
if (_local3 != undefined) {
_local2 = _local3.setTabOrder(_local2++);
}
_local1++;
}
this.search_mc.searchInput.tabIndex = _local2++;
this.search_mc.search.tabIndex = _local2++;
this.flashMessaging_mc.getFlashBtn.tabIndex = _local2++;
return (_local2++);
};
this.minimizeBtn.onRelease = function () {
var _local1 = ((this._parent.bMaximized == true) ? true : false);
this._parent.minimize(_local1);
};
this.bAppView = (((this.appview == "true") || (this.htmlApp == "true")) ? true : false);
if ((!this.bAppView) || (this.htmlApp == "true")) {
this.createEmptyMovieClip("anim_mc", this.nextDepth++);
var animClip = this.anim_mc;
animClip.loadMovie("/swf/lib/d65anim.swf");
this.onEnterFrame = function () {
var _local2 = animClip.getBytesTotal();
var _local1 = animClip.getBytesLoaded();
if ((_local1 > 10) && (_local1 >= _local2)) {
this.onEnterFrame = null;
this.init();
}
};
} else {
this.init();
}[/php]
影片剪辑脚本:
[php] #initclip 1
function SubNavButton() {
this.init();
}
SubNavButton.prototype = new MovieClip ();
Object.registerClass("SubNavButton", SubNavButton);
SubNavButton.prototype.init = function () {
var _local1 = this;
_local1.nextDepth = 10;
_local1.gn = ((_local1.gn == undefined) ? (_local1._parent._parent) : (_local1.gn));
_local1.label = ((_local1.label == undefined) ? "button" : (_local1.label));
_local1.createTextField("btnLabel", _local1.nextDepth++, 1, 0, 0, 0);
_local1.btnLabel.text = _local1.label;
_local1.btnLabel.autoSize = true;
_local1.btnLabel.textColor = 16777215 /* 0xFFFFFF */;
_local1.btnLabel._x = 8;
var _local2 = new TextFormat ();
_local2.font = _local1.fontFace;
_local2.size = _local1.fontSize;
_local2.italic = ((_local1.navStyle == "italic") ? true : false);
_local1.btnLabel.setTextFormat(_local2);
_local1.createHilight();
};
SubNavButton.prototype.onKeyDown = function () {
var currentFocus = eval (Selection.getFocus());
var parent = this._parent;
var $parent = new String (parent);
if ((currentFocus == this) && ($parent.indexOf("sub") != -1)) {
var keypressed = Key.getCode();
var id = this.id;
if (keypressed == 39) {
if (parent["btn" + (id + 1)] != undefined) {
Selection.setFocus(parent["btn" + (id + 1)]);
} else {
Selection.setFocus(parent.btn0);
}
} else if (keypressed == 37) {
if (parent["btn" + (id - 1)] != undefined) {
Selection.setFocus(parent["btn" + (id - 1)]);
} else {
Selection.setFocus(parent["btn" + (this.btnCount - 1)]);
}
}
}
};
SubNavButton.prototype.onRollOver = function () {
this.hilight._visible = true;
this.gn.bSubActive = true;
};
SubNavButton.prototype.onRollOut = function () {
this.hilight._visible = false;
this.gn.bSubActive = false;
};
SubNavButton.prototype.onReleaseOutside = function () {
this.hilight._visible = false;
this.gn.bSubActive = false;
};
SubNavButton.prototype.onRelease = function () {
this.gn.getOnReleaseFunc(this.url);
};
SubNavButton.prototype.onSetFocus = function () {
this.gn.bSubFocus = true;
};
SubNavButton.prototype.onKillFocus = function () {
this.gn.bSubFocus = false;
};
SubNavbutton.prototype.createHilight = function () {
var _local1 = this.hilight;
_local1.mid._x = 8;
_local1.mid._width = this.btnLabel.textWidth + 2;
_local1.right._x = _local1.mid._width + 8;
_local1._visible = false;
};
#endinitclip
#initclip 2
function SubNav() {
this.init();
}
SubNav.prototype = new MovieClip ();
Object.registerClass("SubNav", SubNav);
SubNav.prototype.init = function () {
var _local2 = this;
_local2.nextDepth = 10;
var len = _local2.linkArray.length;
var _local1 = 0;
while (_local1 < len) {
_local2.attachMovie("SubNavButton", "btn" + _local1, _local2.nextDepth++, {label:_local2.linkArray[_local1].label, url:_local2.linkArray[_local1].url, navStyle:_local2.navStyle, fontFace:_local2.fontFace, fontSize:_local2.fontSize, id:_local1, btnCount:len});
var _local3 = _local2["btn" + _local1];
_local3._x = ((_local1 == 0) ? 8 : (_local2["div" + (_local1 - 1)]._x));
_local3._y = _local3._y - 3;
if (_local1 < (len - 1)) {
_local2.attachMovie("subDivider", "div" + _local1, _local2.nextDepth++);
var div = _local2["div" + _local1];
div._x = (_local3._x + _local3._width) - 1;
}
_local1++;
}
_local2._visible = false;
};
SubNav.prototype.setTabOrder = function (startIndex) {
var _local3 = startIndex;
var _local2 = this.linkArray.length;
var _local1 = 0;
while (_local1 < _local2) {
this["btn" + _local1].tabIndex = _local3++;
_local1++;
}
return (_local3);
};
#endinitclip[/php] |
|