2017-02-22 3 views
0

助けてください、私はこれで本当にnoobです。エラー#1009:nullオブジェクト参照のプロパティまたはメソッドにアクセスできません。 [とてもイライラ]

私は間違いを見つけられません。フレーム1ではすべてが正常に機能しますが、の次のボタンをクリックするとエラーが表示されます。私は使用したすべてのボタンのインスタンス名を確認しましたが、すべてがインスタンス化されています。変更すべきその他のものは本当にわかりません。 pauseMusic2ボタンは既に存在します。私はまた、なぜnextFrame();フレーム1の54行目では機能しません。

ERROR

TypeError: Error #1009: Cannot access a property or method of a null object reference. 
at RECOVER_AGUILAREXERCISE_fla::MainTimeline/frame2()[RECOVER_AGUILAREXERCISE_fla.MainTimeline::frame2:21] 
at flash.display::Sprite/constructChildren() 
at flash.display::Sprite() 
at flash.display::MovieClip() 
at flash.display::Sprite/constructChildren() 
at flash.display::Sprite() 
at flash.display::MovieClip() 
at flash.display::Sprite/constructChildren() 
at flash.display::Sprite() 
at flash.display::MovieClip() 
at flash.display::Sprite/constructChildren() 
at flash.display::Sprite() 
at flash.display::MovieClip() 
at flash.display::Sprite/constructChildren() 
at flash.display::Sprite() 
at flash.display::MovieClip() 
at flash.display::Sprite/constructChildren() 
at flash.display::Sprite() 
at flash.display::MovieClip() 
at flash.display::MovieClip/nextFrame() 
at RECOVER_AGUILAREXERCISE_fla::MainTimeline/nextSoundTrack01()[RECOVER_AGUILAREXERCISE_fla.MainTimeline::frame1:54] 

あなたはフレーム2にライン21であるラインのフレーム2におけるCODE

stop(); 
album01.gotoAndPlay(49); 
title2.play(); 
import flash.media.SoundMixer; 
import flash.media.Sound; 

var sound02:Sound = new SITNight(); 
var soundChannel02:SoundChannel = new SoundChannel 
var soundLastPosition02: Number = 0; 


soundChannel02 = sound02.play(0); 


pauseMusic2.pauseBTN.addEventListener (MouseEvent.CLICK, pauseSoundTrack02); 

function pauseSoundTrack02 (e:MouseEvent): void { 
pauseMusic2.visible = false; 
soundLastPosition02 = soundChannel02.position; 
soundChannel02.stop(); 
} 



playMusic2.playBTN.addEventListener (MouseEvent.CLICK, playSoundTrack02); 

function playSoundTrack02 (e:MouseEvent): void { 
pauseMusic2.visible = true; 
soundChannel02 = sound02.play(soundLastPosition02); 
} 


stopMusic2.stopBTN.addEventListener (MouseEvent.CLICK, stopSoundTrack02); 

function stopSoundTrack02 (e:MouseEvent): void { 
pauseMusic2.visible = false; 
soundChannel02.stop(); 
soundLastPosition02 = 0; 
} 

nextMusic2.nextBTN.addEventListener (MouseEvent.CLICK, nextSoundTrack02) 

function nextSoundTrack02 (e:MouseEvent): void { 
pauseMusic2.visible = true; 
soundChannel02.stop(); 
soundLastPosition02 = 0; 
nextFrame(); 
} 

prevMusic2.prevBTN.addEventListener (MouseEvent.CLICK, prevSoundTrack02) 

function prevSoundTrack02 (e:MouseEvent): void { 
pauseMusic2.visible = true; 
soundChannel02.stop(); 
soundLastPosition02 = 0; 
gotoAndStop(1); 
} 

答えて

0

を識別することはできますか? 私が見るところでは、問題は "soundChannel02"が初期化されていないことによると思います。

おそらくタイプミスでない場合はvar soundChannel02:SoundChannel = new SoundChannelに「()」がないためです。

関連する問題