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




Reset A Function



Hi,

I'm writting a very simple drag n' drop function with multiple buttons to drag. For some reason, my buttons would move together after the function has been called once.


ActionScript Code:
//BTNS//////////photo1.onRollOver = function() {    Snapper(photo1, 74.45, 133.2);};photo1.onMouseUp = function() {    draggable = false;};photo2.onRollOver = function() {    Snapper(photo2, 166.6, 131.7);};photo2.onMouseUp = function() {    draggable = false;};//SNAPPER FUNCTION 1Snapper = function (mc, reX, reY) {    // Boundries    mc.onPress = function() {        if (this.hitTest(_root._xmouse, _root._ymouse, true)) {            draggable = true;        }    };    mc.onMouseUp = function() {        draggable = false;        if (mc._x<207 && mc._y>240) {            // Snap            mc.Reposition(75, 375, 5);        } else {            // Return            mc.Reposition(74.45, 133.2, 5);        }    };    mc.onMouseMove = function() {        if (draggable) {            mc._x = _root._xmouse;            mc._y = _root._ymouse;            updateAfterEvent();            if (mc._x<60) {                mc._x = 60;            }            if (mc._x>650) {                mc._x = 650;            }            if (mc._y<50) {                mc._y = 50;            }            if (mc._y>400) {                mc._y = 400;            }        }    };};

thanks in advanced,
Al



Ultrashock Forums > Flash > ActionScript
Posted on: 2005-01-18


View Complete Forum Thread with Replies

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

Reset A Function
Hi,

I'm writting a very simple drag n' drop function with multiple buttons to drag. For some reason, my buttons would move together after the function has been called once.

PHP Code:



//BTNS//////////
photo1.onRollOver = function() {
        Snapper(photo1, 74.45, 133.2);
};
photo1.onMouseUp = function() {
        draggable = false;
};
photo2.onRollOver = function() {
        Snapper(photo2, 166.6, 131.7);
};
photo2.onMouseUp = function() {
        draggable = false;
};
//SNAPPER FUNCTION 1
Snapper = function (mc, reX, reY) {
        // Boundries
        mc.onPress = function() {
                if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
                        draggable = true;
                }
        };
        mc.onMouseUp = function() {
                draggable = false;
                if (mc._x<207 && mc._y>240) {
                        // Snap
                        mc.Reposition(75, 375, 5);
                } else {
                        // Return
                        mc.Reposition(74.45, 133.2, 5);
                }
        };
        mc.onMouseMove = function() {
                if (draggable) {
                        mc._x = _root._xmouse;
                        mc._y = _root._ymouse;
                        updateAfterEvent();
                        if (mc._x<60) {
                                mc._x = 60;
                        }
                        if (mc._x>650) {
                                mc._x = 650;
                        }
                        if (mc._y<50) {
                                mc._y = 50;
                        }
                        if (mc._y>400) {
                                mc._y = 400;
                        }
                }
        };
}; 




thanks in advanced,
Al

Reset Function
Here is my code for my Timer.

onClipEvent (load) {
start = getTimer();
startCount = 60;
}
onClipEvent (enterFrame) {
current = (getTimer()-start)/300;
if (current<startCount) {
elapsed = startCount-current;
bCounter = Math.floor(elapsed);
} else {
_root.speed += 10;
_root.score += 10;
}
}


It's a typical timer now see the last two picces of code that makes my speed and score go up but i dont want it to go up and keep going i just want to add 10 to both i figured in order to stop it i need it to reset.

So anyone know how i can make a rest function i never used it before jus heard of it.

Function Wont Reset, Please Help
Hi, i have a combobox(roster) set up with items. when the user selects one of the items, it will call a function(rosterSelect) which will set certain text in to dynamic text boxes depending on what they selected. It works, but.... only once, lol. I can select a item, watch the text show up in the text boxes, then i cant select any more items after that. the function is on the first frame of the layer, and all of this is done on the main time line. any ideas?

here is my code:

function rosterSelect (roster) {
value = roster.getValue();
if (value == "Smartsuite") {
_root.name.text = value;
_root.age.text = "20";
_root.location.text = "Michigan";
_root.aim.text = "smartsuiteDBD";
_root.quote.text = "Zx should die!";
_root.kills.text = "15137";
_root.deaths.text = "11048";
_root.flags.text = "178";
_root.games.text = "104";
_root.nickname.text = "****er of the Goats";
_root.picture.text = "N/A";
}
if (value == "Squadkiller") {
_root.name.text = value;
_root.age.text = "25";
_root.location.text = "Virgina";
_root.aim.text = "squadkillerDBD";
_root.quote.text = "Garth Brooks Rules!";
_root.kills.text = "14836";
_root.deaths.text = "11428";
_root.flags.text = "67";
_root.games.text = "103";
_root.nickname.text = "Mini-Van Man";
_root.picture.text = "N/A";
}
if (value == "Rabbiz") {
_root.name.text = value;
_root.age.text = "20";
_root.location.text = "Washington, DC";
_root.aim.text = "rabbi2153";
_root.quote.text = "";
_root.kills.text = "11361";
_root.deaths.text = "6076";
_root.flags.text = "45";
_root.games.text = "91";
_root.nickname.text = "Funny looking kid";
_root.picture.text = "N/A";
}
if (value == "Kap") {
_root.name.text = value;
_root.age.text = "13";
_root.location.text = "Arizona";
_root.aim.text = "g m p lyng";
_root.quote.text = "";
_root.kills.text = "60451";
_root.deaths.text = "4891";
_root.flags.text = "143";
_root.games.text = "60";
_root.nickname.text = "The Kaptain of Loooveeee";
_root.picture.text = "N/A";
}
}


I just tried updateAfterEvent(); and still didnt work. Any ideas?

Reset The 'getTime()' Function
Is there a way to reset the getTime() function.

Base off useing a Reset Button to reset the "Game".

A Reset-function For Components?
Hi,

I have a textArea component that loads new text from a txt file at every new frame.. the problem is that the length of text is very different so some have scrollbars and other has not, in some cases when the user reads the text and scrolls down then the decides to press the "forward" button and read new text, the textArea do not jump back up to the beginning but instead leaves the the scrollbars half way down... wich makes the new text a little confusing as it starts half way down. is there some way that I can reset the component, I tried both redraw and invalidate , but Im not shure I understand these classes... cant get them to do what I want anyway..

Thanks for any help you can give..

Random Function, How To Reset?
Hey guys. I'm working on a program I use in class to keep my kids' heads from exploding on a daily basis. The major aspect of this is a grid with nine text boxes which get randomly filled with vocab words, grammar problems, etc. (language arts class) for them to puzzle over.

Here's my problem. It's kind of complicated. I've got three types of functions.

The first chooses a number from 1 - 5, and based on the outcome, decides whether to stick vocab, grammar, or prefixes into the boxes. Once this has been decided, it runs the next function, which randomly selects (out of 75 or 50 or 20) the one item to stick in each box. I save the item (as a string) to the variable I want to use, and then I assign that item to each individual text box. The outcome looks something like this:

boxfill();
_level0.box_1 = selection;
boxfill();
_level0.box_2 = selection;
boxfill();
_level0.box_3 = selection;

and so on for nine boxes. boxfill() is the function that decides WHAT goes in the box, and "selection" is what it has decided on. Here's the weird thing: it will re-randomize to choose whether it should stick a vocab, grammar, or prefix into the box - but then it KEEPS the same one it chose for the last one. God this is so confusing trying to explain it. (example: for nine boxes it will choose three vocab words, three grammar problems, and three prefixes, but each vocab word is the same, each grammar the same, etc.) Is anyone following this?

Basic question: How do I reset the "randomization" so that it returns a new item? I'm banging my head against the wall. (My seventh graders are, too.)

Function Reset Question
I'm using this function to fade out some movie clips on press


Code:

function community() {
community = new Array(1, 2, 3, 6, 9, 11, 13, 16, 7);
for (z=0; z<community.length; ++z) {
i = community[z];
_root.cylinder["cylinder_small"+i].fadeout(30);
}
}

on(press){ community()}
It works fine but when movie clips are set back to _alpha 100 and I press that function again, and it doesnt work. It only works first time. Why?

Reset Using GetTimer Function
any help please ? I'm creating an interactive art installation using flash to control an animation via an external web-cam. but I'm having problems reseting the animation if it is in active for say 7 minutes. any help would be much appricated.


Code:
webCam = Camera.get();
myVideo.attachVideo(webCam);
myVideo.smoothing = 10;
myVideo._alpha = 0;
webCam.setQuality(16384, 100);
webCam.setMotionLevel(20, 50);
webCam.setMode(1024, 768);
var aImages:Array = new Array(mcOne, mcTwo, mcThree, mcFour, mcFive, mcSix, mcSeven);
var resetTimer:Number;
var nCurrentIndex:Number = 0;
x = 0;
function motion(mode) {
x++;
return mode;
}
// fade image function
function fadeImage(mcImage:MovieClip):Void {
mcImage._alpha -= 10;
if (mcImage._alpha<=0) {
clearInterval(nInterval);
nCurrentIndex++;
}
updateAfterEvent();
}
//reset image function
function resetImage(mcImage:MovieClip):Void {
for (var i:Number = 0; i<aImages.length; i++) {
aImages[i]._alpha = 100;
}
nCurrentIndex = 0;
}
// activity function
webCam.onActivity = function(mode) {
if (motion(mode) == true) {
clearInterval(nInterval);
nInterval = setInterval(fadeImage, 200, aImages[nCurrentIndex]);
}
if (nCurrentIndex == 7) {
resetImage();
clearInterval(nInterval);
nInterval = setInterval();
}
trace("there is activity");
if (motion(mode) == false) {
trace("there is NO activity");
getTimer();
if (getTimer()>=70000) {
trace("Start Timer");
resetImage();
}
}
}

Complete Reset Function
Hey all.
I'm almost embarresed to ask this, but this is the newb forum and I'm a newb.

I have a project where I'm making an animation for a client, a projector basically.

There's non-scripted animation going on in the main timeline and the basic stop action at the end.

On the main timeline there are several movieclips with individual animations that needs to be in movieclips due to transitions going on on the main timeline.
the movieclips also contain stop actions at the end since the need to stop in a finished state.

Now I want a reset button that plays the projector from the start all over.
A simple gotoAndPlay doesn't work since that means that all movieclips on the main timeline is already animated and would stay on the stop frame.

I've read my books and searched the net but my lack of AS knowledge has prevented me from finding a solution. So I now crawl to the cross and beg you for help.

How should I write this action so that it goes to frame 1 of the main timeline and plays from there, but also resets all movieclips to their frame 1.

Grateful for help, regards / Johan

SetInterval(); Can It Be Reset Within The Function It's Calling?
I'm using a setInterval(); to call a function every few seconds, but within the function I need to be able to reset the setInterval(); in order to call the function again when a certain condition is met. Can I do that?

Reset Timer Function After 3 Minutes?
How would I get a timer function to reset after no buttons were pressed for 3 minutes?

Right now I have my timer starting on load, and then when a button is pressed, it stops it. I basically want to restart it after 3 minutes.

the code I have:

[PHP]var timer:Timer = new Timer(5000);
timer.addEventListener(TimerEvent.TIMER, playSlides);
timer.start();

function playSlides(event:Event):void{
var i:Number = Math.round(Math.random()*slideinfo.length());
loader.load(new URLRequest(xml.slide.@data));
caption.text = xml.slide.@caption;
}[/PHP]

then the timer.stop(); attached to the buttons...

thanks

Reset Timer Function After 3 Minutes?
How would I get a timer function to reset after no buttons were pressed for 3 minutes?

Right now I have my timer starting on load, and then when a button is pressed, it stops it. I basically want to restart it after 3 minutes.

the code I have:

[PHP]var timer:Timer = new Timer(5000);
timer.addEventListener(TimerEvent.TIMER, playSlides);
timer.start();

function playSlides(event:Event):void{
var i:Number = Math.round(Math.random()*slideinfo.length());
loader.load(new URLRequest(xml.slide.@data));
caption.text = xml.slide.@caption;
}[/PHP]

then the timer.stop(); attached to the buttons...

thanks

FLVPlayback_Captioning Reset Or Track Function
Hi,

Couldn't find this anywhere online. What kind of reset function can I use to return to the last played caption node of a tt styled xml file. The xml file is loaded by a FLVPLayback Captioning component on the stage? I believe I need to use the track function?? And how do I set the track parameter in a tt styled xml file? Am I using the wrong XML file style (tt vs. DOM)?

Thanks in advance.

Using A Timed Function To Reset A Movie Clip
Hi there,
This question is a little easier than my last one, but I still need help with it. I am working with something where a movie clip is called on to display addresses on different frames. When a user clicks on the dot for a certain address, it calls the addresses movie clip and goes to that address. What action script can I use to make it so that if no one clicks on the address information in a certain time period, the movie clip that has the addresses in it goes back to its first frame which is blank?

I am still very new to actionscript, obviously, so any help is very welcome and appreciated.

Thanks, Jeremiah

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

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

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.

How Can I Reset The Movie
hullo --i have f5
can anyone please help me with my movie ??
i have looked everywhere trying to find the answer but to no avail
what i am trying to do is to reset it to go back to the beginning after i have clicked all the buttons

layer one has the mc which is a rotation

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 or function that will reset the the mc so that i can repeat the functions buttons as often as i may like to ,

thankyou for any help Terry

Reset GetTimer() Value ?
I want to reset getTimer() value every time someone click on some link on my page so i can use this value in preloader of that external .swf. How can i do this???

thanks

How To Reset Get Time ?
hi all
i have a flash card with 2 scenes in the main scene after 35 seconds there will be an action and after 50 secons there will be another action

i use this action

_root.onEnterFrame = function() {
x=Math.floor(getTimer()/1000)

if (x ==35) {
_root.water.kalam.play();
} else if (x==70) {
_root.water.kalam.play();

}
};


but when i insert the preloading scene every thing will be wronge coz the time will count with the first scene how can i reset the time in the first frame from the main scene i use this code and again nothing happen


function timer() {
var x = getTimer()/1000-_root.resetMe;
return x;
}
function reset() {
_root.resetMe = getTimer()/1000;
}
_root.onEnterFrame = function() {
x = Math.floor(timer()/1000);
if (x == 36) {
tellTarget ("/main/water/klam") {
play();
}
tellTarget ("/main/water/klam1") {
play();
}
} else if (x == 73) {
tellTarget ("/main/water/klam") {
play();
}
tellTarget ("/main/water/klam1") {
play();
}
} else if (x == 129) {
tellTarget ("/main") {
play();
}
}
};

so can i reset the time in the first frame from the main scene

How To Reset Get Time ?
hi all
i have a flash card with 2 scenes in the main scene after 35 seconds there will be an action and after 50 secons there will be another action

i use this action

_root.onEnterFrame = function() {
x=Math.floor(getTimer()/1000)

if (x ==35) {
_root.water.kalam.play();
} else if (x==70) {
_root.water.kalam.play();

}
};


but when i insert the preloading scene every thing will be wronge coz the time will count with the first scene how can i reset the time in the first frame from the main scene i use this code and again nothing happen


function timer() {
var x = getTimer()/1000-_root.resetMe;
return x;
}
function reset() {
_root.resetMe = getTimer()/1000;
}
_root.onEnterFrame = function() {
x = Math.floor(timer()/1000);
if (x == 36) {
tellTarget ("/main/water/klam") {
play();
}
tellTarget ("/main/water/klam1") {
play();
}
} else if (x == 73) {
tellTarget ("/main/water/klam") {
play();
}
tellTarget ("/main/water/klam1") {
play();
}
} else if (x == 129) {
tellTarget ("/main") {
play();
}
}
};

so can i reset the time in the first frame from the main scene

Reset GETTIMER() ?
i got this timer thing working but i want to be able to reset it, ttried forcing the text box varible to 0 but it seems to be over written by the getTimer function.

any ideas?

Counter Reset
I was just wondering what would be the best way to reset a counter?

the situation I have here is that I have a little 10 question quiz game.

On the main timeline, there is only ONE frame.

When the counter goes up to 10, a mc would be trigger to play.

This mc has a button in it that would ask whether they would like to play again.

So once they click on that, I would like it to reset the counter, but it seems that it just exits from the mc and back to the main timeline, and DOES not reset the counter.
***********************************

Also, there is this other button on the mc that if they click onto, it will bring them to the nextscene(). But for some reason it doesn't, instead, just goes back to the main timeline. However if I specify to gotoAndPlay ("scene name"), it worked out fine.

MyColorObject Reset?
Senocular helped me with the script below - as the MC contains a button with a rollover I want the NormColour have no effect so the rollover can be seen, ie if the result id false cancel the colour effect.

Any suggestions would be cool
Thanks Oll

onClipEvent (load) {
myColorObject = new Color(this);
atcolour = 0xFF0000;
normColour = 0x009933;
}
onClipEvent (enterFrame) {
if (_root.curFile=="02") {
myColorObject.setRGB(atcolour);
} else {
myColorObject.setRGB(normColour);
}
}

>>> Reset Timer?
is there a way to reset a timer you use..

---
elapsed = getTimer();
---
how do I reset it?

thanks!

Panels Keep Getting Reset
I notice that when you open many other flash files (FLA) that usually belong to someone else, Flash removes all the panels from view upon opening.

I have to goto WINDOW >> PANEL SETS >> am layout

in order to get it back to the way I like them. Is there any way to prevent this or is there a hot key to get my panel set back?

Reset Variables
I have 6 buttons and 6 variables 1 variable on each button.
I want to be able to reset the variables using another button so i can start the process again. does that make sense?

I have tried doing this

on (press) {
_level0.text |= 0;
}

but it doesnt work.

Please help

Reset A While Loop
Hi All

Hope you can help...

I have a while loop that looks like this

n = 1;
while (n < 30) {
if (this.hitTest(_root.interface["word" + n]) and (this["playing" + n] != 1)) {

_root.interface["word" + n].gotoAndPlay("go");
this["playing" + n] = 1;
}
n++;
}

It basically sets the variable playing to 1, so that it can only be played once through the animation. Im having difficulty though resetting the variable so that it can be played again, by clicking a play again button.

Hope that makes sense...

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