0
我正在使用一個帶有MovieClips的AS2網站,用於在單擊導航時交換深度的頁面。文本內容從外部XML文件&動態拉動,通過CSS,包括鏈接(HTML/CDATA)。我的問題是這樣的:
當一個頁面通過swapDepths()
隱藏在另一個頁面後面時,隱藏頁面內的HTML鏈接仍然可用手形光標點擊。我對內容的父剪輯嘗試了mc.enabled = false,但它對動態文本字符串沒有影響。有誰知道如何禁用與ActionScript2的CDATA鏈接?
對於一般的MovieClip兒童來說,同樣的問題是:如何在AS2中的父剪輯中禁用影片剪輯而不使用硬編碼實例名稱?
在此先感謝您的任何建議!
這裏是我控制我的頁面交換代碼:
// 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'});
}
}
移動下面的作品。我曾經這樣做過,但希望找到另一種解決方案。這確實是這樣做的方式!謝謝! – 2009-07-08 22:10:54