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




Stopping A Timer



I have created a timer for a game that I'm authoring. I have used the following actionscript to construct:

function runTimer() {
var timerStart:Number = 60;
var what:Number = timerStart-(Math.round((getTimer())/1000));
outputText_txt.text = what;
if (what == 0) {
_root.intro_mc.sound_mc.gotoAndPlay(3);
_root.intro_mc.runner_mc.runnerAll_mc.gotoAndStop( 33);
_root.intro_mc.obstacles_mc.unloadMovie();
_root.intro_mc.prizes_mc.unloadMovie();
_root.intro_mc.carsConstant_mc.unloadMovie();
_root.intro_mc.background_mc.stop();
_root.intro_mc.timer_mc.unloadMovie();
_root.intro_mc.outputText_txt.textColor = 0xff0000;
_root.intro_mc.outputText_txt.text = "GAME OVER";
}
}
var runningClock:Number = setInterval(runTimer, 100);

When the timer, variable "what", reaches 0 I want all of the things in the "if" statement to happen. That all works fine. Problem is that when I exit and then re-enter the game, the timer starts where I left off at the last game even if I let it run down to 0. ie it starts 0, -1, -2, etc.

I want the timer to reset to 0 either onRelease of a stop button that I've made or upon reaching 0. I've tried clearInterval(runningClock) and noticed that just stops the clock.

HHHHEEEELLLLLPPPP!!

Thanks!



FlashKit > Flash Help > Flash ActionScript
Posted on: 01-27-2006, 06:59 PM


View Complete Forum Thread with Replies

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

[F8] Stopping A Timer.
I have a simple clock/timer running from frame 1-6 on my game.
On the next scene I want the timer to stop so it will say: "It has taken you *timer/clock* seconds to complete this level!

The problem is, how can i bring my clock over to the next scene. I'm guessing when I click the button to take me to the next scene in that IF statement before the command which takes me to scene 2, I write something like count.stop or a stop command of somekind, but then how do i pull the values out of it and display it on my next scene?
Here is the code for my clock.


Code:


start_time = getTimer();

countdown = 7200000;

onEnterFrame = function () {

elapsed_time = getTimer()-start_time;

_root.count.text = time_to_string(elapsed_time);

_root.count_down.text = time_to_string(_root.countdown-elapsed_time);

};

function time_to_string(time_to_convert) {

elapsed_hours = Math.floor(time_to_convert/3600000);

remaining = time_to_convert-(elapsed_hours*3600000);

elapsed_minutes = Math.floor(remaining/60000);

remaining = remaining-(elapsed_minutes*60000);

elapsed_seconds = Math.floor(remaining/1000);

remaining = remaining-(elapsed_seconds*1000);

elapsed_fs = Math.floor(remaining/10);

if (elapsed_hours<10) {

hours = "0"+elapsed_hours.toString();

} else {

hours = elapsed_hours.toString();

}

if (elapsed_minutes<10) {

minutes = "0"+elapsed_minutes.toString();
} else {

minutes = elapsed_minutes.toString();
}

if (elapsed_seconds<10) {

seconds = "0"+elapsed_seconds.toString();

} else {

seconds = elapsed_seconds.toString();

}

if (elapsed_fs<10) {

hundredths = "0"+elapsed_fs.toString();

} else {

hundredths = elapsed_fs.toString();

}

return minutes+":"+seconds+":"+hundredths;

}

Stopping The Timer
I'm trying to run this as to detect a mouse movement, triggers the timer after last mouse movement then calls the FSCommand after 10 seconds. This works fine but how can I stop the countdown after the fscommand executes?


Code:
onMouseMove = function(){
clearInterval(myTimer);
myTimer = setInterval(screensaver, 10000);
}

function screensaver(){

if (myTimer >= 0) {
clearInterval(myTimer);
}

fscommand("TIMEOUT", "main");

//trace ("TIMEOUT");
}

Stopping A Timer
I'm using a shell swf to load and and unload a series of other swfs. Some of the swfs I'm loading have timers that don't stop when I switch from one swf to the next. I'm using the removeChild command to unload the current swf and that works fine for everything but the timers that are coded into that swf. Any help is appreciated. Thanks.

Stopping A Timer
I've been making a game that includes a timer, and now I running into a problem. The timer works - it counts down to zero, and then when it reaches zero, it goes to a different scene and determines whether or not the player has enough points to pass the level. However, If you retry the level, the timer goes by twice as fast when the level plays again - which I'm pretty sure means that the timer is continuing. I need to figure out how to stop the timer right when it reaches zero... Here's my code so far, which I have in the first frame of my scene:


Code:
stop();
timer = 30;
function wait() {
timer--;
if (timer == 0) {
gotoAndPlay("lvl1-score",1);
}
}
myTimer = setInterval(wait, 1000);
explained:

. line 1: stops the movie
. line 2: sets the starting value for the timer
. line 3: defines the function 'wait'
. line 4: tells the timer to countdown
. line 5: defines what is to happen when the timer reaches '0'
. line 6: tells the movie to go to a different scene and frame
. line 7: sets the 'interval' on the timer so that it counts one second at a time

Does anyone know what I should add that will stop the timer at zero ?

Stopping A Countdown Timer
I've downloaded a timer fla from Flashkit (thanks to all you people who make and submit those movies) and it works great, except I need it to stop at a certain frame, and I just can't figure out how to do that. Any advice would be appreciated,

Rose

Stopping A Counter Timer
Hi, I've posted this question to the Newbies section (because I am one, ) - but I don't suppose anyone knew the answer. I've put a counter timer into my Flash file, but I don't know how to stop it. I'd like to stop it at a certain frame. This is the code I currently have:

millitime = getTimer()/60000-(int(getTimer()/60000));
seconds = (int(millitime*60));
mymin = (int(getTimer()/60000));
if (Number(mymin)<1) {
mintime = "00";
} else {
mintime = (int(getTimer()/60000));
}
minfield = mintime;

I have the counter in a layer of it's own, and I've tried just putting a stop action in, but it doesn't work.

Can anyone give me some advice?

Thanks,

Rose

Stopping A Looping Timer
I have a timer counting down to 0 from 5000 milliseconds, it goes back to 5000 onces it reaches 0. I was wondering how to get a movieclip to stop the timer once clicked on. I have provided the .fla below, I just need some help with the "button1" movieclip, any explanation of the code you can help me with will be awesome. Thanks! I use Flash MX Professional 2004.

[F8] Stopping A Count-up Timer
how do you make a count up timer that is easily stoppable?

Timer Stopping Problem
I'm using a shell swf to load a series of other swf's when a next button is pressed. I'm using a "removeChild" command to unload one swf before loading the next one. The problem is that on a couple of swf's I'm using timers to start and stop videos. The timers keep doing their thing even after I've removed the swf. Is there way of coding the swf that follows the timer swf to stop the timers? Thanks

//This the timer I want to stop
var SelectCatTimer1:Timer = new Timer(20 * 1000, 1);
//SelectCatTimer:addEventListener("timer", SelectCatTimerHandler);
SelectCatTimer1.addEventListener(TimerEvent.TIMER_ COMPLETE, SelectCatTimerEnd1);

//Function that executes when the timer concludes
function SelectCatTimerEnd1(event:TimerEvent):void {
SoundMixer.stopAll();
mondeploy.visible = false;
monstow.visible = true;
theVideo2.visible = false;
montext1.visible = true
montext2.visible = false;
dpcuPA.visible = false;
dpcu8.visible = true;
click1.visible = true;
var soundchannel:SoundChannel = sound.play();

Stopping Countdown Timer
How do I stop a countdown timer at any particular time using a button?

I currently have a countdown timer with 10 seconds and would like the timer to stop when I press a button. Any ideas?

AS2/Flash 8 Help On Stopping Timer
I need help stopping a timer. I had help from an advanced AS person, but he is gone on vacation and is unable to help me--and I need this today. I have a variable blnEdit that he told me if it was true I would not increment the timer number. So what would the code be to not increment the timer? I just don't know what to put where the red X is.

displayTime2 = 30;
function countDown2() {
displayTime2--;
if (displayTime2<=0) {
frameNumber = ranMove[random(ranMove.length)];

//and it lists conditions but I need help on this:

if(blnEdit == true) {
displayTime = X ;
displayTime2 = X;
trace("we are in edit mode");
}

Problems With Stopping Timer
Can anyone explain to me, why stopping the timer after 50 runs doesn't work in the following code:


Code:
var timer:Timer = new Timer(50);
timer.addEventListener(TimerEvent.TIMER, flopActions);
timer.start();

var a:Number = 0;

function flopActions(evt:TimerEvent):void
{
a++;
trace(a); // 1, 2, 3, 4, 5, 6, ...
if(a == 50)
{
trace("please stop ;-)" ); // output: please stop ;-)
evt.target.stop(); // doesn't work
timer.stop() // doesn't work
}
}

OnClose Or OnDestroy Event? For Stopping An "alive Timer"?
I am trying to run a timer when a flash movie is loaded up in the browser and then when the movie is killed (by the browser going to a new webpage or being closed) I want to stop the timer and send the total "alive time" to a server for tracking purposes.  

This works great in a java applet where there is an onDestroy event, but I haven't been able to find a mechanism to get this done in a flash movie...

Very simple idea:
1).swf loads in browser
2).swf starts timer
3)surfer goes to new page or closes browser
4).swf stops timer and sends total time (in getURL data) to server

Any advice? THanks a lot!




Stopping A Action Scrpit Without Stopping The Movie ?
Hello all,

I new to flash and used a snow script i found on flash kit. Anyway my problem is i cannot stop the snow half way thought the movie ?

Link to the working file

http://www.megaupload.com/?d=S0ZNMFP6

Thanks

Stopping A Action Scrpit Without Stopping The Movie ?
Hello all,

I new to flash and used a snow script i found on flash kit. Anyway my problem is i cannot stop the snow half way thought the movie ?

Link to the working file

http://www.megaupload.com/?d=S0ZNMFP6

Thanks

Stopping A Movie Without Stopping Submovies
I have a looping animation contained in another movieclip, the parent clip stops on about frame 20 and this causes the submovie to stop playing, is there anyway round this.

Difference Between Timer.stop() And Timer.reset()?
Hello,

What is the difference between Timer.stop() and Timer.reset() functions because it seems that the 2 functions do the same thing? I image Timer.stop() to stop the timer and when Timer.start() is called the timer starts from where it stopped. For example, if I have a 3 sec. timer (3000 ms). If I stop the timer after 2.5 sec. and start the timer again, I would expect the timer to expire/trip within .5 sec. Is this a correct assumption?

Thanks,

Nilang

Difference Between Timer.stop() And Timer.reset()?
Hello,

What is the difference between Timer.stop() and Timer.reset() functions because it seems that the 2 functions do the same thing? I image Timer.stop() to stop the timer and when Timer.start() is called the timer starts from where it stopped. For example, if I have a 3 sec. timer (3000 ms). If I stop the timer after 2.5 sec. and start the timer again, I would expect the timer to expire/trip within .5 sec. Is this a correct assumption? Code is attached below.

Thanks,

Nilang







Attach Code

// Declarations
var url:URLRequest;// Url
var snd:Sound;// Sound Object
var sndChan:SoundChannel;// Sound Channel Object
var sndPosition:Number;// File offset
var tmr:Timer;// Timer object
var isPlaying:Boolean;// Flag to indicate whether file is
// playing or not
var isPlayDelayed:Boolean;// Flag to indicate whether starting
// of file has been delayed or not

var hours:Number = 0;// Hours
var minutes:Number = 0;// Minutes
var seconds:Number = 0;// Seconds
var milli:Number = 0;// Milliseconds

var pauseTime:Number = 0;// Time when paused
var pauseLength:Number = 0;// Length of pause
var buttonPressTime:Number = 0;//

var timing:Boolean = false;// Flag

// Initialize variables.
isPlaying = false;
isPlayDelayed = true;
sndPosition = 0;

// Get url
url = new URLRequest("sound1.mp3");

// Create new Sound object
snd = new Sound();

// Create new SoundChannel Object
sndChan = new SoundChannel();

// Create a new Timer Object with timeout of 5 sec.
// and repeat it only once.
tmr = new Timer(5000, 1);

// Load the audio file
snd.load(url);

// Enable Event Listeners
tmr.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete);
stop_btn.addEventListener(MouseEvent.CLICK, onStop);
pause_btn.addEventListener(MouseEvent.CLICK, onPause);
play_btn.addEventListener(MouseEvent.CLICK, onPlay);
this.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);

// Start time
pauseElapsedTime(false);

// Start Timer
tmr.start();

// Function that handles timer events
function onTimerComplete(e:TimerEvent):void
{
// Play audio file when timer complete event is received
sndChan = snd.play(sndPosition);

// Set the isPlaying to true to indicate file is playing
isPlaying = true;

// Set the isPlayDelayed to false
isPlayDelayed = false;

trace("onTimerComplete: " + e);
trace("target: " + e.target);
trace("current target: " + e.currentTarget);
}

// Function that captures frame events
function onEnterFrameHandler(e:Event):void
{
// Local variables
var totalTime:Number = (getTimer()/1000)-pauseLength;
var goTime:Number = totalTime-buttonPressTime;

// If flag is true, then calculate the time that has elapsed
if( timing )
{
// Calculate time
hours = Math.floor(goTime/3600);
minutes = Math.floor((goTime/3600-hours)*60);
seconds = Math.floor(((goTime/3600-hours)*60-minutes)*60);
milli = Math.floor((goTime-(seconds+(minutes*60)+(hours*3600)))*100);

// Display elapsed time
timeText.text = format(hours) + ":" + format(minutes) + ":" + format(seconds) + "." + format(milli);
}
}

// Function that captures mouse click events when user clicks stop button
function onStop(me:MouseEvent):void
{
// Reset time
restartElapsedTime();

if (isPlaying)
{
// If audio file is playing then stop the audio file, set file offset to zero,
// and set isPlaying flag to false
sndChan.stop();
sndPosition = 0;
isPlaying = false;
isPlayDelayed = true;
}
else if (isPlayDelayed)
{
// If audio playback is delayed then reset the timer and
// set isPlaying to false
tmr.reset();
isPlaying = false;
}
}

// Function that captures mouse click events when user clicks pause button
function onPause(me:MouseEvent):void
{
// Pause time
pauseElapsedTime(true);

if (isPlaying)
{
// If audio file is playing then stop the audio file,
// set file offset to current offset, and set isPlaying flag to false
sndChan.stop();
sndPosition = sndChan.position;
isPlaying = false;
}
else if (isPlayDelayed)
{
// If audio playback is delayed then stop the timer and
// set isPlaying to false
tmr.stop();
isPlaying = false;
}
}

// Function that captures mouse click events when user clicks play button
function onPlay(me:MouseEvent):void
{
// Start time
pauseElapsedTime(false);

if (!isPlaying)
{
if (!isPlayDelayed)
{
// If the audio file is not playing and playback is not delayed, then
// play the audio file from the last offset and set isPlaying to true
sndChan = snd.play(sndPosition);
isPlaying = true;
}
else
{
// If the audio file is not playing and playback is delayed, then
// start the timer and set isPlaying to false
tmr.start();
isPlaying = false;
}
}
}

// Function that sets the time to 00:00:00.00 (default)
function restartElapsedTime():void
{
timeText.text = "00:00:00.00";
buttonPressTime = (getTimer()/1000)-pauseLength;
pauseElapsedTime(true);
}

// Function that pauses time
function pauseElapsedTime(b:Boolean):void
{
if( b )
{
pauseTime = getTimer()/1000;
}
else
{
pauseLength = ((getTimer()/1000)-pauseTime)+pauseLength;
}
timing = !b;
}

// Function adds 0 to the front of the number when it is < 10 and
// returns a String
function format(n:Number):String
{
if( n < 10 )
{
return ("0"+n);
}
return n.toString();
}

Timer - Not Timer Class, But Time Taken To Do Certain Events
So i'm making a little game and want to know how to start a timer and display the number of milliseconds between the start and finish of two different events. I do not want to run a function after 5000 milliseconds or whatever, just record the length of time taken to say click two buttons.

Basically a stopwatch.

I saw the getTimer(); function but i'm not sure of how to use it or if that is what i need.

Once again, thanks for your time.

Running Timer And Timer With Offset
Hello all,

I'm trying to set up two timers in that dare feed the time in minutes and seconds from the server.

Basically, I've got a master running timer in seconds and minutes but also want to have a second cloned timer that is feed some seconds via flashVars to add to the the master time.

Both of these timers once set by the sever time feed in, and with one being offset, are called every second by a setInterval function call so they count up.

Setting up the master running timer isn't a problem but with my coding skills is a little messy..


Code:
_global.masterRunningTimeInMinutes = 59;
_global.masterRunningTimeInSeconds = 55;

if (_global.masterRunningTimeInSeconds>0 && _global.masterRunningTimeInSeconds<59) {
_global.masterRunningTimeInSeconds++;
} else {
_global.masterRunningTimeInSeconds = 0;
_global.masterRunningTimeInSeconds++;
if (_global.masterRunningTimeInMinutes>=0 && _global.masterRunningTimeInMinutes<=58) {
_global.masterRunningTimeInMinutes++;
} else if (_global.masterRunningTimeInMinutes>=59 && _global.masterRunningTimeInSeconds>=0) {
_global.masterRunningTimeInMinutes = 0;
}
}
if (_global.masterRunningTimeInSeconds<10) {
_global.masterRunningTimeInSeconds = "0"+_global.masterRunningTimeInSeconds;
}

_root.runningTime.text = "v"+_global.masterRunningTimeInMinutes+":"+_global.masterRunningTimeInSeconds;
Ideally I wanted to to get the master running time to display MM:SS so if anyone can help with that that would be great!

I suppose the real problem I'm having is is setting up the pattern for determining the cloned time with the offset.

This is becoming a real headache but if anyone can help I would really appreciate it! Basically I just wanted to have the running time with the cloned time always a certain amount of seconds ahead.

Many thanks, amp3

Stopping All MC'S?
is there anyway using code to just stop all playing mc's and then resume them all?

thanx

Stopping A Mc From Another One...
Whats going wrong with this script?

I try to control a mc from another one:

-----------------------------------------
1. MCName is my variable for the clip!
2. Both mc`s are in a mainmovie!
-----------------------------------------

on (release) {
MyClip = "_root"+"."+_root.MCName;
MyClip.gotoAndStop(2); -> I think here is my mistake!
}

------------------------------------------

Thanks!!

Mikalux

Stopping A MC
Hi All,

I'm struggling with this one and i'm sure that it's an easy one to solve.

After downloading a menu system from flashkit i've amended the code and design slightly to give me the look that I want. Each button is allocated to a wedge on the menu system, which when clicked opens and when hovered off closes.

you can find the menu at www.partyboy.org/flashstuff/

Each button has the code:

on (rollOver) {
revolver_mc.carrRotate(number);
}
on (rollOut) {
revolver_mc.cartRetract();
}
on (release) {
revolver_mc.cartOpen();
}

Where the number is the relevant wedge to rotate to.

2 Questions for ya:

1. How can I force the movie to finish even if say, i've hovered over another button. eg. I hover over the "journal" button, I want that movie to finish playing even if I move the mouse over the "link" button before it's finished?
2. I have a text effect which I want to apply to my buttons. I want this effect to play when the page loads up and stop. How do I apply it without affecting the action of the buttons i've already added?

Anyones helps is much appreciated!

MP3 Is Not Stopping
I am only a novice so don't laugh.

I am creating a Flash movie and i want to have an MP3 soundtrack playing in the background. When i test the scene, the animation finishes and the music keeps on playing, then when i want to test the scene again, i have to wait for the original music to finish otherwise i get an overlap of music with multiple amounts of the same track playing at once.

All i want to do is to have the music stop when the animation is finished.

Thanks for your help

My movie so far can be seen here: http://freespace.virgin.net/pete.wills1/Test/_notes/The Iron Stick Tornament Round 1.swf

Stopping _x-=#
Hey-

I am wondering how to make the script:

onClipEvent(enterFrame){
this._x=this._x-=#;
}

I can get itto move, but not stop! Any help is appreciated.

Why Is It Stopping?
Here is the code:...

onClipEvent(enterFrame)
{
_root.loadMovie(_root.path[_root.i]);
trace(_root.i);
}

this is hooked into one of the MC's and it works, The mc loads the picture and I can see it and everything, problem is, it seems the loadMovie method stops the running of the mc. cause when the trace window shows up I see the number for the frame where it loaded the image from loadMovie, but then there is no repeating in the trace window. Now if I comment out the loadMovie method. the trace window pops up and I see i flip through like normal.

Why is this?

Cedric

Stopping ?
Is there a way to stop a flash but still have the last frame/image/button remaining visible?

Stopping A Swf
I am really new at this flashMX...been playing with it for a couple days...my question is:

I have 2 buttons START and STOP on a bitmap picture...when I press the START button the movie "norma_girl_Scene 1.swf" plays...how do I make it stop and exit with the second STOP button...the script for the START button is..........

on (release) {
loadMovieNum("norma_girl_Scene 1.swf", 1);
play}

Stopping
ok I got a bunch of crap goin on in my movie it play till about frame 355 then it supposed to go to the main page. It keeps loopimng and goin back to the beginning and only flashes the main page quickly.
I;ve tried just the StopO; command but it still loops back to the beginning. How do i make it sit and the main page?

Stopping
I have an amination already created and i want it to stop repeating itsself. How o i go about doing this?>

Also i would like to post this animation on my website. How can i display this on my site.

Stopping All MCs At Once
Anyone have any ideas on stopping all MCs (_root, nested, etc) with one button click fromthe _root timeline?

Any help is appreciated!!

Stopping _x And _y
Code:
onClipEvent (load) {
_x = Math.round(_x/5)*5;
_y = Math.round(_y/5)*5;
dx = _x;
dy = _y;
}
onClipEvent (enterFrame) {
if (Key.isDown(1)) {
// Mouse click
dx = Math.round(_root._xmouse/5)*5;
// Round off
dy = Math.round(_root._ymouse/5)*5;
// to nearest 5
}
if (_x != dx) {
_x += dx>_x ? 5 : -5;
// Add 5 or -5 depending on dx>_x
}
if (_y != dy) {
_y += dy>_y ? 5 : -5;
// same as before
}
if (_root.follow, hitTest(_root.line)) {
this.stop();
}
}
see where it says this.stop(); ? well the _x and _y do not stop they keep on going.. i've tried _root stop(); everything..

i want to stop the script from continuing..if it doesn't then the mc will just keep going and going..

please help!

Stopping
Hi All,

I'm just learning AS so if this is a really dumb question ... sorry.

I have a remote control with 6 buttons ... screen changes for each button press and displays new info on a TV screen.

Button 6 - which will play frame 7 (code below) will play an embedded wav file also.

MY PROBLEM IS THIS ... I cant work out the code, how to stop the audio when another button is pressed eg button 4 or 5.

Please help ... deadline is in 6 hours and I'm really stuck__________________________________________________ _____

on (press) {
tellTarget ("led") {
gotoAndPlay(2);
}
tellTarget ("_root.tv.channels") {
gotoAndStop(7);
}
if (_root.tv.boxen.boxen_anaus == 0) {
tellTarget ("_root.tv.boxen") {
prevFrame();
}
}
}
on (release, releaseOutside) {
tellTarget ("led") {
gotoAndPlay(1);
}
}
__________________________________________________ ___

Stopping It
Alright guys I need a little help here. Me and a buddy are making a flash intro in Flash 8 Professional. So we have a star coming across the background from the left hand side and using the "explode" effect we have it break apart or explode into peices as music is playing in the background. We have our video done right?...or so we thought. We only want to video to play once..but it continues to loop over and over again. So how do we stop it from looping?

Is there a setting to do it?

Any help is much appreciated. Thanks!

Stopping An MP3
Hi so iv created 2 scenes which are connected by a button which iv managed to code ok but now my problem is when I use the button the next scene appears but the mp3 from the previous scene keeps playing. Is there a code I can put into the actions of the button to stop the mp3?

Stopping An MC?
A vairable is set that is the frame that I need an MC to stop on.

How can I make it so that the MC keeps playing through and when the variable gets set, it plays through the animation and just stops on that frame. So if the stop frame is 5 and when the var is generated the mC is on frame 6, the MC wont just jump to frame 5, it will play through 6-30 then 1-4 and stop on 5...

Thanks

[F8] Stopping Xml
Hello everyone was wondering if anyone could help me. I have built a map that pull all the data off an xml sheet. Anyway i need to breakdown the map by catogories so have started building other xml sheets. (client choice) How do i get flash to stop loading one and start loading another xml sheet. Is this even possiable. Thanks in advance

Stopping Flv
How do you stop an flv on a cue point? How do you load a movie clip on a different cuepoint?

I just want a progressive flv to stop/pause at the end of the clip instead of going back to the beginning. I also want to load a sound clip in the middle of the video on a cue.

Stopping Mc - Still Not There
on actions layer, frame 1 inside my movie clip I have:

counter

on the last frame of an animation layer inside the same mc I have:

if (counter < 4){
counter += 1;
gotoAndPlay("frmStart");
}

(and) it is still not stopping as desired....

please- any advice would be helpful

Stopping MC's
Hi all, thought I would post this in the Newbie section, because it seems like a newbie type question...

MC's automatically loop by default. So if you have a twenty frame MC, you better place a stop(); action on frame 20, or else you are in for a loop....

My question is, what if you have a 1-framed MC...does that continous loop also if you DON'T place a stop(); action on the first frame? Or is Flash smart enough to recognize and automatically stop this MC?

Lets just say you place a graphic in that first frame of the MC, and the only reason you did this was so that you can target the graphic later. IS there a need to place a stop(); action in the frame?

I always place stop(); actions in my MC's out of habit (don't want any surprises down the road)...just wondering if this was necessary for 1-framed MC's.

Thanks.

Stopping Everything Where It Is
Last edited by cybling : 2002-06-26 at 04:18.
























Hey,

I dont want everything to stop now, i figured what i want out..

I'm creating a game in whihc you have to shoot ducks/elephants etc, a funfair game.

The probem is this:

I have a duck whihc is a button. On the up state i have an MC where is rolls across the screen. I have another MC where the duck falls where it stands. I've put this MC onto the hit state. I dont know how to tell flash that when ou click the duck, play the falling duck movie exactly where you clicked the target. At the moment i can't even get the falling clip to work never mind making it play when you shoot. I have this so far...

http://www.cyblingdesign.com/external/duckshoot.swf

Just ignore what comes after the first part..

Please help me! My deadline is in 2 days. Thanks,

Aidan

Stopping ONE Sound
I originally set up my music to "stream" so that when the next sound started streaming it would obviously stop the first one. However, I hate streaming music because of the choppiness. If I therefore want to run the music on "event" or "start," is there a script to tell a _specific_ sound to stop playing at a particular keyframe? Do I nest it in a movie clip and then control the sound by pointing to the instance of the movie clip? Or is there an easier way? And what is the script?

Thanks so much for your help!
-Dave

Stopping The Motion
I'm sorry if this sounds dumb. Ok I have a movie clip, and the instance name is "ball". Now in frame one of the movie clip there is an image of a round circle. And I want this circle to move from left to right so I put in the action script:

_root.ball._x += 10;

and in frame two of the movieclip I put in:

goto and play frame 1:

so that the stage will update the position. Now what I want to know is how do I stop my movie clip image in a certain area of the stage?

Thanks

From Playing And Stopping...
I hope someone of you can me tell something.

I stopped a movie called Movie1 in this case. Now I want to play again the Movie1...

here is the little script:

number = 1

// 'number' is dynamic (and has to be dynamic !)

eval("Movie" + number + ".GotoAndPlay(1)")

...any suggestions what I am doing wrong ? There is no error in Flash when I play it...

Please, My Work Is Stopping. HElp ME.
I created a door animation opening and closing while navigation between the pages.
but when I navigate from a page to another, the door closes then the browser pops up to load the opening door. ( I hate this pop up. ) are there any ideas to avoid this pop up between pages? this pop up because it loads another html page.


Please HELp mE.

the link is:
http://www.steelnetwork.com/trial/flash/software.html

Stopping A Counter
Hi,

I'm trying to rework some code I got from someone. It makes a movieclip scroll continuously through actionscript. Here's the code:
...................
onClipEvent (load) {
// set vars
old_x = this._x;
trace("old_x = "+ old_x);
speed = 4;
counter = 0;
// how often can i move the MC ?
max_counter = (this._width/speed)/2;
trace ("max_counter " + max_counter);
}
onClipEvent (enterFrame) {
// move the MC
this._x -= speed;
// counting the "times moved"
counter++;
// is the whole MC was moved begin from the start
if (counter>=max_counter) {
this._x = old_x;
counter = 0;
}
}
.......................

Now I want to add a stop function to the scrolling.
So on the stopbutton I placed the following code:

...................
on (release) {
_root.webskills.text.speed=0;
// where are we when we stop the movie?
stop_at = _root.webskills.text.counter;
gotoAndStop(2);
}
..................

To start playing again I use the this code on the play button in frame 2:
.................
on (release) {
_root.webskills.text.speed=4;
// where are we when we restart the movie, substract stop_at from this
// number
_root.webskills.text.counter = _root.webskills.text.counter - stop_at;
gotoAndStop (1);
}
................

I thought I could use the counter variable but I can't figure out how. The problem is that the counter keeps adding because it's in an onClipEvent (enterFrame) function. Thus making the movie jump to the beginning when the original counter is bigger than max_counter. The example is here: http://home.wanadoo.nl/d.roberts/stuff/webdesign.html
Press the first stop button (next to web vaardigheden) to see the effect.

Is there a way to tune this or am I looking in the wrong direction entirely?
Thanks very much for any help.


Kind regards,

Danielle Roberts.

Stopping A Scroller
I've been working on stopping a scroller. I downloaded a simple photo scroller from Flash Kit: Photoscr-Barry_Dr-6066
It is they type that scrolls opposite the direction of the mouse (move mouse left, scroller scrolls right).

I've been trying to program it so I can click on a picture and it will stop the scroller from scrolling.

As I get more advanced with it I want the photo I click on the ease to the center on mouse release. Then it will launch a movie, a larger version of the photo, zooming to full size. Then I'll click and button that will send it back to the center and then the scroller begins scrolling again.

Any ideas? Any help will be appreciated.

Thanks.

Stopping The Scene When....
...I do a hitTest. I cant figure out how to stop the scene that i am on when i do a hitTest on an object..


Code:
onClipEvent (enterFrame) {
if (_root.guy.hitTest(_root.object)) {
tellTarget ("/guy") {
gotoAndStop (10);
}
}
}

This is the code i have now. and once i can stop the scene, i would like to stop the scene about 5 frames after the object hits it by using "_currentframe + 5" how can i do this?????

Stopping Sounds
I have a number of sections in my movie, each with sounds attached. I want the viewer to be able to skip ahead to different sections without the sound from the previous section continuing over the new section's sound.

Right now, I have this on the first keyframe of each section:

mySound.stop();

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