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




Controling The Amount Of Times A MC Can Play¿?¿?¿?¿?¿?¿?¿?



Hello Here is what I have a button and one movie clip. I want the button to start the movie clip only twice. so if you click the button the MC plays if you click agian the MC plays again but if you click a third forth fifth etc.... the MC will not play again. I know this is possible. Thanks for you help and time

your friend
montara



FlashKit > Flash Help > Flash ActionScript
Posted on: 08-23-2002, 04:59 AM


View Complete Forum Thread with Replies

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

Making A Movie Play A Certain Amount Of Times
Hi, sorry if this is a lame question. I have found solutions for actionscript 2 but now I am using AS3 I am totally stumped.

After looking around here i feel like a total noob!

Anyway i just want to play a movie, first time it reaches the end it goes to frame 8, then second time stops.

I am know it is a loop and setting a variable but I just can't get the syntax right.

AS3 is so complicated, makes my head hurt.

Thanks in advance for any help you can give me.

Looping A MC For A Certain Amount Of Times
Pretty please....anyone....

What I am trying to do is I want my MC to loop for five times and then jump on to another frame (where the fadeout starts)

I have been trying my luck with a if else statement checking wether the variable loop has reached the value of 5 if yes I want it to jump on. I don't get any errors in the output but the darn thing won't stop looping...

can anyone help me please...?

Repeating Frames Once Run Certain Amount Of Times
I know this should be devastingly easy to do, but help!

I have a movieclip - I'm using AS2 - I want the movieclip to repeat its own frames 1-16, twenty times in a row. Once this has happened I want the movieclip to go to frame 17 and play itself to the end.

My movieclip instance is called "test".

My code on frame 16 in the movieclip is


Code:
"trace ("test" + i)
if (i >= 20)
{
gotoAndPlay (17);
}
else
{
gotoAndPlay (1);

}


which is probaby pointless as I can't access the "i" variable from there??


The code on my movieclip is:


Code:
onClipEvent(enterFrame) {
for (var i:Number = 0; i < 20; i++) {
trace (i)
if (i < 20)
test.gotoAndPlay(1);
}

if (i >= 20)
{
test.gotoAndPlay(17)
}
}

I apologise in advance for being a thick. All help most welcome.

Cheers.

Looping A Specific Amount Of Times?
is there a way to specify in html how many times the flash file can loop without writing AS for it?

Ie <param name=loop value=true> <--- can that be changed to a number?

thanks in advance,
mcm

Loop A Certain Amount Of Times Then Continue Playing
Hey guys, i was wondering is there a way to make a frame loop a certain amount of times, then play on?

eg. i want the movie to start from frame 1, to frame 10, then loop back to frame 1, do that 3 times, then the fourth time it gets to frame 10, it keeps on playing.

any1 can help me with that?

thanx a lot

cheers

Launch Projector Limited Amount Of Times
Is there a script that counts how many time a projector has been open?
I'm looking to make a demo projector that can only open a project 1, 2 or 3 times.

Controlling The Amount Of Times A Movie Loops
Hi All,

Hey I simply want to control how many times a movie loops when it first loads on a web page. I have done this before long ago, but can't remember the exact syntax. Can someone please tell me what I am doing wrong? Thanks!

ActionScript Code:
for (i=0; i<2; i++) {
}
gotoAndPlay (1);
stop ();

Launch Projector Limited Amount Of Times
Launch projector limited amount of times
------------------------------------------------------------------------
Is there a script that counts how many time a projector has been open?
I'm looking to make a demo projector that can only open a project 1, 2 or 3 times.

How To Make An Action Repeat X Amount Of Times?
How can I make an action sequence repeat 'x' amount of times?

For example, moving an object around and fading

Looping Frames X-y For 'z' Amount Of Times Then Proceeding To Frames After Loop
Hi,

I'm relatively new to Flash and have not done much work with the AS. I was hoping someone here could enlighten me on an area which has been stumping me.

I need to know how to loop (for example) frames 1 to 5, 4 times then continue to frame 6 until the last frame, then go back to frame 1, thus re-entering the loop, etc. I do believe it would involve something like this... but then again I'm a newbie to this so... what do I know (which is why I wanna learn)

Frame 1:
i=0

Frame 5:
i=i+1
if (i>4) {
gotoAndPlay(6);
} else if (i<4) {
gotoAndPlay(1);
}


Thanks so much

GotoAndPlay("framelabel") Certain Amount Of Times
I am working on an animated character. It is fairly simple, when it gets to the last frame of the animation I would like it to go back to the ninth frame of the animation, which I have labeled as "nine" and play through that maybe 3 or 4 times.
What code would I add in to do this?

right now-
<hr>
gotoAndPlay("nine")
<hr>

thanks for any help

How To Play A Sound For 6 Times With Set Play Interval?
Hi,

I know how to play a sound effect:


Quote:




var mySoundReq:URLRequest = new URLRequest("laser.mp3");
var mySound:Sound = new Sound();

mySound.load(mySoundReq);

mySound.addEventListener(Event.COMPLETE, playSong);

function playSong(event:Event):void {
mySound.play();
}




The above sound effect play only one time. Actually I wish to play the sound effect for 6 times and at a set play interval (e.g. play the sound effect, wait 2 seconds, play again, wait another 2 seconds......). How can I do that?

I am thinking to use a Timer object. However I have no idea how to link with the playSong function.

Thanks and best regards

Alex

Play Set Amount Of Frames Only?
I was just wondering.... is it possible to tell flash to play a certain range of frames?
What I mean is, could I make a button with a script that makes the playhead play frames 125 to 225 then play frame 350 and stop.
(without a stop command at frame 225... as other buttons may instruct to play beyond that)

This would make my life easier...

Thanks

@lex

Play Certain Amount Of Frames
U have a animation (40 frames)
U have 3 buttons

If u klick on button1 the animation has to play 10 frames
If u klick on button2 ... 20 frames
if u klick on button3 ... 30 frames

if _currentframe == _totalframes back to frame one.
all starting from the last frame in view

I got this thing working but still i have one problem.
Each time the MC loops, the 10th frame of the first loop has become the 9th frame of the second loop and so on.

So the problem situates itself between the first and the tenth frame.
Becuz when u ask at frame 1 to goto frame 10 it has to view 9 frames and if u ask at frame 10 to goto frame 20 it has to view 10 frames.

any help with this ? or if ya know any other (better) way to do this plz let me know

tnx


here's the code
button: i=1 gotoandplay frame1

frame 1:
if (_root.HoofdMenu._currentframe != _root.HoofdMenu._totalframes) {
if (i%10 == 0) {
_root.HoofdMenu.gotoAndStop(i);
_root.buttonz.gotoAndStop(1);
} else {
_root.HoofdMenu.gotoAndStop(i);
i++;
}
} else {
i = 1;
_root.buttonz.gotoAndStop(1);
_root.HoofdMenu.gotoAndStop(i);
}

frame2: goto and play frame1

Stop For A Certain Amount Of Time Then Play
this is what i am trying to do.
i am trying to have a flash file that will load audio.
play the audio in the file
wait till its done.
reload the page its embeded in.


as a temp solution i have this as my action script.
s = new Sound();
s.setVolume(50);
stop();

and in the properties i have this.
Sound: (sound file)
Effect: None
Sync: Start Loop

but this as you can see doesn't reload the page.

also the way i have it set does flash wait till the file is completely loaded till it starts playing or does it automaticly goto the stop and just wait??
because i would prefer the flash file to wait till the sound is loaded so the page wont reload pre maturely

Play X Amount Of Frames, Then Goto Frame X
I am stuck on my website...I have each section completed on the main timeline. I have curtains that open and close as you enter and leave each page. I need to write actionscript for the buttons that allow me to play 10 frames on the timeline(this would allow the curtains to close), and then jump to a different part of the timeline based on what button was pressed...I only know how to use behaviors and basic actions, but I dont know how to write something for this..can anyone help?

How Do I Play A Clip After Mouse Stops Moving For A Ceratin Amount Of Seconds?
How do I play a clip after mouse stops moving for a ceratin amount of seconds?

[MX] On Release, Play Specific Amount Of Frames Then Return To Stopped Frame
So what I'm trying to do is create a button when clicked it will gotoAndPlay at a specific frame number, play for a # of frames, then return to the button once those frames have been played.

I've labeled the frames, so I'm sure I should use the label somehow, I understand how to get to the frame I want to start playing, just not sure if there's an actionscript to get back to the button once the labeled frames have played.

Play It 2 Times Sam
Hey

Someone please tell me how to loop a movie 2 or 3 times and then stop!!!!???

Tony
From Denmark

FLV's To Play At Times Of Day
Hello everyone,

I would like to set up a website that plays up to twenty videos (FLV) at specific times of day for each video. How would I go about this? Will I need to use some additional technology such as PHP or C++ or something?

If anyone could help I would appreciate it.

Thanks
Martin





























Edited: 11/17/2006 at 07:44:36 AM by mcgoo1426

Want A Movie To Play A Certain # Of Times
I am developing a logo in which small squares "pixels", flicker seemingly randomly. I want them to do this for a few seconds and then stop. According to Flash help, I can do this with a do/while expression:
code:
i = 0
do {
gotoAndPlay("flicker");
i = i + 1
} while (i<=50);



Unfortunately, it doesn't work. Instead of allowing the flicker to occur only a certain # of times, it just seems to slow the flicker down as though it counts to 50 and then flickers once and so on. I changed to a smaller number and sure enough, it speeds up the flicker but doesn't limit the # of times it flickers.

It was suggested on another forum that I could try this:

code:
i=0

this.onEnterFrame = function(){
if(i<50){
gotoAndPlay("flicker");
i++
}else{
delete this.onEnterFrame
}
}


The results were the same. Does anyone have a solution or work around? I am trying to stop the flicker and turn it into a static logo. If I can stop it, I ultimately want to have the whole logo do something else as a sort of finale before settling down. Otherwise, I would be content to merely cover everything up with a similar but static logo.

Any help would be greatly appreciated.

Thank, Steve

MC Play At Random Times
Ive been trying to figure this one out for two days now....

I have a movie clip on my stage called (treeTopHolder). I would like for that movie clip to play at random times. Maybe play once or twice every 30 seconds?

How can I do that? Where would I place the code? In the time-line of the movie clip, or the time-line of the main stage?

Thanks for any help you can give me. I'm using Flash MX 2004

AS 2 Loop 3 Times And Then Play
hy i have movieclip that starts palyng on 5 frame and ends to 12 frame,i want to loop it from 5 to 12 3 times and than to play frame 13 how i can do this?is it possible? thanks

Want To Play A Movie A Certain # Of Times
I am developing a logo in which small squares "pixels", flicker seemingly randomly.  I want them to do this for a few seconds and then stop.  According to Flash help, I can do this with a do/while expression:

i = 0
do {
    gotoAndPlay("flicker");
    i = i + 1
} while (i<=50);

Unfortunately, it doesn't work.  It just flickers away without counting.

What am I doing wrong?

Thank, Steve

Play Movie Clip For Only 2 Times.
normally a Movie clip plays for a unlimited time if stop action is not given at the end. and it would stop, if stop action is given at the last frame. but i want a scripting in such a way that, movie clip should play for 3 times, and should proceed to _root after playing 3rd time.

how to achieve this ?

Play Movie Clip For Only 2 Times.
normally a Movie clip plays for a unlimited time if stop action is not given at the end. and it would stop, if stop action is given at the last frame. but i want a scripting in such a way that, movie clip should play for 3 times, and should proceed to _root after playing 3rd time.

how to achieve this ?

Play Movieclip 4 Times Then Stop?
Hello,
I have a time delay on a movieclip so that it only plays every 20 seconds. When I try to set the loop number of the instance of my movieclip to 4, (in the properties box), the clip keeps on playing. Should I be using action script to get it to play 4 times only?

If so what is it and do I put the script on the movieclip itself or the instance of the movieclip?
Thanks.

Play Movie Three Times & Stop- Help
Please help, this is due today!!!!

I have two Scenes : Scene 1 and Scene 2.

On the action layer's last frame of Scene 2 I have:

(++x<3) ? gotoAndPlay("Scene 1", 1) : stop();

I want this movie to play three times and stop.
IT DOES NOT WORK and has worked in previous versions of Flash (I'm now on MX 2004).

PLEASE HELP!!!! [b]

SWF Doesnt Play Properly At Times
Im having a problem with playing SWF files in Windows XP. Well, I am working on this new flash animation in my computer which is Windows XP. Sometimes when i preview the flash movie, an error message appears saying that flash encountered an error and had to be closed, but this happens rarely. When i play the swf file of the animation that i am currently working on, there are sometimes problems. For instance, When i play the animation in swf, like this swf for my new animation, sometimes symbols may dissapear for a split second, sometimes the sound may all of a sudden stop playing, sometimes while the animation in the swf file is playing, the animation may all of a sudden restart to the beggining even if it hasnt gone to the end of the animation yet, and also there have been times that while the animation is playing,it all of a sudden stops playing and an error message would appear saying that "Flash encountered an error and had to be closed", and i would just click on send error report for the heck of it, the SWF window would just close, and the animation interrupted.
What im trying to say is that the swf file sometimes doesnt play properly in Windows XP. i ve encountered this problem more with my new animation.the animation process gets interrupted at times. When i tested that swf file for my new animation in another computer which was windows 98, i didnt see any problems and i did play the animation alot of times to find out if the same problem occured like in my computer. I think that swf files dont play properly on my computer for some reason, it does play properly most of the time, but not all of the time. I think this has something to do with a program opened in the background but i am not sure,Does anybody know why this is happening?

Help - Play 3 Times Then Delete On Enterframe?
I need to make this mc play 3 times then delete itself .
'bird.swf' has 1 top level keyframe with this actionscript:

speed = 10;
bird.onEnterFrame = function() {
this._x -= speed;
if (this._x<=-10) {
this._x = 800;
this._y = 30;
}
};

I have tried adding some keyframes and putting this in the first:
var i
if(i>=3){
stop();
}
and i++ in the last, but that doesn't work.

Any ideas????

[F8] On Release Play Random But Only 9 Times
I have a button "ball" and I need to have it so that on release it plays a random movie clip (one of 6 different movie clips called "chance1", "chance2", and so on) but I need to have it so that the user can only click the button to do it 9 times, so there will be duplicate plays for some movie clips which is fine. After that they will have to reset the section via button or move on to the next section. Does this make sense?

This is for a game that I'm working on if it helps. There are 6 different holes for the ball to go in and 9 balls to throw. I have 6 movie clips that are animations for each of the holes. When they release the ball, which is the button, it will select one movie clip at random to play and keep score accordingly. After the nineth ball, there won't be a button so the user can reset or go to a new course.

I'm fairly knowlegeable with scripting, but I've never done anything random and from my searching through the forums, I'm a little confused how I would set something like this up. Can anyone point me in the right direction? Thanks for you time and help.

cheers!

Play Movie Set Number Of Times.
I have created a movie that is 80 frames long.
I want to play the movie 10 times and then stop.
The only way I know is to repeat the 80 frames 10 times on the time line.

I'm sure there is a clever way of doing it, please tell me what it is.

Thanks

Loop Play X Number Of Times
I need to have a movie play through 4 times and then stop (on a particular frame would be nice, if possible). Using Flash 2004 MX. I know this must be simple, but as a newbie (former Director user), I can't seem to get it.

Thanks!

How To Play Mc Only A Desired Number Of Times.
hi

I just wanna ask how to loop playing a mc only a set number of times. Lets say i have myVideo_mc and i just wanna make it play three times. How do i make it play only three times using code.

so far i am here:

myVideo_mc.stop();

for(var i:Number = 0; i < 3; i++)
{

}

how do i make it play only three times?

And than i need to create counter that displays how many times myVideo_mc has played. How would i do that?

tnx in advance

regards

Luka

Play Movie 3 Times, Then Stop.
This is for a banner ad. I want the animation to play 3 times, then stop. I've used a AS2 snippet that I found online for awhile now, but I want the same thing in AS3.

Anyone know how, or have a snippet to share?

- JonCloud

Play Animation Multiple Times
Hello to everyone,

I have a flash banner animation and I need to know if there is any sort of script that plays the animation multiple times all over from the beginning and then stop at the end (let's say after playing three times it then stops.

I have already found a solution about my above request, but just need if anyone has the script for it.

I am good at flash and can help someone in return if needed anything, but this type of requirement that I am asking above is something I have never done.

Thanks for all your kindness and help.

Respectfully yours,
Beko

Play Timeline 3 Times For Banner Ad.
I am trying to play a banner ad 3 times and then stop for a banner ad. Does anyone know how to do this using actionscript. I have tried and failed.

How To Play A Movie Clip X Number Of Times
Hi all,
I have a mc animation called "anim", and want to play it on the main timeline 3 times and then stop.

I know I would attach an action to the instance of the mc called "animloop", but can't seem to figure out the code to make it stop after it plays x number of times.

Does anyone have code I can cut and paste to make it loop only 3 times? I've spent 2 hours in the Flash help, and am more confused than ever!!

Thanks in advance!

Play Movieclip At Random Times On Load.
Is there an actionscript to play a movieclip at random times? This is when it reached the end frame of the timeline. Thanks in advance.

Dre.

Play Movieclip At Random Times On Load.
Is there an actionscript to play a movieclip at random times? This is when it reached the end frame of the timeline. Thanks in advance.

Dre.

How To Make A Movie Play 3 Times B4 It Stops?
Hi,
I recently created a short flash intro. I wanted the intro or movie to play 3 times before it stops and then being directed to another url.

What I did was I created 3 identical scenes. In the last scene (scene 3)at the last frame I inserted the action go to ( url ). It worked fine.

However I doubt this is the right way of doing it...there must be some codes for it to play three times. To create 3 duplicated scene is unnecessary and I am afraid may add to the size of the file.

Bottom line is can anyone tell me the way to make a movie play 3 times b4 it stops and then being directed to another url.

I am new at this and not sure whats the right term for certain actions. Please bear with me and feel free to ask for further clarification.

Thx a million!

Limiting The Number Of Times A Movie Clip Will Play
limiting the number of times a movie clip will play
say 3 times and stop

Controlling Movieclip To Play 3 Times And Stop At Last Frame
i have a movieclip (MAINMOV) that is placed on stage. MAINMOV has another movieclip within it (MAINMOV 2). i need to publish the file and have the entire sequence run 3 times and stop at the last frame of MAINMOV 2 - is this possible??

*BigJuicy*

Making A Movie Clip Copy Play At Certain Times.
What happens is the movie clip does not leave the designated spot and travel to the other side, I was wondering if there would be a way to time each copy, so that like every 2 secs it will reproduce a copy, not just all at once. I hope I explained this well enough to undrstand.
--------------CODE--------------------
onClipEvent (load) {
maxLaser = 6;
depthCount = 1;
_root.laserTwo._visible = 1;
laserCount = 1;
}
onClipEvent (enterFrame) {
if (laserCount<=maxLaser){
laserCounter++;
_root.laserTwo.duplicateMovieClip("laserTwo"+depth Count, depthCount);
_root["laserTwo"+depthCount]._visible = true;
depthCount++;
}
if (depthCount>maxLaser) {
depthCount = 1;
}
}

--------------CODE--------------------

Attatching A Movie Clip To Play 3 Times Through Then Destroy()?
How would i attatch a movie clip, call it to play three times through then remove it from the stage when a button is pressed? Would i have to use an interval or are there other methods?

On Amount Loaded = Total Amount , I Want To Display Something Else.
I have a preloader for the movie, and while the preloader is loading, there is an animation going on. It says "Loading_", with the underscore flashing. I want to make the "Loading_" MC say something else when the amount loaded equals the total amount, in other words: when it reaches 100% loaded, i want "Loaded_" to change to "Finished". Can someone help me out?..I'm doing a website for a band and they want it done relatively soon.

Thanks,
David "O"

Random Movie Clips To Play For Random Amount Of Time
hi,
i am loading external movieclips randomly into 4 seperate emptymovies, i now need a way to get these random clips that i am loading to play for a random amount of time and then load the next clip.
i need some help with the code...

how do i get the clips to loop, then assign each a random number and have flash check if the random num is = to current frame...if it is, have that clip stop and a new one load?

i have no idea how to write the code for this
any help would be great

thanks

this is what i was given so far..but don't know what to do with it.

Code:
var rnd = Math.round(Math.random(mc._totalframes));
mc.onEnterFrame = function() {
this._currentframe >= this._parent.rnd ? unloadMovie(this) : null;
}

How To Loop A Flash Piece 3 Times And Stop After 3 Times?
HI,

I am in need of some help.

I have a flash piece that I want to loop 3 times and then stop.

HOw do i do that?

How To Loop A Flash Piece 3 Times And Stop After 3 Times?
HI,

I am in need of some help.

I have a flash piece that I want to loop 3 times and then stop.

HOw do i do that?

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