问候!
我正在一个带有 MovieClips 的 AS2 网站上工作,用于在单击导航时交换深度的页面。文本内容从外部 XML 文件中动态提取并通过 CSS 设置样式,包括链接 (HTML/CDATA)。我的问题是这样的:
当一个页面通过 隐藏在另一个页面之后时swapDepths()
,隐藏页面中的 HTML 链接仍然可以用手形光标单击。我在内容的父剪辑上尝试了 mc.enabled=false,但它对动态文本字符串没有影响。有谁知道如何使用 Actionscript 2 禁用 CDATA 链接?
一般来说,MovieClip 子级也有同样的问题:如何在 AS2 的父剪辑中禁用movieClips 而无需硬编码实例名称?
在此先感谢您的任何建议!
这是我控制页面交换的代码:
// class code.Startup() :
page_arr = new Array(); // references clips laid out in the IDE
page_arr = [
['home', pages.homePage_mc],
['apartments', pages.apartmentsPage_mc],
['building', pages.buildingPage_mc],
['neighborhood', pages.neighborhoodPage_mc],
['press', pages.pressPage_mc],
['team', pages.teamPage_mc],
['retail', pages.retailPage_mc],
['office', pages.officePage_mc],
['contact', pages.contactPage_mc]
]
// class code.Navigation() :
private function showPage(num):Void {
turnOffAllPages();
if(siteFirstRun == true){
prevPageObj = code.Startup.getInstance().page_arr[0][1];
//defaults to homepage, already showing
currPageObj = code.Startup.getInstance().page_arr[num][1];
//sets currPageObj to whatever page was chosen with nav
siteFirstRun = false;
}
else {
if(currPageObj !== prevPageObj){
prevPageObj = currPageObj;
}
currPageObj = code.Startup.getInstance().page_arr[num][1];
}
TweenLite.to(code.Startup.getInstance().page_arr[num][1], .25, {_alpha:100, ease:'easeOutQuad', delay:.25});
if(prevPageObj !== undefined){
currPageObj.swapDepths(code.Startup.getInstance().pages.getNextHighestDepth());
}
currPageObj.copy_mc.enabled = true;
}
// Each page_arr clip contains a 'copy_mc' instance into which XML content is fed. These are what I need to target!
private function turnOffAllPages():Void{
for(i=0; i<code.Startup.getInstance().numPages; i++){
code.Startup.getInstance().page_arr[i][1].copy_mc.enabled = false;
// disable pages to avoid rolling over hidden links
TweenLite.to(code.Startup.getInstance().page_arr[i][1], .2, {_alpha:0, ease:'easeOutQuad'});
}
}