# Determinating Movie Clip speed

**URL:** <https://forum.kirupa.com/t/determinating-movie-clip-speed/3406>\
**Category:** design\
**Created:** [February 6, 2002, 9:12pm UTC](https://forum.kirupa.com/t/determinating-movie-clip-speed/3406 "2002-02-06T21:12:51Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 6, 2002, 9:12pm UTC](https://forum.kirupa.com/t/determinating-movie-clip-speed/3406/1 "2002-02-06T21:12:51Z")

</div>

This is what I want to do :

I have a scrolling text on a Movie Clip, and I want the user to chose the scrolling speed. An example of what I need, is the scrolling text on the Home Page of [www.metallica.com](http://www.metallica.com). Please see it, and tell me the script I should use, to do smth like that.

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 7, 2002, 5:12am UTC](https://forum.kirupa.com/t/determinating-movie-clip-speed/3406/2 "2002-02-07T05:12:35Z")

</div>

That might be a little tricky. There are certainly ways of accomplishing this. I’ll have to think a little on it first though.

Question… will the text be changing periodicaly, or will it always be the same text scrolling?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 7, 2002, 3:42pm UTC](https://forum.kirupa.com/t/determinating-movie-clip-speed/3406/3 "2002-02-07T15:42:17Z")

</div>

I’m talking about this: [www.cliff-god.com/res5.swf](http://www.cliff-god.com/res5.swf)  
Check it out! And thanks!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 7, 2002, 5:25pm UTC](https://forum.kirupa.com/t/determinating-movie-clip-speed/3406/4 "2002-02-07T17:25:42Z")

</div>

Do you absolutely want a little dragger to set the speed ?  
pom 0]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 7, 2002, 6:26pm UTC](https://forum.kirupa.com/t/determinating-movie-clip-speed/3406/5 "2002-02-07T18:26:33Z")

</div>

Yeah… if possible… if not, do u have any other idea, tell me anyways.  
Ynx

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 7, 2002, 6:52pm UTC](https://forum.kirupa.com/t/determinating-movie-clip-speed/3406/6 "2002-02-07T18:52:41Z")

</div>

I’m doing it, just wait for 5 minutes…  
pom 0]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 7, 2002, 7:32pm UTC](https://forum.kirupa.com/t/determinating-movie-clip-speed/3406/7 "2002-02-07T19:32:24Z")

</div>

OK, that wasn’t 5 minutes, but there it is :  
0] pom

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 7, 2002, 8:53pm UTC](https://forum.kirupa.com/t/determinating-movie-clip-speed/3406/8 "2002-02-07T20:53:49Z")

</div>

Yeah man!! This is what I want! Can u please send me the script??? You can post it here, or send me an email at [igli2000@yahoo.com](mailto:igli2000@yahoo.com)  
Thnx a lot!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 7, 2002, 9:21pm UTC](https://forum.kirupa.com/t/determinating-movie-clip-speed/3406/9 "2002-02-07T21:21:01Z")

</div>

File sent…  
Here’s what I did by the way :  
4 layers :  
background : a movie clip containing a box that matches exactly the dimensions of my mask  
dragger : a movie clip that’s draggable to change the speed. Actually a button inside a clip, to make it clickable.  
masked : a movie clip containing text broken apart. I’m not sure that the breaking is necessary but as a precaution…  
Mask : well, hum, hard to tell…

So the background and the mask are at the exact same location.

The script : Easy one :  
Masked :  
onClipEvent (load) {  
original = -this.\_height/2 -5 ; //I set the original position to just out of the screen  
this.\_y = original ; // I put the clip there  
}  
onClipEvent (enterFrame) {  
if (this.\_y \>this.\_height+\_root.pos+\_root.height/2) this.\_y = original ;

//if my text has gone out of the box completely (\_root.pos is the position of the mask and \_root.height its  
//height) I put the clip back up

else this.\_y += \_root.diff ;

//I move the movie clip, making it go down by \_root.diff (which is controlled by the dragger of course)  
}

Background :  
onClipEvent (load) {  
\_root.pos = this.\_y;  
\_root.height = this.\_height;  
} //as I said… initializing the size and position of the mask

dragger :  
**the button**  
on (press) {  
\_root.pressing = 1 ;  
}  
on (release) {  
\_root.pressing = 0 ;  
}

//just flags

**the clip**

onClipEvent (load) {  
\_root.pressing = 0 ; //originally not pressing  
position = this.\_y ; //set the 0 position to the original position (at the top, in my clip)  
}  
onClipEvent (enterFrame) {  
if (\_root.pressing) { //if I’m pressing the button  
&nbsp &nbsp &nbsp &nbsp if (\_root.\_ymouse \> \_root.pos-\_root.height/2+this.\_height/2) {  
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp if (\_root.\_ymouse \< \_root.pos+\_root.height/2-this.\_height/2)

//Wow. Kinda ugly, hue ? It checks if the mouse is located between the bounds of your draggable area

this.\_y = \_root.\_ymouse ; //the dragger follows the mouse  
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp else \_root.pressing = 0 ;  
//trying to solve the problem that if you go astray clicking, it works… strangely  
&nbsp &nbsp &nbsp &nbsp }  
}  
\_root.diff = 0.05\*(this.\_y - position) + 1 ;  
// set the speed to 5% of the offset +1, an original speed, which you can change.  
}

I put the frame rate at 20fps, and there you go !!

pom 0] , who knows that without the fla in front of your eyes, I doesn’t look too good.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 7, 2002, 9:40pm UTC](https://forum.kirupa.com/t/determinating-movie-clip-speed/3406/10 "2002-02-07T21:40:56Z")

</div>

Yeah! Great work! But u know… whithou the fla is hard to get it all… and in my inbox there’s nothing. Please try to send it again. ([igli2000@yahoo.com](mailto:igli2000@yahoo.com) or [igli01@hotmail.com](mailto:igli01@hotmail.com))  
Thnx!!!  
I really appreciate it!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 7, 2002, 9:48pm UTC](https://forum.kirupa.com/t/determinating-movie-clip-speed/3406/11 "2002-02-07T21:48:52Z")

</div>

I sent it back to both your adresses. Otherwise, get it here :  
[www.multimania.com/ilyaslamasse/box.zip](http://www.multimania.com/ilyaslamasse/box.zip)

I hope you can make this work ! And don’t forget to post on this forum once you’ve implemented the effect on your site !  
pom 0]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 7, 2002, 10:11pm UTC](https://forum.kirupa.com/t/determinating-movie-clip-speed/3406/12 "2002-02-07T22:11:36Z")

</div>

Yeah, I’m gonna post here, when i’ll finish my work… thanks…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 8, 2002, 11:08am UTC](https://forum.kirupa.com/t/determinating-movie-clip-speed/3406/13 "2002-02-08T11:08:06Z")

</div>

nice scripting Pom… smoken!!!
