我不是Flash開發人員,但我正在調試複製/文本分配不正確的問題。爲什麼我的主要內容區域文本沒有更新?我的參考書是否錯誤?
在.as
文件中,標題和副標題分配和工作:
195 body.heading.htmlText = heading;
196 body.sectionheading.htmlText = nav_name;
197 body.subheading.htmlText = subheading;
198 body.subheading.htmlText = 'testtt';
然而,主體副本不:
180 body.textholder.myText.htmlText = 'mederTest';
有沒有一些方法,我可以找出所有文本區域(任何具有可分配的htmlText
)編程?在Flash本身,我似乎無法自己選擇標題/子標題對象,因爲它們看起來不在畫布中?他們顯得隱藏起來
編輯:我正在調試24瑞士法郎。我終於找到需要更新的實際文本。
428 var bodyClip:MovieClip = eval("bodyparts.bodycontent_"+tmpclipname.id+"_0");
429 ExternalInterface.call("console.log" , bodyClip)
430 for (var p in bodyClip) {
431 ExternalInterface.call("console.log" , p)
432 ExternalInterface.call("console.log" , bodyClip[p])
433 ExternalInterface.call("console.log" , bodyClip[p])
434 for (var thing in bodyClip[p]) {
435 if (thing === 'htmlText') {
436 ExternalInterface.call("console.log" , 'OMG');
437 ExternalInterface.call("console.log" , bodyClip[p][thing])
438 }
439
440 if (thing === 'myText') {
441 ExternalInterface.call("console.log" , 'SUPEROMG');
442 ExternalInterface.call("console.log" , bodyClip[p][thing]['htmlText'])
443 }
444 ExternalInterface.call("console.log" , thing)
445 }
446 }
它能夠深入而當bodyClip有一個「會將myText」屬性的情況下,這就是我想要更新的東西。
這條線爲什麼不更新它?
body.textholder.myText.htmlText = 'mederTest';
從程序上講,它可能只是因爲我可能引用了錯誤的對象/實例,不是嗎? .as
文件不包含對body
的引用。
我只能假定它是在第一個.as
文件或其全局對象中定義的。任何人都可以借我一隻手嗎?
順便說一句,這是我相信的Actionscript 2。我更新了我的問題,因爲我發現我需要在以前的'.as'中更新,除非我需要從第二個'.as'更新它。幫助我的頭腦? – 2011-03-11 04:10:10
啊,你說得對,那是AS2。對不起,我真的不知道有關AS2的任何信息,它看起來像你的問題是非常特定的(你在編輯中發佈的代碼在AS3中是沒有意義的)。希望有一些AS2大師可以幫助。 – Aaron 2011-03-11 04:30:13