Home > OS >  AS3 why Sound effect doesn't work on Android?
AS3 why Sound effect doesn't work on Android?

Time:09-17

I've built a fairly simple app using Adobe Animate and AS3, which has a number of buttons that should play a sound when tapping on them. when running a Test of the app the sounds works just fine. but when testing/debugging the app on an Android emulator or an Android device the sound doesn't work.

The sound file called "click.mp3" is loaded to Animate's library. It has a class file called "Click"Sound setting on the Publish Settings

CodePudding user response:

To avoid using "Override sound settings", declare your MP3 variable as a Sound data type.

//# correct... play works as expected
var mysound: Sound = new Click();

//# wrong... play needs override to work 
var mysound: Click = new Click(); 
  • Related