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




Using SetInterval To Move A Movie Clip Every 10 Seconds



I am trying to figure out how to use set interval to incrementally increase the "endX" variable of a clip.

each time it fires it would increase the amount I am also trying to make it ease into place and combine with rollover buttons that also controls the same motion. Any ideas?



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 12-05-2006, 01:42 PM


View Complete Forum Thread with Replies

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

Show A Movie Clip Every X Seconds...
Hi,

Can anyone tell me how to show a movie clip every x seconds?
I'm trying to make a simple menu that show's a text every x seconds, but i don't want to use the timeline, just actionscript.
Is it possible to show that text when nothing is selected for e determinate time?

Pause A Movie Clip For ## Seconds
Hi,

Is there a way to pause a movie clip for say 20 seconds?  I'm currently making a large section in the time line with blank keyframes.  If I could make an action at the end of the movie to pause for 20 seconds then play again that would be awesome.  Does anyone know how?

Thank you in advance!
Tosh

Making A Movie Clip Wait A Few Seconds
Hey all,

This should be a fairly easy question to answer. Its 3:30Am and Im not thinking straight.


I just want a button when you rollover it it will play a movie clip (simple tween moving from left to right) then when I roll off the button, I want the movie clip to wait, say 3 seconds and then go on and move from right back to its initial spot.

Nothing fancy right now...just some simple coding to do this. I was trying the get timer() but I couldnt get it to work.

help?

dduck1934

Movie Clip After A Predefined Number Of Seconds
I was wondering if it is possible to display a movie clip after a predefined numbe of seconds, when the mouse has not clicked on anything. I want it to act like a pop up help thingy, that pops up when the users mouse has not clicked anything for a number of seconds.

Thank you for your help,
Darren

[MX,04] Help Pausing A Movie Clip For X Amount Of Seconds.
Hello all,
Looking for a quick script to pause a movie clip for about 3 second, afterward it would resume playing.

Thanks for the help!

How Can I Delay A Movie Clip From Playing 5 Seconds
I am new to flash and am having a little bit of trouble. I have 3 movie clips i would like to start 5 seconds after the last movie clip started. I would like movie clip 1 to start instantly the 2nd movie clip to start 5 seconds later and the 3rd movie clip to start 10 second later. Any help is much appreciated.

[MX,04] Pausing A Movie Clip For X Amount Of Seconds.
Hello all,
Looking for a way to pause a movie clip for about 3 second, afterward it would resume playing.

Thanks for the help!

Stopping Movie Clip After A Specified Number Of Seconds
Hi all,

I am not good at actionscript. I use FlashMX and made a basic flash movie with one movie clip. (movie clip contains frame by frame animation using images rendered at AE) How can I make the movie clip stop after a specified number of seconds? Client wants to be able to change the seconds when needed. So a text file along with swf file including number of seconds...?

Thanks a lot in advance..

Stopping Movie Clip After A Specified Number Of Seconds
Hi all,

I am not good at actionscript. I use FlashMX and made a basic flash movie with one movie clip. (movie clip contains frame by frame animation using images rendered at AE) How can I make the movie clip stop after a specified number of seconds? Client wants to be able to change the seconds when needed. So a text file along with swf file including number of seconds...?

Thanks a lot in advance..

How To Start A Movie Clip X Seconds Into Program?
Hi,

Let's say I've created a movie clip named tree_mc. I've placed the movie clip off the stage to the left. A specified number of seconds--let's say 5 seconds--after the Flash movie begins playing, I'd like the tree_mc movie clip to begin moving slowly horizontally to the right, entering and crossing the stage, exiting off the right-hand edge of the stage and then stopping. (The stage is 640 pixels wide, if that helps.)

Could someone show me the ActionScript script for performing these actions? AS2 if possible; otherwise, AS1.

Thanks!
Bill

[MX,04] Help Pausing A Movie Clip For X Amount Of Seconds.
Hello all,
Looking for a quick script to pause a movie clip for about 3 second, afterward it would resume playing.

Thanks for the help!


Help.... Trying To Make A Movie Clip Play Every Blank Seconds.... Help Please
Hey everyone.... this is kinda urgent.. so here goes:

I've been trying to play a movieclip every blank amount of seconds (lets just say its every 30 seconds) and ive tried using an if loop and the getTimer command, blah blah blah but it just isn't working. Some help please?
come on u actionscript wizzes, help

Thanx in advance

Jordan

Display A Movie Clip For A Specific Number Of Seconds?
Is there a way to specify that a flash movie is displayed for a specific number of seconds instead of the number of frames? For example, if I had 1 keyframe main timeline, and I had a movie clip that I wanted to display for only 15 seconds, is there a way I code some actionscript to change the visibility of the clip after that specified amount of time? Thanks for any pointers. (I was hoping there is a built in function that I over looked).

A Button Inside A Movie Clip To Move Another Movie Clip
I'm building a web page and I have a button that I need to make two movie clips play. The button is inside one movie clip and in addition to it playing I want it to make another movie clip play. It doesn't seem to recognize the movie clip target names. Any help as to how this can be done would be much appriciated.

Thanx

I Thought SetInterval Was In Seconds...
Is it based on framerate or something odd instead? To get a two second delay I have to set it to 1000. ><

To Loop A Movie Clip Every 15 Or 30 Seconds Once The Main Time Line Has Stopped
I've got a movie clip but i would like it to play again after about every 15 or 30 seconds when the main timeline is stopped. I thought it was simple enough, and im sure i've done this before, but it's been a while and now using cs3? Some heads up would be great, although im not too clued up with action scripting.

Loop / Pause In Movie Clip - Duration In Seconds Instead Of Number Of Frames
hi,

i want to know if there's a smart way of creating long-ish, easily editable pauses in movies clips using actionscripting (instead of just throw in dozens more frames in the timeline)?

i'm currently using a loop as such:

i++
if (i<500) {
gotoAndPlay("waitingForUser");
trace(i)
} else {
gotoAndPlay("autoScroll ");
}
this has it looping through 500 times so is obviously dependant on framerate. is there a way to do this and have it loop for for x amount of seconds instead?

many thanks,

ponch

Move Along X Every 5 Seconds
Hi all, Im working on a website and id like to have my site always doing something so its not a boring static page. So if you can help me out i would really apreaciate it. Beleive me this will not be going to waste.


heres a screen shot of what i want to happen.
I want the logos movieClip to move to the right every 5 seconds or so to display a different logo.

Thanks alot!!!

Move Along X Every 5 Seconds
I have this movie clip the size of 240x109, and i want to know if anyone has a good idea for my concept i got going. what i want is to have a movie clip, move over a mask every 5 seconds displaying a different logo as well as displaying some text in a dynamic textbox that will be right below this movieclip mask named ms1txt. heres a screen shot to better understand what i want to do. Im using 61 fps. thanks for the help ill be doing some research as well.

Thanks again.

Move Movie Clip On Button Clip
This is a script that causes a movie clip to move down to a new location when a button nested inside the movie clip is released. can anyone tell me how to write the code so that when a different button is pressed the movie clip will move back to its original position. I am trying to learn actionscript 2.0 by taking the posted files apart and so on, I have a ton o books none of which are too helpful so I could really use some help. What the heck is "ty". I decided to join the forum because books were not cutting it! LOL

here is the code thanks.

ActionScript Code:
// this is the main button to start the slide show
collButtHolder.slide1.onRelease = function() {
    //move the to menu down to reveal the slide show components
    slide(collButtHolder,324);
    // call the function to set up slide show or reset it you had other buttons
    // this is where you set your path to the photos and how many photos are in that folder.
    resetSlideShow("images/slide1/", 15);
    collectionMenu.bName.text = "slide1";
};

function slide(mc, ty) {
    mc.onEnterFrame = function() {
        mc._y += (ty-mc._y)/5;
        if (Math.abs(ty-mc._y)<0.4) {
            this._y = ty;
            delete mc.onEnterFrame;
        }
    };
}

Move To Next Frame After A Few Seconds
Hi everybody,
Even though my question is already clear from the title, I would like to jot down my query.

What I want to do in my animation is to move to next frame after a few seconds (let's say 5 secs).

How can this be done? I know that setTimer is used but I don't know how to start.

Plz help.

Thanx in advance.

Regards,
Soulfly

Move To Next Scene After Xx Seconds.
I have a movie that I have next and back buttons to move from one scene to another. What sort of actionscript would I need to add to the timeline to make it "autoplay" or advance to the next scene after a set amount of time if the next and back buttons are not pressed?

Thanks in advance!

Using AS To Move An Image Every 30 Seconds
I have a script where when a button is rolled over the image shifts to the next one and so on. what i need is to modify the script to move images into frame one image at a time every 30 seconds without the rollover. Just a continuous cycle of images. Can the attached script be modified to included the timing? if so how?
please let me know.







Attach Code

onClipEvent (load) {
_x = 0;
_y = 0;
speed = 6;
}


onClipEvent (enterFrame) {
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;

_root.selections1.fhsAd1.onRollOver = function () {
endX = 0;
endY = 0;
}
_root.selections1.fhsAd2.onRollOver = function () {
endX = -375;
endY = 0;
}
_root.selections1.fhsAd3.onRollOver = function () {
endX = -750;
endY = 0;
}
_root.selections1.fhsAd4.onRollOver = function () {
endX = -1125;
endY = 0;
}
_root.selections1.fhsAd5.onRollOver = function () {
endX = -1500;
endY = 0;
}
_root.selections1.fhsAd6.onRollOver = function () {
endX = -1875;
endY = 0;
}
_root.selections1.fhsAd7.onRollOver = function () {
endX = -2250;
endY = 0;
}
_root.selections1.fhsAd8.onRollOver = function () {
endX = -2625;
endY = 0;
}
}

Move Mc Randomly Every 10 Seconds
I have movie clips in the timeline and i would like them to move randomly every 10 seconds. by randomly i move, i want each movie clip to move every 10 seconds. So each movie clip will have a movement inside of it by tweening.

so will do something like

mc1.gotoAndPlay(1);

i will create a function to call mc1 and play
but i will do this every 10 seconds.

please help out.

thanks.

SetInterval On Relative Movie Clip
I have a slide show that I am working on that I have images fade using setInterval. Every time that you roll over a button it fades out so I need this code to work on multiple buttons. If I replace
PHP Code:



currentIndex._alpha -= 10; 




with
PHP Code:



mc_thumb_na_1._alpha -= 10; 




it fades but this does not make the code very reusable down the line. I guess my question is how to I make the rollOver state fade without absolute coding in the movie clip name in the function?


PHP Code:



var nInterval:Number;
function fadeImage():Void {
    currentIndex._alpha -= 10;
    trace("message");
}
    
mc_thumb_na_1.onRollOver = function() {
    nInterval = setInterval(fadeImage, 50);
    var currentIndex:String = "mc_thumb_na_1";


Setinterval For Movie Clip Speed
Hi, my flash doc. is set at 10fps, but I would like for one of my movie clips to play slower. I have tried every combination of getting the setinterval and clearinterval to work, but nothing! It kind-of worked at one point, but I can't get back to that point, and now it only slows down during that movie clip for a few frames, then it kicks back up to 10fps. Would someone give me the exact code and tell me where exactly to put it? I'm not gettin' it!

Thanks,
Tracy

Passsing A Movie Clip With SetInterval
Ths script I am using in it most basic form looks like this:function fadeText(mcImage:MovieClip):Void {
trace("fadeTextCalled");



}

var nInterval:Number = setInterval(fadeText(laptop), 100);
trace("fadeText has been called");

However eventually I will need to target the MC laptop, but as soon as I pass this to the function the setInterval is brokend and only loops once.

Does anybody know if it is possible to pass this MC into the function?

Cheers.

Having A Button Inside A Movie Clip To Move The Root Movie To Another Frame?
i dont know much about actionscripting so explain to me in simple terms...

i have buttons inside a single movie clip and i want to have each button (when clicked or rollover-ed) move the frame header of the main (root) movie to another position. what actionscript does this require? and will each button actually be "clickable" since they're all encapsulated in ONE movie clip??


thanks

How Do I Move Movie Clips When A Drag Object Is Over/between 2 Movie Clip
Hi Folks,

I have a Drag and Drop Exercise. 6 Drag Items and 2 Drop Locations.

What I want is when there are 2 drop items/movie clips already on stage and you Drag the 3rd Movie Clip INBETWEEN 2 Existing Movie Clips, the 2nd Movie Clip shifts down and a place is created for the 3rd Movie Clip.
Source file FLA attached, Saved as Flash 8 From CS3
Thanks
RG


http://www.4shared.com/file/24611229...055_ForEE.html

How To Make An Instance Move X Pixels In Y Seconds
Hey guys!

I'm creating a Flash program that simulates the Millikan Oil Drop experiments.
I need the oil drop to move on the Y axis a certain amount of pixels in a certain amount of time. A constant calculation will be taking place as the amount of pixels per. second will be dynamically effected by the user hitting keys (allready have that all programmed).

I'm not sure how to go about this

I just need the basic idea of how to make a Movie Clip instance move on an axis. So far everything I've done has moved it their instantly, and I dont want this to be dependent on the CPU speed of the users computer.

I've tried something like:
------------------------------------------
oil_drop1._x = 264;
oil_drop1._y = 130;

for (var i=130; i < ; i+=.05) {
oil_drop1._y += i;
}
------------------------------------------

But it does it instantly

I've also tried an incremented value in the form of:

setProperty(_root.oil_drop1, _y, oil_drop1 = 200)

but that doesnt work either, again because its dependent on the CPU clock speed.


Any help IS GREATLY APPRECIATED!!

Thanks guys! This is my first time posting!

How Do I Move A Whole Movie Clip?
I was working on a movie, and I inserted a movie clip. The movie clip was cut in on the wrong place on the screen, and I wanted to reposition it, but I donīt know how to move all the frames to the exact same position on the screen!
Can somebody please help me?

I Want To Move My Movie Clip
using the kerboard arrows,(mouse if possible), and keyboard letters!
how can i do it?
can i do it using onClipEvent(keyDown)?
if ys then how?
thanks in advance
Peleg

Movie Clip Won't Move
Hi all,

I'm trying to dynamically create movieclip instances with attachMovie(). The problem is, I'm trying to change the position with the _x and _y properties and it doesn't work. The movieclip appears on the stage but the position remains 0,0. Here's my code:

attachMovie("radioButton", "radioButton1", 2);
radioButtion1._y = 10;
radioButtion1._x = 10;

Like I said, the clip won't move. I've tried to change other properties, like _width, without problems. So, if anyone knows what I'm doing wrong, I'd appreciate some help.

Thanks,

Makac

-=Move Movie Clip=-
Although this should be a breeze for someone such as myself... I can't seem to get a certain aspect to work...

I need to basically move/duplicate a currently existing movieclip into another dynamically created movieclip. All attempts thus far have failed

::::::::::::::::::::::::::::::::
I tried a general duplicate movie clip method.

==
duplicateMovieClip("Close", "CloseButton", eval(WindowName+".TitleBar"));
==

This faultered as the duplication just occured on the root -_-

::::::::::::::::::::::::::::::::
I even attempted creating a null movie clip in one of my layers then swaping depth.

==
eval("_root."+WindowName + ".TitleBar").createEmptyMovieClip("closeholder ", 1);
Close.swapDepths(eval(WindowName+".TitleBar.closeh older"));
==

In this case I'm probably using [and understanding] depths incorrectly. Basically I assumed depth/target/object were interchangable as in specification of a path... or a general depth.

::::::::::::::::::::::::::::::::
Any idea's on moving my movie clip around throughout other dynamic movieclips/objects? Im thinking I MIGHT have to specify the path as a variable then eval the var to associate properly... hmm.

Thanks in ahead,

~Zeth

Move Movie Clip
Hi,

I want to start a movieclip ( travel) or graphic, but i guess a movieclip is better, from one place move to another. The starting point is variable (a land on the worldmap) the destination is steady (Amsterdam, The Netherlands). The worldmap is a movieclip, countries are buttons). So the user clicks a country as a starting point.

Does anybody how to do this?
Help will be nice.

Thanx
FD

MOVE One Movie Clip To Another Mc
Hello

With the click on one button, I want to MOVE a specified movie clip "ARROW" to another "mc". Then with the click on the next button I want "ARROW" to slide close to another "mc". And so on in the same form.

I have no idea about this slide/movement script.
If this is very difficult, the more easy possibility might be to tell "ARROW" go to this x/y coordinates.

Can you tell me how?

Thank you.

Tito.

Movie Clip Move
Hi all,

I have tried everywhere looking for a fix for this code. I am looking to have mulitable buttons which when pressed, will move a movie clip to a specific point 1. If the movie clip is aleady at that specific point... it will move to specific point 2.

Ok... here is an example of what I am talking about.

On the button the action is this:


on (press) {
_root.over = true;
}


Which sets off the script on a movie:


onClipEvent (enterFrame) {
if (_root.over_y = 400 {
_root.over_y = 200;
_root.over_x = 200;
ydif = (_root.target._y-_root.over_y)/10;
xdif = (_root.target._x-_root.over_x)/10;
_root.target._y -= ydif;
_root.target._x -= xdif;
_root.over02_y = 50;
_root.over02_x = 50;
ydif = (_root.target02._y-_root.over02_y)/10;
xdif = (_root.target02._x-_root.over02_x)/10;
_root.target02._y -= ydif;
_root.target02._x -= xdif;

}else{
_root.over_y = 400;
_root.over_x = 400;
ydif = (_root.target._y-_root.over_y)/10;
xdif = (_root.target._x-_root.over_x)/10;
_root.target._y -= ydif;
_root.target._x -= xdif;
_root.over02_y = 200;
_root.over02_x = 200;
ydif = (_root.target02._y-_root.over02_y)/10;
xdif = (_root.target02._x-_root.over02_x)/10;
_root.target02._y -= ydif;
_root.target02._x -= xdif;
}


It pretty much works except the important line: if (_root.over_y = 400 { What I am trying to say here is if the y point of movie clip 1 is 400, then do whats under. Else do the other thing.

Any ideas? Thanks in advance.

Please Help My Movie Clip Move The Right Way
Hi!
I have attached the file that I'm having problems with!
I would like my class to type the answer to the calculation in the box provided. If they get the answer right, the mouse should jump a little way up the hill and start to slide slowly back down again.
The sliding down part will act as a bit of a timer for the next question (the longer they take to answer, the further the mouse will have slipped back down the hill!)
I realise I have made the movie clip of the mouse incorrectly, as he slides up hill to his final place instead!
How can the children click 'CHECK' and the computer will jump the mouse 120 frames forward to his first jump point?
Also, how can it be animated so it slides slowly back down again?
Hope this makes some sort of sense!
Cheers
Chris

How To Move A Movie Clip On The X
I've looked through a number of posts but can't quite find what I am looking for. I have a movie clip that is a timeline that I would like to have move from one point to another on the x axis when a button is pushed. The idea being when button 1 is clicked the movie clip moves to position 1, then when button 2 is clicked the movie clip advances to position 2...etc. What script would I use to accomplish that?

Thanks for the help in advance

Move A Movie Clip
I am trying to get my movie clip to go from point "a" to point "b", but I am not having any luck.


ActionScript Code:
cd.onEnterFrame = function (){
        this._rotation -=30; //sets the rotation of the movie clip
        if (this._x<100) {
                this._x -=20;
        }
       
}

Help Need To Move A Movie Clip
I Need help moving a movie clip in a wave movement ( like the sin or cosine waves we learned in school). I have a movie clip called "bird". I am trying to write action script to the main movie and control the movie clip "bird" with the bird._x and bird._y. It is moving fine from left to right but the up and down motion is not working correctly. May be I need to put it in a loop or something. I am not sure what I am doing wrong. Any help will be appreciated.

Thanks,
Edo

Help Need To Move A Movie Clip
I need to move a movie clip with action script. I am not sure how to do it. I am writing action script to one of the layers and calling my movie clip "bird". I want to move the clip in a wave motion(like a sine wave). I am using the bird._x and bird._y and setting them equal to a variable. But the _y part of it is not moving. The movie clip is only moving from right to left and there is no upward or downward movement. I am stuck and would appreciate any help.

Thanks,
edo

Move My Movie Clip
Hi there!
Hope u all had a nice holidays!

I have a button in my movie clip. This same button is located down in my movie clip. Once this button is pressed, you reach another frame from the same movie clip but at the same hight of the button.
How could i direct the user to the top of the movie clip after pressing the button? And not keep the same "hight" of the button.

Cheers.
Leo.

Need Movie Clip To Move Up And Down
Hi everyone,

I have a movieclip on the main timeline and would like it to move very slowly up and down on a continuous basis. I'd like to use actionscript to do this instead of tweening on the timeline. The only actionscript I can think of that might work is using the _y property but I don't know how to construct the full actionscript to make it work. Can someone help out?

Thanks for any help offered.

Help Need To Move A Movie Clip
I need to move a movie clip with action script. I am not sure how to do it. I am writing action script to one of the layers and calling my movie clip "bird". I want to move the clip in a wave motion(like a sine wave). I am using the bird._x and bird._y and setting them equal to a variable. But the _y part of it is not moving. The movie clip is only moving from right to left and there is no upward or downward movement. I am stuck and would appreciate any help.

Thanks,
edo

[F8] How Can I Control A MovieClip Move Randomly In The Stage Every Five Seconds?
Hi all,

I am having trouble on my Flash assignment which due on Monday, for the assignment, I am goingt to make a game, similar to the classic aracade game, Asteroids. They provided some basic code for the timing and rotation of asteroids, the behavior of the asteroids is appear randomly (but not moving) in the stage every five seconds with rotation, that's already been done by the code provided.

Now I need to modify the behavior of the asteroids so that when they appear, they:

spin in a random direction at random speed and size
move in random direction at random speed.

I feel really helpless, because programming is my weakness...
I hope someone can help me to solve this problems...

Thank you very much~~

How Can I Control A MovieClip Move Randomly In The Stage Every Five Seconds?
Hi all,

I am having trouble on my Flash assignment which due on Monday, for the assignment, I am goingt to make a game, similar to the classic aracade game, Asteroids. They provided some basic code for the timing and rotation of asteroids, the behavior of the asteroids is appear randomly (but not moving) in the stage every five seconds with rotation, that's already been done by the code provided.

Now I need to modify the behavior of the asteroids so that when they appear, they:

spin in a random direction at random speed and size
move in random direction at random speed.

I feel really helpless, because programming is my weakness...
I hope someone can help me to solve this problems...

Thank you very much~~

Movie Clip Move To Position
hi, i have just made a few buttons lined up verticaly, now what im tring to do is on mouse over have a floating movie clip move over the button, please have a look at fla attacted and tell me where im going wrong

thanks brian

Making A Movie Clip Move
This is probably a no-brainer for most, but I made a movie clip of a set of eyes, and I want them to blink... like, every 30 frames. So I double-clicked the movie clip symbol, which brought me to the clip's own seperate timeline. There, I made the animation of blinking eyes just like I wanted it. But when I go back to the main animation, the movie clip doesn't animate... it just stays there on the first frame.

Could somebody tell me if there's a way to activate the clip?

I'm using Flash MX, if that is useful info.

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