actionscript 3 - Stop embedded music AS3 -
n.b. : called sound variables in different way 1 suggested duplicate. that's why it's not same structure follow start of question,
in application, have used following lines embed music , run in on actual devices through adobe air :
[embed(source = '/inspiration.mp3')] private var myback:class; private var back:sound;
later on, whenever want play it, use following code :
back = (new myback()) sound; back.play(0,9999);
it works perfectly, problem when want stop music! i've used
back.stop(); it's telling me
1061: call possibly undefined method stop through reference static type flash.media:sound.
what doing wrong?
you should store resultant soundchannel
object , use 1 stop playing sound.
var backplaying:soundchannel; .... backplaying=back.play(0,9999); .... backplaying.stop();
of course, make backplaying
persistent, aka define in class aside back
.
Comments
Post a Comment