ActionScript 2.0 :: Deleting Movie Clips After X Amount Of Time?
May 5, 2009
Right then I'm sure you guys can sort this out very simply. Basically I have this code that creates duplicate instances of a movie clip and puts them on stage with a few random settings where ever the mouse goes.This is cool but I want the duplicates to disappear after a certain amount of time (2-3 seconds or so) - or disappear when a certain amount of them have been placed on the stage.I have played around with the getTimer() function with no joy but I am not even sure if this is the right thing to use.
var num:Number = 0;
_root.onMouseMove=function() {
var temp = _root.attachMovie("flower","flower"+num++,_root.ge tNextHighestDepth());
[code].....
View 4 Replies
Similar Posts:
Dec 28, 2010
I have a movie clip loaded using action script 3 at the start of my animation, I want ito to end at the 120th frame. But I can't use the stop(); command because it will also stop the rest of my animations from the 121st frame onwards. how can I stop the movie clip without stopping the rest of my animations?
View 5 Replies
Mar 28, 2006
I have button that adds text to a movie, and u can resise it and change the color and stuff like that, the txt comes in as a movie clip,but i want it so the user can also delete the text. what script do i apply to a button to delete the movie clip?
View 2 Replies
Nov 22, 2003
Im working on a rock climbing game, and used duplicateMovieClip() to make all the snow. When the character gets to the top of the mountain, the movie goes to the next scene, but the duplicated snow is still there. Look through the .fla at [URL]
View 5 Replies
Nov 23, 2009
I have flash-10 , when i increase the amount of movie-clips on stage , it crashes
View 2 Replies
Mar 5, 2005
I'm making a game where missiles are created using the duplicateMovieClip thing and I've used it a lot before, but i never noticed that there is a limit to the number of layers, around 256, I think. The problem is that i have a bunch of sprites in my games and each of them move(i.e. fire,smoke,shrapnel from rockets,etc) so is there a way to group a large amount of movie clips so that they're on one layer, without putting them into another movieclip? If u want look at a part of my game, well two parts.
View 3 Replies
Aug 26, 2010
I need to load and unload thumb buttons with images loaded in them. I load an xml, create the clips, then load the images into the clips.
When I remove the clips, I need to unload the loaders first?
Can I store references of the loaders in an array and use the array to unload them?
How should I delete the clips? removeChildAt()? Or use an array?
Here's relevant code:
Code:
function createScrubThumbs():void {
for(var i:Number=0;i<thumbsXml.thumb.length();i++){
var picHolder:ScrubThumb = new ScrubThumb;
[Code].....
View 5 Replies
Nov 27, 2009
i have 12 items that I want to appear on stage one at a time in sequence, and I'm using setinterval, but I'm finding it hard to stop it once i've reached the twelve items.
View 3 Replies
Aug 18, 2005
is it possible to swap depths for multiple movie clips at the same time? how about swapping for negative depths? or will that kind of thing lead me into probs later?
View 8 Replies
Jul 22, 2009
I have a small, hidden button that runs the following code.
Code:
on (rollOver) {
for (k=0; k<50; k++) {
duplicateMovieClip(this.snow, "snow"+k, k);
}
inside my movie clip, I have this
[Code]...
View 6 Replies
Jul 16, 2010
I've been trying and trying to delete some basic cards from the stage whenever I reset a game, but thus far absolutely zero luck.
[Code]...
View 7 Replies
May 3, 2011
It feels like it's been ages since I've worked in Action Script (dissapointingly the demand just isn't there for me) and I'm really, really rusty.
I'm working on a Flash banner, and one particular part has 5 movie clips. I want each movie clip to fire off at separate intervals(i set it at 300 miliseconds per clip)
Here is the code I have written that works for two clips:
Code:
//Animate each icon
var timer:Timer = new Timer(300, 1);//create the timer
timer.addEventListener(TimerEvent.TIMER, doNextTween);
timer.start();
[Code]....
View 3 Replies
Jun 24, 2004
I'm making a movie w/ no interactivity and I want to put a series of movie clips on the main time line, each to play after the previous movie clip is done. The only way I can make it work is to put the movie clips in keyframes and then allow all all the frames for the movie to play. My movie is way too long and I know there has to be a better way! I'm trying to figure out the action to assign to the keyframe that will play the movie clip within that one frame and when it's done, go on to the next movie clip.
View 1 Replies
Jan 23, 2010
I have an mp3 playing. What I would like is to have a movieclip that is located in the library appear, complete it's animation then get removed. The movie clip must complete this proccess 4 times, randomly during the length of the song but never at the same time and not in the last 5 seconds of the song. BTW I can't do this manually by just firing it off a random amount of times because this code will be used with lots of different mp3's, so I need to use the dynamic data I get by retrieving the song length.
I have the code working to retrieve the length of the song, and I have a variable that stores the length minus 5 seconds from the end, so I bascially have the length of time I wish to work with. My problem is making the movie clips appear 4 times randomly throughout that length of time. The code is below (what I have so far), the movieclip is stored in the library as circle_mc.
The timer I'm using at the beginning of the code (to retrieve the length of the song) is set to run after 2 seconds this is because there is a delay in the music starting and if it did it instantly the number retrieved obviously would be 0, so I delay it by 2 secs till I know the song is playing. At the moment I'm just trying to get it to fire twice, at the moment it fires once or not at all
[Code]....
View 1 Replies
Apr 7, 2009
I have a piece of code, and in that function i call to another function that has 3 parameters.now i've decided that i want that last function to be called after a couple of secs, instead of immedietly. I can't simply use a timer, and addEventlistener, because then i cant give parameters.
View 14 Replies
Nov 12, 2009
I am using CS3. Here is what I am trying to accomplish:
On my loading page I have the following standard loading code:
Code:
stop();
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);
[Code].....
Because on some connections this can take quite some time, I want a link to appear after a specififc amount of time, say 10 seconds? Kind of like a, "loading too slow? Click here for whatever."
how to accomplish this within this loading code and frame?
View 4 Replies
Jun 26, 2009
I've got a movieclip animation which is added to the stage at the start of the .swf.Its an introduction to the game, and the user is encouraged to click on the movieclip to start the animation.Once the animation is finished I'd like the movieclip to be removed from the stage.Do I need to setup some sort of event handler which listens out if the movieclip has finished then start a function once its finished to remove it from the stage? Which methods look out for movieclips finishing?
View 1 Replies
Nov 25, 2009
I need to have a button appear after 30 seconds. How would I go about doing this?
View 2 Replies
May 11, 2011
When I click a button, it opens a window with buttons in it..My aim is, after an amount of time, I want it to dissappear...I want to accomplish it by setting a counter ...for example... When I click to a button 1
{
when click "button1"
jump to "scene1"; set counter=0;
[code].....
View 4 Replies
Nov 12, 2009
On my loading page I have the following standard loading code:
Code: Select allstop();
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);
[code]....
Because on some connections this can take quite some time, I want a link to appear after a specififc amount of time, say 10 seconds?Kind of like a, "loading too slow? Click here for whatever." how to accomplish this within this loading code?
View 1 Replies
Jun 20, 2005
If you press a button within a certain amount of time, you are taken to lets say frame 2, if the time expires, you are taken to frame 3.I have used up all of my "i'm still a newbie at flash", so I'm just gonna tell you the truth and say that I haven't done any AS (or flash for that matter) in quite some time, so I guess I have to get busy and learning actionscript.
View 2 Replies
Oct 16, 2007
Is it possible to use actionscript to swap the frame to a different one after a certain amount of time i.e 30 seconds.
View 2 Replies
Mar 27, 2009
I was wondering, how do I display text for like 2 seconds or something, then make it disappear?Another question is, how do I set a timer that prevents a function from running within a time limit (2 seconds again) after it ran? Like if a function is triggered by a Key_DOWN, what would a code be to prevent it from running again until that 2 seconds is up? This question is for a 'reload' in a shooter. Is there any other way to approach this?
View 14 Replies
May 18, 2011
I got the circle to scale up but need assistance to have the circle scale down after x amount of time.
[Code]...
View 4 Replies
Jul 27, 2006
I have a flash movie on my index page but as the user navigates through the site and then goes back to the home page, I don't want the intro to replay. I have fixed that using shared object so that if it has already played, it skips to the end of the animation...here is my code:
function VisitCheck() {
var myLocalSO = sharedobject.getLocal("visitRecord");
if (myLocalSO.data.visited == null) {
myLocalSO.data.visited = 1;
gotoAndPlay(3);
trace("visit 1");
} else {
gotoAndPlay(2);
trace("visit2");
}}
VisitCheck();
Works great, except now, the intro animation on the index page NEVER plays again; I would rather have the cookie expire after the user closes the window or a certain amount of time has passed (say 30 minutes).
View 3 Replies
Mar 21, 2009
Time variable is "clock" and I want it to switch frames once clock is equal to three.
View 3 Replies
Feb 6, 2012
I have code set up that calls a function whenever my player is over its last destination in the a* pathfinding array...
public function rakeSoil(e:Event):void {
var:Cell = Grid.getCellAt(player.x/50, player.y/50);
if (cell.isWalkable == false) {
[Code]....
View 1 Replies
Jun 21, 2009
How do i make it so you have to hold the button down for a amount of time before going to next frame?
View 1 Replies
Jun 26, 2009
I've got a movieclip animation which is added to the stage at the start of the .swf. Its an introduction to the game, and the user is encouraged to click on the movieclip to start the animation.Once the animation is finished I'd like the movieclip to be removed from the stage.How do I go about doing this? Do I need to setup some sort of event handler which listens out if the movieclip has finished then start a function once its finished to remove it from the stage?
View 3 Replies
Sep 29, 2004
is there a line of code to pause or stop the timeline for an amount of time?
View 4 Replies