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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -