Thursday, August 27, 2009

LIP-SYNCHING

Code for sound in Flash:
var snd:Sound = new Sound();
snd.load(new URLRequest("aHaon.mp3"));

var channel:SoundChannel = new SoundChannel();
channel = snd.play();

snd.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, true);
function onIOError(evt:IOErrorEvent):void{
trace("An error occurred when loading the sound;", evt.text);
}

//An event listener to ensure sound only plays once fully loaded.
snd.addEventListener(Event.COMPLETE, onLoadComplete, false, 0, true);
function onLoadComplete(evt:Event):void{
var localSnd:Sound = evt.target as Sound;
channel = localSnd.play();
}


Synched the character counting to 10 & adding accompanying simple animations to depict meaning.

No comments:

Post a Comment