Hi all,
I am doing a project that dealt with time control mostly, and it is user interactive.
your valuable help needed on time control & functions , i have attached my .swf file ,
there are power ON and power OFF buttons on the interface, at default the green lights will be blinking, when user switch OFF the power the lights should be OFF. when switch on the lights should blink with red color, when switch off and on again the lights color will revert back to green , after 10sec the final color blinking will be continued to play…
Thanks in Advance…
[COLOR=Red]function doRollOver() {
if (this != activebtn || activebtn=="")
{
if (this._currentframe>OUTSTART && this._currentframe<OUTSTOP) {
this.gotoAndPlay(OVERSTART+OUTSTOP-this._currentframe);
} else {
this.gotoAndPlay(OVERSTART);
}// end if
}// end else if
}// End of the function
function doRollOut() {
if (this != activebtn || activebtn=="")
{
if (this._currentframe>OVERSTART && this._currentframe<OVERSTOP) {
this.gotoAndPlay(OUTSTART+OVERSTOP-this._currentframe);
} else {
this.gotoAndPlay(OUTSTART);
}
}// end if
// end else if
}// End of the function
[COLOR=Blue]function doClick() {
var _loc2 = activebtn;
activebtn = this;
if(activebtn==_root.buttons.poweron){
//attachMovie(“lightsonfixedmode”,“redlight”,1000);
//unloadMovie(_root.lightsoff);
trace(“poweron”);
}
else if(activebtn==_root.buttons.poweroff){
//unloadMovie(lightsonfixedmode);
//_root.gotoAndStop(3);
trace(“poweroff”);
}
/*else if(activebtn==_root.topBtns.topalbumBtn){
_root.movieHolder.loadMovie(“media/topalbum.swf”);
_root.selectedMenu="";
}[/COLOR]
else if(activebtn==_root.topBtns.toptrackBtn){
_root.movieHolder.loadMovie(“media/toptrack.swf”);
_root.selectedMenu="";
}
*/
_loc2.onRollOut();
this.gotoAndStop(OVERSTOP);
}
// End of the function
function doDeActive() {
activebtn.gotoAndStop(OUTSTOP);
activebtn="";
}
function init() {
for (var _loc1 in groupinfo) {
groupinfo[_loc1].onRollOver = doRollOver;
groupinfo[_loc1].onRollOut = doRollOut;
groupinfo[_loc1].onRelease = doClick;
}
poweron.gotoAndStop(35);
activebtn=poweron;
// end of for…in
}
// End of the function
var groupinfo = [poweron, poweroff];
var OVERSTART = 2;
var OVERSTOP = 35;
var OUTSTART = 36;
var OUTSTOP = 60;
var activebtn;
init();
[/COLOR]
my timer script on stage
onEnterFrame = function()
{
var mins:Number = Math.floor(getTimer()%3600000/60000);
var secs:Number = Math.floor(getTimer()%60000/1000);
//var milisecs:Number = Math.floor(getTimer()%1000/1);
_root.timer.text=(mins+" “+“min”+” “+”:"+secs+" “+“sec”+”");
if(secs >=10)
{
unloadMovie("_root.lights");
gotoAndStop(2);
//_root.attachMovie("rotating60sec","rotating60sec",1);
rotating60sec._x=28.8;
rotating60sec._y=87.9;
}
}