Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
I want to sound every time I touch every button.
BGM sound
Effect Sound
How's that without using a widget?
Is there a way to script it?
iam newbie, thank you for your help.
Hi--
To play sound, you'll need to add an audio widget to your 2D layout and add the sound file to your resources. Then turn off the "Visible" and "Show controls" options for the audio control.
Now for each control (e.g. Button) you want to trigger the sound, bind the control's Click event to the audio control's "Play" service.
If you need to play the sound via script, you can use something like this:
$scope.app.fn.triggerWidgetService('audio-1','play');
--Clay