问候!
我正在使用MovieClip在AS2网站上工作,以便在点击导航时交换深度。文本内容是从外部XML文件动态提取的。通过CSS设置样式,包括链接(HTML / CDATA)。我的问题是:
当页面通过swapDepths()
隐藏在另一页后面时,隐藏页面中的HTML链接仍然可以用手形光标点击。我在内容的父剪辑上尝试了mc.enabled = false,但它对动态文本字符串没有影响。有谁知道如何禁用ActionScript 2的CDATA链接?
对于一般的MovieClip孩子,同样的问题是:如何在没有硬编码实例名称的情况下在AS2的父剪辑中禁用movieClip?
提前感谢任何建议!
以下是我控制页面交换的代码:
// 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'});
}
}
答案 0 :(得分:0)
我会建议你解决问题的两种方法:
1)将隐藏的动画片段移动到屏幕外位置(即将_x和_y设置为舞台外的部分)
2)在隐藏的mc顶部附加一个阻止程序动画片段或按钮,这样就不会接收任何鼠标事件。当它再次被取消隐藏时,请删除阻止程序动画片段或按钮。