Copy link to clipboard
Copied
Please help me create a go to and stop (Frame)
function to the end of my timer!?
I'm struggling - tried everything
My script is below
countDown1F(00,50,50000,tf1);
function countDown2F(nStart:int,nEnd:int,duration:uint,tf:TextField) {
if (nStart>=nEnd) {
return null;
} else {
var t:Timer = new Timer(duration/(nEnd-nStart),nEnd-nStart);
t.addEventListener(TimerEvent.TIMER,function(e:TimerEvent){f2(e,nEnd,tf)});
t.dispatchEvent(new TimerEvent(TimerEvent.TIMER));
t.start();
}
}
function f2(e:TimerEvent,nEnd:int,tf:TextField){
}
function countDown1F(nStart:int,nEnd:int,duration:uint,tf:TextField) {
if (nStart>=nEnd) {
return null;
} else {
var t:Timer = new Timer(duration/(nEnd-nStart),nEnd-nStart);
t.addEventListener(TimerEvent.TIMER,function(e:TimerEvent){f1(e,nEnd,tf)});
t.dispatchEvent(new TimerEvent(TimerEvent.TIMER));
t.start();
}
}
function f1(e:TimerEvent,nEnd:int,tf:TextField){
tf.text = formatF( (nEnd-e.target.currentCount));
}
function formatF(n:int):String {
var min:int = Math.floor(n/60);
var sec:int = n-min*60;
var a:Array = [min.toString(),sec.toString()];
for (var i:uint=0; i<a.length; i++) {
while (a.length<2) {
a="0"+a;
}
}
return a[0] + ":" + a[1];
}
var t:Timer;
var tf:TextField;
var nend:int;
countDown1F(00,50,50000,tf1);
function countDown1F(nstart:int,nend:int,duration:int,_tf:TextField):void{
if(nstart<nend){
tf=_tf;
t=new Timer(duration/(nend-nstart),nend-nstart);
t.addEventListener(TimerEvent.TIMER,timerF);
t.start();
}
}
function timerF(e:TimerEvent):void{
tf.text=formatF(nend-e.targer.currentCount);
if(e.currentCount==e.repeatCount){
gotoAndStop(wherever); // assign wherever
}
}
function formatF(n:int):String {
var min:int = Math.floor(n/60);
var sec:
...what's the trace output after 2 frame visits
trace(counter);
var counter:int;
if(counter){
counter++;
} else {
counter = 1;
}
Count.text = String(counter);
trace("tf",Count.text);
use
parent.gotoAndStop(2)
no, you would use
if(this.currentLabel== yourlabel){
count=0;
}
yourbutton.addEventListener("MouseEvent.CLICK,f);
function f(e:MouseEvent):void{
counter=0;
}
Copy link to clipboard
Copied
enable 2fa on your account.
Copy link to clipboard
Copied
Hi Kglad - how would I make a end of movie clip have a gotoAndPlay function once the movie clip ends on a frame?
Copy link to clipboard
Copied
Im trying to control the parent ( so its just a movie clip on the main timeline - ive entered the movie clip and on the last frame of the movie clip i put Parent.gotpAndPlay(2) but when I run Swf preview I get an erroe which says - 1061: call to possibly undefined method gotoandplay through a static reference"
Copy link to clipboard
Copied
case counts. parent!= Parent.
Copy link to clipboard
Copied
case counts. Parent!= Parent.
Parent.gotoAndStop(2);
This is what I put on the last frame of the movie clip and I got an error saying expecting identifier before case "
Im guessing ive wrote the code out wrong
Copy link to clipboard
Copied
use
parent.gotoAndStop(2)
Copy link to clipboard
Copied
That did not work. Im not sure what Im doing wrong
Copy link to clipboard
Copied
on the main timeline use
trace('main', this)
and on the movieclip with goto put
trace('mc', this)
then test
copy and paste the output?
Copy link to clipboard
Copied
what's the trace output after 2 frame visits