actionscript 3 - ActionScript3:Undefined property error -


i'm making toggle button resume/pause audio in adobe flash cs 5: used code snippet "click play/stop sound".

here code:

pause_play_button.addeventlistener(mouseevent.click,fl_clicktoplaystopsound_2);     var fl_toplay_2:boolean = true;     var resumetime:number = 0.00;     var s:sound = new tanishma_sound();     var fl_sc_2:soundchannel ;      function fl_clicktoplaystopsound_2(evt:mouseevent):void     {      if(fl_toplay_2)     {         f1_sc_2 = s.play (resumetime);     }     else     {         resumetime = f1_sc_2.position;         f1_sc_2.stop ();     }     fl_toplay_2 = !fl_toplay_2; } 

i have error , don't know how fix it:

scene 1, layer 'actions', frame 1, line 47 1120: access of undefined property f1_sc_2.

any help!

that error means flash can't find you've referenced. in case, because of syntax typo.

you have defined: (note f letter l)

var fl_sc_2:soundchannel; 

yet later on, you've change 'l' numeral '1' in 3 places.

f1_sc_2 

should be:

if(fl_toplay_2) {     fl_sc_2 = s.play (resumetime); } else {     resumetime = fl_sc_2.position;     fl_sc_2.stop (); } 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -