Results 1 to 4 of 4
  1.    #1  
    deleted
    Last edited by guest_; 08/12/2011 at 09:18 AM.
  2. #2  
    just an idea (I am faaaaaaar from knowledgable in development) but is your scene-assistant file or stage-assistant setup? I believe there's a 'handler' (not sure if that's the right word I'm looking for) that has to go in ome of those for audio playback...I'm sure this doesn't help but maybe it will point you in the right direction...
  3. #3  
    Quote Originally Posted by compuseum View Post
    Hi,

    I'm playing around with Ares, trying to bind playback of an embedded sound-file to a button.

    Tried two different approaches:

    Code:
    button1keypress: function(event, inSender) {
    		this.audioPlayer = new Audio();
    		var file = Mojo.appPath + "sounds/foobar.wav";
    		this.audioPlayer.src = file;
    		this.audioPlayer.autoplay = false; 
    		playSound: function(){
    		this.audioPlayer.play();
    		}
    }
    and

    Code:
    button1Keypress: function(event, inSender) {
    var re = Mojo.appPath + "sounds/barfoo.wav";
    	this.rePlayer = new Audio();
    	this.rePlayer.src = re;
    	if (this.rePlayer.palm) {
    		this.rePlayer.mojo.audioClass = "media";
    	}
    	this.rePlayer.autoplay = false;
    	this.rePlayer.play();
    }
    None of them works. Can you tell me what's wrong with it?
    i'm just using:

    Code:
    Mojo.Controller.getAppController().playSoundNotification("media", "sounds/flame.wav");
    i just have that in the function called by the button press. make sure you respect the ringer switch, though. i haven't included sound because i haven't taken the time to code around the ringer switch yet.
    My site: Shanerooni, LLC
    Follow me on Twitter
    My apps: GuessWhat? | MazeHunter3D | Small Wonders | PhakePhoney | AutismAware | PicSketcher | Cubix | QuickSolve | QuickSpell | QuickTrace | QuickWhack | QuickSuite | Soccer Shots | Ballooning |
    Cubix
  4. #4  
    Quote Originally Posted by compuseum View Post
    Thank you, that works... at least for one button. When I try to use your code for another button in the same scene, the second button does not work
    did you instantiate both buttons? i'd have to see the code... feel free to PM it to me and i can take a look.
    My site: Shanerooni, LLC
    Follow me on Twitter
    My apps: GuessWhat? | MazeHunter3D | Small Wonders | PhakePhoney | AutismAware | PicSketcher | Cubix | QuickSolve | QuickSpell | QuickTrace | QuickWhack | QuickSuite | Soccer Shots | Ballooning |
    Cubix

Posting Permissions