PDA

View Full Version : Determinating Movie Clip speed



Shqiptari1984
February 6th, 2002, 05:12 PM
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. Please see it, and tell me the script I should use, to do smth like that.

Thanks

upuaut8
February 7th, 2002, 01:12 AM
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?

Shqiptari1984
February 7th, 2002, 11:42 AM
I'm talking about this: www.cliff-god.com/res5.swf (http://www.cliff-god.com/res5.swf)
Check it out! And thanks!

ilyaslamasse
February 7th, 2002, 01:25 PM
Do you absolutely want a little dragger to set the speed ?
pom 0]

Shqiptari1984
February 7th, 2002, 02:26 PM
Yeah.. if possible.. if not, do u have any other idea, tell me anyways.
Ynx

ilyaslamasse
February 7th, 2002, 02:52 PM
I'm doing it, just wait for 5 minutes...
pom 0]

ilyaslamasse
February 7th, 2002, 03:32 PM
OK, that wasn't 5 minutes, but there it is :
0] pom

Shqiptari1984
February 7th, 2002, 04:53 PM
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
Thnx a lot!

ilyaslamasse
February 7th, 2002, 05:21 PM
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.

Shqiptari1984
February 7th, 2002, 05:40 PM
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 or igli01@hotmail.com)
Thnx!!!
I really appreciate it!

ilyaslamasse
February 7th, 2002, 05:48 PM
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]

Shqiptari1984
February 7th, 2002, 06:11 PM
Yeah, I'm gonna post here, when i'll finish my work... thanks...

upuaut8
February 8th, 2002, 07:08 AM
nice scripting Pom.. smoken!!!