Flash CS 5.5 Actionscript 3 - Buttons appearing on all frames -


i have program lets user go various functions, work. when use music player function made play , stop buttons remain on screen when click return menu of options. here code:

play_button.addeventlistener(mouseevent.click,clickhandler); stop_button.addeventlistener(mouseevent.click,clickhandler); function clickhandler(event:mouseevent): void{   swapchildren(play_button, stop_button) } 

the music file embedded in buttons.

the following error appears every time:

typeerror: error #1009: cannot access property or method of null object reference. @ smarthouse_scene1_fla::maintimeline/frame10() @ flash.display::movieclip/gotoandstop() @ smarthouse_scene1_fla::maintimeline/fl_clicktogotoandstopatframe_27()

it should noted error occurs when music has been played. can go page , leave without problem if dont touch play or stop button. if appreciate it.

if reading correct sounds inside button on timeline, using buttons or movieclips, make sure frame 27 exist on movieclip timline.

              //you can use//  mymovieclip.visble = false;               example:                play_button.addeventlistener(mouseevent.click,clickhandler);               function clickhandler(event:mouseevent): void{                stage.mymovieclip.visible = false; // name of button clip               } 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -