View Single Post
Old 25th September 2017, 19:52   #17
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
Quote:
Originally Posted by Victhor View Post
... When you can, please look inside the .m file and see if you can find why the "IF" condition is not working on the System.onstop part.
Well, let's see. This is the System.onStop() function in your script file:

System.onStop(){

//This "IF" is not working, it does DoAniStuff anyway (Winamp bug?)

if(System.getStatus() == STATUS_PAUSED){
AnimationPlayPause.gotoFrame(0);
}
else{
DoAniStuff(AnimationPlayPause, 15, 0, 50, 0);
}

PlayButton.show();
PauseButton.hide();

}


Question: what happens when a user clicks on the STOP button and the System.onStop() function is executed? The visible effect of that action is that the playback is stopped. More importantly for us is the invisible effect which is that Winamp changes the STATUS instantly! This would mean that ....


System.onStop(){ here is the STATUS already STOPPED!



... and thus all following IF conditions are, unfortunately, useless here. For the STATUS is not PAUSED and the else line is not read. And the DoAniStuff function in here is not responsible for the actual execution of the Animated Layer. I changed the function to:

System.onStop()
{
AnimationPlayPause.goToFrame(0);
PlayButton.show();
PauseButton.hide();
}

and you still get the animation running.
PeterK. is offline   Reply With Quote