How would i do this is AS3?
Hi,
I have some old code that i would like to re-use in and AS3 project, it was written in AS2. To be honest im not totally up with AS3...
This is the code i have from the AS2 project. Basically it just takes each frame from an array and matches it to a particular frame in a lipsync movie clip...
Thanks in advance..
Andy
onClipEvent(load) {
//amplitude array created by FlashAmp using a scale of 50 and a rate of 12 fps
//no smoothing (see additional example below)
amplitude=[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 3, 3, 3, 2, 1, 2, 2, 1, 2, 2, 2, 3];
}
onClipEvent(enterframe) {
//set x and y scale of speaker to full size plus value from array.
//array value is determined by the playback head position in main timeline.
//this._xscale = 85 + amplitude[_root._currentFrame-1]
//this._yscale = 85 + amplitude[_root._currentFrame-1]
//that is, frame 7 - 1 = index 6, (6th place in zero-based array, value of 39).
myFrame = amplitude[_root._currentframe-1] + 1;
this.gotoAndStop(myFrame);
}