Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Reset Combobox On Each Frame?



Hello
I have a series of 5 comboboxes (cbA to cbE) on a series of consecutive frames. I would like users to select an answer for each combobox on each frame, but then have the box reset to default on entering each new frame.

The user is selecting a button on each frame (btn_Next) to progress to the next frame, and that button enters their selections into my database. I would like it to enter the information and then move them onto the next frame, and have those combos reset when they enter the next frame.

This is not working (below):it works for the first frame, but then doesn't work for the next frame. Help?


Code:

this.addEventListener(Event.ENTER_FRAME, resetCombos);

function resetCombos(evt:Event):void {
cbA.selectedIndex = -1;
cbB.selectedIndex = -1;
cbC.selectedIndex = -1;
cbD.selectedIndex = -1;
cbE.selectedIndex = -1;

}



FlashKit > Flash Help > Actionscript 3.0
Posted on: 11-14-2008, 10:49 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

How Do I Reset A ComboBox?
I am building a mail form in Flash MX and I would like to know how to reset my Components. I know how to reset inputText boxes but what should I do with a comboBox?

Combobox Will Not Reset When Using Decimal Script
Hello
I have a combobox which should reset when the user changes the selection however when I use a script on the previous frame (using simple reset btn) the combobox will not reset the value. The script I use for decimal is

Math.formatDecimals = function (num, digits) {
//if no decimal places needed, we're done
if (digits <= 0) {
return Math.round(num);
}
//round the number to specified decimal places
//e.g. 12.3456 to 3 digits (12.346) -> mult. by 1000, round, div. by 1000
var tenToPower = Math.pow(10, digits);
var cropped = String(Math.round(num * tenToPower) / tenToPower);
//add decimal point if missing
if (cropped.indexOf(".") == -1) {
cropped += ".0"; //e.g. 5 -> 5.0 (at least one zero is needed)
}

//finally, force correct number of zeroes; add some if necessary
var halves = cropped.split("."); //grab numbers to the right of the decimal
//compare digits in right half of string to digits wanted
var zerosNeeded = digits - halves[1].length; //number of zeros to add
for (var i=1; i <= zerosNeeded; i++) {
cropped += "0";
}
return(cropped);
}

if I delete this code from the page with the reset btn NO PROBLEM but when I add the script for decimal problem??? What am I missing - I am fairly new to actionscript obviously however I am eager and quick to learn. Please Help this is driving me nuts
Thanks

Movie Won't Reset To Frame 1
Dear ALL,

I have had this problem with my current Flash Developer. She is great at graphics but we can't get our head around this problem. Our movie won't reset itself when the mouse is quickly moved over the animation and also won't reset when the dragout mouse movement is executed.

I can get the .fla but here is the movie we need help with.

http://www.antigravitymatter.com/ozegrub/menu/test.html or

http://www.antigravitymatter.com/ozegrub/menu/test.swf

Any help on this would be appreciated and as we are a business we would be glad to pay for any help.

Sincerely,
Christopher Green.

Not Reset The Frame Number ?
Help

My movie has two scenes.
In the last one, when I reference a frame number, the playhed moves
to the frame number as it's would be continued from de first scene.
I mean, the number of the last frame of the first scene is 30. So, in the second scene for to do the things go well, I must reference the frames as if the first frame would be 31 !!!!!!!.
I don't have idea what's happening.

do you?.

How Do You Reset A Loaded Swf To Its Original Frame?
Ok, I am using a variation of the scrolling window thing by Praystation (like on motown.com), the movie clips get loaded into an array and it scrolls/jumps from side to left to right depending on what button you push.
Now my question is -
each section that is loaded
section_0.swf
section_1.swf
section_2.swf
section_3.swf

are also loading movie clips (or swf's)into themselves. I know how to do that, pretty simple right? Say you click section 2 on the top nav bar, it jumps to section 2 on the scrolling windown, and now youve got 3 examples of say cd covers to look at in the section , a, b, and c. Ok so you click C, and c.swf is loaded into the section_2.swf,
ok now you click on section 1 on the top nav bar, and it goes to section 1, and you click an image to look at, but you want to now go back to section 2 to see the cd covers again (this is where I need help). Currently it displays the C cd cover (c.swf). I want the clip to return to it's original frame (the A cd cover) when you go back (or on any section, it should reset itself basically)..

if anyone can solve this-

www.quintessence-media.com/topnavbar.swf

www.quintessence-media.com/topnavbar.fla

www.quintessence-media.com/section_0.swf

www.quintessence-media.com/section_0.fla

are all the files

thanks!!

Reset / Restart Single Frame SWF
This post will probably demonstrate just how new I am to Flash...

I have a single frame drag and drop exercise that has user sequencing processing steps. As the target is dropped in the correct spot I kill the event listener. After all of the targets are dropped I'm showing a reset button and would like the swf to essentially start over. Is it possible to return the targets to their original spots and start the whole process over again should the user choose to select the reset button? I've viewed most of the reset / restart posts and can't get anything to work. I'm not clear on how the targets would reset to the start positions because I never track the origin x/y. Maybe this doesn't matter - like I said, I'm new to Flash CS4. Any assistance would be appreciated.

[F8] Things Get Reset Everytime I Go Back Into A Frame
I have two frames: in the first one is an mc that is a holder for a dynamic animation. The second frame has other stuff. The problem is that whenever I go from the second frame back to the first frame, the animation gets reset. I want it to start once, and just keep going from there on.

Here's the code within the holder mc:

Code:
for(i=0; i<8; i++) {
mc = this.attachMovie(type, 'MC'+i,
this.getNextHighestDepth());
mc.onEnterFrame = function() {
if( this._x < -175 ) {
this.remove();
numClips--;
}
this._x -= speed;
};
}

this.onEnterFrame = function() {
if( numClips < 8 ) {
mc = this.attachMovie(type, 'MC'+rem,
this.getNextHighestDepth());
mc.onEnterFrame = function() {
if( this._x < -175 ) {
this.remove();
}
this._x -= speed;
};
numClips++;
}
}

Can We Use AS To Reset A Movie To The Complete Begining And Reset All The Variables..
hey team flashkit...

i was to create a button, which when pressed, resets the whole of the swf movie and takes the user back to the first frame with all the variables and functions reset...

does anyone know of any script which can do this?

so it'll be just like when they visited it for the first time..

cheers guys, rob

Few Combobox On The Same Frame?
How do I need to change the script to be able to have few combox on the same frame?
I have 3 comboBox on the same frame ( box, box_1, box_2)

This is the script that used for one combobox (gave by Flex) :
function comboBox() {
where = box.getValue();
_root.musicroom.gotoAndStop(where);


note: My comboBox are linked to frames labels

Thank's in advance for your help.
Corinne

Few ComboBox In A Same Frame
I'm sorry but I don't understand your reply.
Can you help me there.

Sorry if i'm a bit slow to understand.

What is a value(c)?
do I need to give name to each of my comboBox?


thank you again for your time.
Corinne

ComboBox New Frame
Last edited by MasterT : 2004-03-01 at 20:49.
























hey guys i have a combo box and i want a different combobox to appear depending on what they select

i was thinkin of doing it like when they select something have it go to a new frame in that movie or a new .swf

how would i do this?

is there a way to do it without changing frames or movies?

How To Move To A Different Frame Through A ComboBox?
I'm using Flash 8. I have a ComboBox MC with its own timeline. When a user changes the selected ComboBox field, it must move to a different frame in the same timeline. Below is my code attached on the ComboBox itself. The trace commands are executed, however the movie does not change its current frame.

on (change) {
if (this.text == "1") {
gotoAndStop("1");
trace("hi");
} else if (this.text == "2") {
gotoAndStop("2");
trace("hi");
} else if (this.text == "3") {
gotoAndStop("3");
trace("hi");
} else if (this.text == "4") {
gotoAndStop("4");
trace("hi");
} else {
gotoAndStop(0);
trace("None");
}
}

Combobox To Pick Frame
i want to have a combo-box with different options. Say the options are 1, 2, and 3. If you pick 3 and then press an ok button it will take you to frame 3. The same basic consept for the others.

ComboBox GoToAndPlay From Frame
I'm new to AS3 and I'm at work trying to make this map of the room at our Law Library.

The plan is to have a ComboBox the only text on the layout and then for the user to just click a type of book (ie: a book regarding Immigration Law or even just to find a Printer) from the ComboBox. The action of clicking the selection would then stop any kind of other movie clips from playing and then play a seperate movie clip from a specific frame. (ie: Someone wanted a book on Immigration law, they click "Immigration Law" from the ComboBox and then the shelf(s) where Immigration Law can be found starts to blink in and out on the map so they know where to go.)

I created the movie clip for the blinking action and gave it the instance name of mc_shelf01 with the action starting frame as fm_start.

Typically I would just use a button and use something along the lines of:


Code:
on(press){
_root.mc_shelf01.goToAndPlay("fm_start");
}


My question is how do I do this in AS3? My experience with flash was strictly AS2 up to this point and I never had to use a ComboBox. I've only used drop downs in other web languages. I would prefer the ComboBox be called from actionscript than just dragging a component on screen.

The ULTIMATE goal is to have the ComboBox populated by an XML page but I don't think that part will be a problem to put in later on. (I could be, and probably am, wrong of course.)

Any Help on this is MUCH appreciated. Thanks so much.

ComboBox Frame Link
All,

I have a flash movie that has 30 frames with stop actions on each. Frame 1 is the title page, Frames 2-29 have a single Bio for our personnel (i.e, Jim's is on frame 1, Mary's is on Frame 2, etc.) There are buttons on all the frames that target each persons Bio.

My Customer like the buttons but also asked if I could add a Combobox to the top right corner so the viewer could pull down the Name List and select a name, hence going to that persons specific Frame/Bio.

I have played around with it and cannot seem to figure out how to target a specific frame in the movie from the ComboBox Listing. I have seen tutorials on GetURL, but I need to stay within the flash movie environment. I'm sure it has somoething to do with the Handle in the ComboBox but I am very new to Flash and am at a lose as to what the scripting would be. I need your help big time. Please send details!!!!

Thanks
E

Can You Use ComboBox To Change Scene Or Frame
Hi!
Can somebody please write down what I have to do to activate a Combobox to move inside a flashmovie.

I want to use a ComboBox with data and labels. For example... If a user selects the label "Scene2" I want the Action
(load) {
gotoAndPlay("Scene 2", 1);
}

Is that possible? Do I have to use a PushButton to activate the selection?

Many thanx!!

Empty ComboBox After Entering A New Frame
Hello

As this is a forum where there arent any stupid question. I would ask mine

I am using some ComboBoxes in my little Programm.
One of the Combos (its instance name is vol) is filled like this:

Code:
volProvider = Array ("Volume 1", "Volume 2", "Volume 3", "Volume 4");
_root.vol.dataProvider = volProvider;


Then i am defining a variable

Code:
chosenVol = _root.vol.selectedIndex;


When i make an

Code:
on (change) {
gotoAndStop(chosenVol+1);
};

(This is not the right code! But i hope you know what i want to do. You select for example Volume 2 in the Combo and the Flash Movie jumps to Frame Number 2.)

And there is another ComboBox with the name vol it gets empty :-/
How do i avoid this problem?

Thanks in advance

How To Automatically Open A Combobox On A Certain Frame?
Hey people,

First of all, thank you all for answering my questions.

Now I'm stuck on something new. I'm making a demo of some program. In the movie I use a ComboBox (standard component) and I want that the combobox automatically opens for a few seconds/frames so you can see what choices are in the box.

thanks in advance!
Tipsko

How Can I Make A Combobox Move The Playhead To A Certain Frame?
Ok, I am very new to Flash, so please bare with me.

What I am trying to do it create a map of an office building with a combobox under it that lists all the employees names. When you select one of the employees is shows an arrow on the map pointing to that persons office. I have the map done with the arrow set at a different office for each frame of the movie. I basically have two questions, one, how do I make the combobox jump to a certain frame? and two, is there a way to use an XML file or something for the labels in the combobox so that as people come and go I don't have to keep recompiling the flash movie?

Thanks for any help,
John

Components, Calling Frame Label From ComboBox
Are you allowed to post urls to other forums on here?
Because I have seen a post on another forum that is
similar, but it didn't solve my problem.

How do you call a Frame Label from a ComboBox (Component)?

Tried this:
"Drag your combo box onto the stage and give it an instance name.. ill be calling mine 'combo'.
Add the values to the label array.
In the 'change Handler' parameter... type 'gotoFunc'.

On the frame that the combo box sits on... we're going to declare a function which is called whenever a selection is made:


CODE

gotoFunc = function(){
mc.gotoAndStop(combo.getValue())
}

This function runs when the selection is made and tells the 'mc' movieclip to gotoAndStop at the frame with the same label as the selection made.

hope this helps.. "

But it doesn't work...

Any ideas?

Thanks in advance.

From Jack

Play & Reset FLV On Mouse Over And Mouse Out W/ Poster Frame
Hi everyone -
It's been a while since I've posted here but I'm glad to see the boards are still strong.

I'm working off of a tutorial I found on Monkeyflash called "Adding a Poster Frame to Flash Video". This tut allows me to select my desired still to show before the user click play and once the video resets.

Would I'd like for this to do is to play on Mouse Over. On Mouse Out, the video should stop and reset so that the poster frame appears once again, until the user Rolls Over once again to initiate playback from the start.

Here is what I have so far. The problem with the AS below is that once I mouse out it stops playing but I can no longer play the video on mouse over. Not only that, the video seems to stop only when I mouse out on top of the playback controls.


Code:
import fl.video.VideoEvent;

myPoster.addEventListener(MouseEvent.MOUSE_OVER, playMovie);

function showPosterFrame(event:Event):void {
myPoster.visible = true;
}
myVideo.addEventListener(MouseEvent.MOUSE_OUT, stopMovie);


function hidePosterFrame(event:Event):void {
myPoster.visible = false;
}

function playMovie(event:MouseEvent):void {
myVideo.play();
}
function stopMovie(event:MouseEvent):void {
myVideo.stop();
}

myVideo.addEventListener(VideoEvent.PLAYING_STATE_ ENTERED, hidePosterFrame);
myVideo.addEventListener(VideoEvent.COMPLETE, showPosterFrame);

[MX04] I Don't Manage To Make This Combobox To Frame Work, I'm Getting Crazy,may Day
I' ve tried several time to make this works, it's a combobox in the "reportajes" part (spanish button first) It must manage to go to different frame labels, I don't know what I'm doing wrong, could u help me?





here's the fla

ComboBox Doesn't Use ComboBox Assets
I've been customizing some components, and discovered that the ComboBox doesn't actually use the ComboBox Assets, but instead uses the ScrollBar Assets. I need to have a slightly different design for the ComboBox down button. Does anyone know how to make the ComboBox use it's own assets, perhaps by editting the ComboBox.as or ComboBase.as file?

Thanks.

ComboBox Problem, Displays A "text Box Like" Object Instead Of A ComboBox
Hello friends,

A friend of mine is having a tough time getting a ComboBox integrated into an existing flash movie, to work right.

Here's the story so far.....

The ComboBox when tried out in a sample new file works absolutely fine, but when the same thing (see code below) is added to
an existing movie (which has a preloader in Scene 1) does not work at all. Instead, it displays a "text-box-like" object in place of a
ComboBox...


Code:


form = new Object();
form.change = function (evt){
trace(evt.target.selectedItem.label);
}
comboBox.addEventListener("change", form);



Now, is there a possibility that because a preloader exists in the movie, the ComboBox does not work, not sure on this reasoning!

If someone could help out here, I'd really appreciate it!

Previous Frame Overlay..... Frame By Frame By Frame By Frame By Frame By.....
Hello there.

I am trying to create a small animation just as a little bit of fun. I would like to do it frame by frame.

I have a simple question to ask about frame by frame animation.

When drawing frame by frame, you would usually have a transparent overlay that you can compare with the next frame. Is there a way to do this in flash without having to copy the previous keyframe into a new keyframe on a new layer?

Thanks Emdiesse

Reset
Hello. I have some code on a button to enlarge a movieclip in my movie.
pictures._xscale = pictures._xscale + 5;
pictures._yscale = pictures._yscale + 5;

and similar code on another button to make it shrink back down.

The problem comes when someone enlarges the picture really large (like a zoom) that it takes forever to bring it back down to the original size. Is there a way to "reset" it back to original size whether it is large or small?

One Mc Causes All Other Mc's To Reset?
How can I script it so that a movie clip (which contains a button) will "reset" or temporarilly stop all other mc's on the same stage from playing?

Thanks!

How To Reset The Swf
Is there a way to reset the entire swf from scratch without using

Code:
loadMovieNum("NameOfFile.swf", 0);


What I want to do is reset it without using the filename (NameOfFile.swf)

Maybe there's a way to do it using level0 or _root. or something. Any suggestions at all will help me to the extreme!

[F8] Reset Everything
In a game I'm making, when you die I want to give you the option to start over.
The problem I have is that timers, and everything else is just as it was before.
I've tried several different ways to get it to reset everything, but none of it works (which seems odd to me)
Is there some function to reset everything?
Thanks.

[F8] Reset Help
Hey, I'm creating a counting activity in which you input what you want to count by and what number to start at.

The chart goes up to 100. I have 100 movieclips that flip to green when clicked on and when you click reset, they should all flip back. The problem is they don't flip, with the exception of the last number clicked. When this happens, it flips but also duplicates that movieclip and you can see it underneath. I've tried many things now and done lots of searches but have been unable to fix it without the last one flipping and duplicating.

The file is too large to upload but this is my reset function.
code: this.btnReset.onRelease = function(){
countBy_txt.text="";
startAt_txt.text="";
trackspots=[];
Correct=[];
Notright=[];
gotoAndPlay(1);
resetSquares();

}
function resetSquares():Void{
square_1.gotoAndPlay(12);
square_2.gotoAndPlay(12);
square_3.gotoAndPlay(12);
square_4.gotoAndPlay(12);

}
There's more but it's just repetitive.
That clears all my arrays and textboxes, as well as lets the user start again but with the problem already mentioned.

Any help is greatly appreciated. Thanks in advance.

Don't Want It To RESET
i really need help on this one...
i'm trying to build a game on Flash MX, which I almost accomplished.
It's a space-invaders like game.
my problem is that the game resets itself, or goes to the next scene, or goes to the first frame of the first scene, apparently because i push too many buttons altogether.
player moves with arrow-keys, and shoots with CTRL-key.
If I hold CTRL down and move left, and then suddently change direction to right, it resets.

please help me if you can.
thank you!

I Want To Be Able To Reset My Swf
Hi everyone

Right im having a right hard time with flash at the mo.

The problem is that i want to be able to reset my swf. I am making a game and when it is gameover and you try to play the game again, everything stays the same. The score, movieclips etc

I am using the following code on a button


ActionScript Code:
on (press){
    unloadMovie("Project Freebird_06.swf");
    loadMovie("Splash.swf", 0);
}

on (release){
    fscommand("Quit");
}

It loads another swf called "Splash" and from that swf i have loaded the game swf, but it still stays the same.

It is totally stupid!

I just want to know if there is a way of just resetting an SWF

Thanks in advance

Is There A Way To Reset An AS?
I have an actionscript guessing game. And once u lose the user will be given an option of playing again by pressing the replay button.

My problem is, is that when they do replay the game, you can see what they did when they played the game first time thru. So is there a way to reset the AS once they pressed the replay button? or is it more of my AS coding that is making the problem??

thanks,

Reset The Value
I have a Number:textinput component on the stage with a default value of 20 and a label component next to it. If a user types in a number >= 51 the label displays "Maximum is 50". My question is: How can I reset the textInput back to the default value if a user types in a number >= 51? Here is my function so far:









Attach Code

private function errorCheck():Void
{
var ispercenttohi:Number = Number(percent.text);
if (ispercenttohi >= Number(51)) {
alertBox.text = "<font color='#ff0000'>Maximum is 50%";
} else {
alertBox.text = "";
}
}

Reset
hullo
can anyone please help me with my movie ??
i have looked everywhere trying to find the answer
what i am trying to do is to reset it to go back to the beginning

layer one has the mc

layer two has the buttons listed below on it
x
xscale
y
yscale
vis false
vis true
alpha
reset

these buttons all work -but not the reset button --is there a code that will reset the the mc so that i can repeat the functions

Reset
This should be simple but for a newbie ... Lets say there are 4 mc's in an array which can be dragged so far ao good , how do I get it to go back(reset) to the original positions(x and y co-ordinates) pressing a button?
Looks something like this so far...
var clips:Array = new Array(tree1, tree2, tree3, tree4);
for (var i = 0; i<clips.length; i++) {
clips[i].onPress = function() {
this.startDrag();
};
clips[i].onRelease = function() {
this.stopDrag();
};
}

reset.onPress= function(){
?????????
};

Reset MC
Can someone please show me an example of reseting a movie clip and then having it repeat the actionscript again continously? I'm using AS2.

Reset Swf
Hi I have built a drag and drop game but can't think what code to use to reset it without reloading the whole page. Any ideas?

http://www.robfrost.co.uk/temp/drag.html

Trying To Make Movie Play Frame X To Frame Y Then Switch To Frame Z..
Hello,

I was hoping someone could help me out with an issue I'm having. I have my flash on multiple scenes, and would like to play an animation when clicking on the navigation button before switching to a different scene.

I'm halfway to accomplishing this.

Here is what i used


Code:
_root.gotoAndPlay("changepage1");
_root.onEnterFrame=function(){
if(this._currentframe=="changepage2"){
gotoAndPlay("Home2",1);
}

}
The above code is on a blank keyframe. Changepage1 is the start of the animation and Changepage2 is the end of the animation.

Upon clicking the navigation button it plays the above scenes.

However it doesn't change scenes to scene "Home2".

Thank you in advance for all your replies.

Reset GetTimer() ?
Hi,
I'm using the getTimer function on about frame 5 of my movie but it seems to start on about 3 secs because of this. Is there any way to reset the function to zero?

Thanks.

Counter Reset
Hi there.

I have a movieclip where I loop a couple of frames
with this script:
----------------------------------------------------
// COUNTERSCRIPT
counter++;
if (counter<5) {
tellTarget ("_root.vante") {
gotoAndPlay ("snurr");
}
} else if (counter == 5) {
tellTarget ("_root.vante") {
gotoAndPlay ("tillbaka");
}
}
---------------------------------------------------------

When the loop has been completed five times,
the script tells Flash to go back to the beginning of the clip.

Now, the problem is, that whenever the user want to go back to this loopscript (which he/she can so simply
by clicking on the movieclip), then the counter has already fulfilled its task right? It has already counted
to five. So therefore, the next time flash arrives at
the script, the loop does not happen.

I wonder if there is a way of resetting the counter
so that the script may be reused as before?


Thankful for answers

Help Me Reset The Timer ?
I have a problem of using a timer with linked swf files. I want the timer in the 2nd swf file and not the first. even though it is only created in the 2nd file it starts as soon as the game starts (the first swf file). I believe that you cant reset the timer so I figure an alternative way to accomplish what I want be to set a variable in the first swf file to the timer (x), then in the 2nd swf file create another variable (y) equal to getTimer - x

that is

fileOne -> fileTwo
x = getTimer -> y = getTimer - x

Im pretty new to this whole flash thing.. how do I pass the variable x
onto the second swf file? the two are linked via an
onMouseEvent(release) event/ loadMovieNum. Also how do I reference the variable in the 2nd file?

thanks
Skek

When Does A Variable Get Reset?
Hello, hope somebody can help me with this.
I hav a movie clip with a dynamic text box within another movie clip.
I can set that variable to the value i want, like so:
_root.Button1.Field1 = "test"
Now, when i animate Button 1 ( a simple motion tween), the content of my text is gone when the animation is done. Should i set the variable in the first frame of Button1, so i gets reloaded all the time? Is there a way to keep the content of my variable without reloading the data?

Thanks.

GetTimer() - Reset?
Hello to everyone!

Does anyone know if it's possible to reset the getTimer() function while staying within a movie?

I'm creating a racing game, and need the time to reload each race, however even when the timer is placed in a seperate swf and loaded/unloaded, the timer remains!

Does anyone know how to reset the getTimer() function?

-- Or know the alternative -- use a date object to set the amount of milliseconds at the start, and then check that from the difference at the end??

Thanks!

Submit | Reset
I can't get my submit and reset FLASH buttons to work when embeded in my PHP form. Here's what I have for the submit button:
on(release){
getURL("handleForm.php","","POST")
}

And this for my reset button:
on(release){
input = ""
textarea = ""
}

But it only send me empty variables everytime. These buttons work when I place them in my Flash form, but not when embeded. Can anyone point me in the right direction??

Reset Timer
hey guys whats the easyest way to reset the timer....???

How To Reset A Timer
my code goes like this

onClipEvent (enterFrame) {
now = Math.round(getTimer()/1000);
if (now == 7) {
//reset timer
}
}
i want it to restart at 0

Reset GetTimer()
Ok it all works but when I reset it dosen't I know I am reseting it in the wrong place or something stupid like that .
Code:
onClipEvent (load) {
start=getTimer()/1000;
end=10;
}
onClipEvent (enterFrame) {
if (_parent._currentframe>1) {
now=getTimer()/1000-start;
if (now>=end) {
_root.eventsadd=false;
}
}
// here I want the timer to start back to 0;
//so when it is called again it will do the if statement
start=getTimer()/1000;
}

Reset Button
Is there a way of making every MC on the stage go to its first frame at the click of a button. I know it could be done by listing all the instances but i was curious as to whether there was a single piece of actionscript.

Copyright © 2005-08 www.BigResource.com, All rights reserved