Zoo Framework SoundPlayer feature

October 8th, 2009  | Tags:

Definition

Use to create your own playlist or just make your soundFX loops.

View CodeACTIONSCRIPT
import Zoo.SoundPlayer;
SoundPlayer.Init($url, { $vars });

Parameters

$url = The object to be defined to be a own url;

$vars = Here, we can get both loop, fadeIn, fadeOut, fadeInOut, volume, autoPlay and id.

loop = Here we can set the times that own sound will be played;

fadeIn, fadeOut, fadeInOut = Here we can set fades to own sound, the parameter of this property is “true”;

volume = This feature set own volume, this unit is measured between 0 and 1, if you want to set middle of volume uses 0.5;

autoPlay = Just to set if the sounds starts playing or no, the parameter of this one is “true”;

id = With own “id” we can control own sound, able to play and stop in specific sound.

We can control own sound by id’s that we set before;

View CodeACTIONSCRIPT
SoundPlayer.Control("sound1", {command:"play"});        
SoundPlayer.Control("all", {command:"stop"});

“sound1″ = This os own ID that we already set before; “all” = This os own property to stop all sounds; command = This is oun method to execute the action, we can put “play” and “stop” properties;
E.g.

View CodeACTIONSCRIPT
SoundPlayer.Init("myMusic.mp3", {loop:0, fadeInOut:true, volume:1, autoPlay:false, id:"sound1"});
// to play own id "sound1";
SoundPlayer.Control("sound1", {command:"play"});
// or to stop it
SoundPlayer.Control("all", {command:"stop"});

To download it, click here http://code.google.com/p/zoo-framework/downloads/list

No comments yet.
TOP