View Single Post
Old 19th March 2005, 15:45   #21
krckoorascic
Senior Member
 
krckoorascic's Avatar
 
Join Date: May 2004
Location: Serbia
Posts: 351
Send a message via ICQ to krckoorascic Send a message via AIM to krckoorascic Send a message via Yahoo to krckoorascic
sorry, i made mistake writting code, this should work:

PHP Code:
#include "lib/std.mi"

Function Update();

Global 
Timer VisTimer;
Global 
AnimatedLayer Vis1Vis2;

System.onScriptLoaded()
{
 
Group grp getScriptGroup();

 
Vis1 grp.getObject("anim1");
 
Vis2 grp.getObject("anim2");
 
 
Update();

 
VisTimer = new Timer;
 
VisTimer.setDelay(30);
 if (
getStatus() == STATUS_PLAYINGVisTimer.start();
}

System.onScriptUnloading()
{
 
delete VisTimer;
}

VisTimer.onTimer()
{
 
Update();
}

System.onPlay(){ VisTimer.start(); }
System.onResume(){ VisTimer.start(); }
System.onStop(){ VisTimer.stop(); }
System.onPause(){ VisTimer.stop(); }

Update()
{
 
int vu = (getLeftVUMeter() + getRightVUMeter()) / 2;
 
Vis1.gotoFrame((vu 255) * (Vis1.getLenght() - 1));
 
Vis2.gotoFrame((vu 255) * (Vis2.getLenght() - 1));



krckoorascic is offline   Reply With Quote