Skip to content

Instantly share code, notes, and snippets.

@mmurray
Created January 14, 2012 00:52
Show Gist options
  • Save mmurray/1609647 to your computer and use it in GitHub Desktop.
Save mmurray/1609647 to your computer and use it in GitHub Desktop.
package {
import flash.display.MovieClip;
import flash.external.ExternalInterface;
public class AudioPlayer extends MovieClip {
public function AudioPlayer():void {
if(ExternalInterface.available) {
ExternalInterface.call( "Mozart.log" , "> mozart - flash audio player initialized <");
ExternalInterface.addCallback("playFlash", playTrack);
ExternalInterface.addCallback("pauseFlash", pauseTrack);
}
}
public function playTrack():void {
ExternalInterface.call( "> mozart - playTrack <");
}
public function pauseTrack():void {
ExternalInterface.call( "> mozart - pauseTrack <");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment