所以這是一個項目的延續...... 1021: Duplicate function definition in my action Script錯誤#1009 ......(做了一些研究仍然沒有解決!)
我在做一個互動的Flash項目......它有17個獨立的場景...
簡介場景 「Main_序列」 15獨立主打歌網頁....
開場播放場景,然後由defualt(無編碼)跳轉到「Main_序列」。 。
在「Main_Sequence」中有一個應該播放的動畫(以前工作正常),然後整個序列一旦被捕獲就應該「停止」(不知道在哪裏實施stop();
,因此它不會去接下來的場景)
那麼當您將鼠標放在每個音符在屏幕上它有一個鼠標的效果....當您單擊歌曲名稱你應該「跳」到標有該歌曲的特定場景在哪轉了一個主頁按鈕,把你帶回...
感謝@George Profenza幫助我得到按鈕的代碼工作(?)...我說(?)因爲當我去測試電影加載並播放介紹...跳轉到主序列,然後播放動畫和t的前兩部分如果出現以下輸出錯誤,它會被凍結TypeError:錯誤#1009:無法訪問空對象引用的屬性或方法。 在music_Sheet_project_15_fla :: MainTimeline/frame91()[music_Sheet_project_15_fla.MainTimeline :: frame91:18]
我理解以下關於1009的 它主要是指存在着正試圖訪問的對象,則不再存在代碼或者還沒有存在....唯一的問題是我沒有其他的東西,除了在框架上的兩個補間動畫......並且沒有在我的動作代碼中引用這些層上的91幀/無代碼。 ... http://s22.postimg.org/qdoja6xnl/Untitled_picture3.png我需要訪問按鈕的第一幀(歌曲標題是畢竟動畫已加載即幀#525)
...最後代碼爲主場景
var buttonMap:Dictionary = new Dictionary();
buttonMap["TD_g"] = "Tweedlee_Dee";
buttonMap["s_g"] = "Sincerely";
buttonMap["ats_g"] = "Ain’_that_a_shame";
buttonMap["iyk_g"] = "I_hear_you_knocking";
buttonMap["hms_g"] = "Hearts_made_of_stone";
buttonMap["tf_g"] = "Tutti_fruiti";
buttonMap["hd_g"] = "Hound_Dog";
buttonMap["ld_g"] = "Little_darlin";
buttonMap["ll_g"] = "Louie_Louie";
buttonMap["ts_g"] = "Twist_and_shout";
buttonMap["ipsy_g"] = "I_put_a_spell_on_you";
buttonMap["ysm_g"] = "You_shook_me";
buttonMap["ihm_g"] = "I_can_hear_music";
buttonMap["iss_g"] = "I_shot_the_sheriff";
buttonMap["tl_g"] = "Tainted_love";
TD_g.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
s_g.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
ats_g.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
iyk_g.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
hms_g.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
tf_g.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
hd_g.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
ld_g.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
ll_g.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
ts_g.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
ipsy_g.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
ysm_g.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
ihm_g.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
iss_g.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
tl_g.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
gotoAndStop(1, buttonMap[event.currentTarget.name]);
}
是否有可能是因爲歌曲標題按鈕是位圖而只能成爲「按鈕」引起的錯誤@幀525 ..如果這是這種情況,爲什麼它不會給出前兩個字幕的錯誤也只能成爲Button @ Frame525?
如果我不能通過輸出錯誤,我不能測試按鈕的功能..一些幫助/建議將不勝感激!
是的,如果腳本引用腳本運行時不存在的對象,則確實會發生該錯誤。 –