-
Scrolling pixel fonts on whole integers - help!
Hi -
I would like to know how to scroll a pixel font and have it stop on a whole integer value on a roll out function.
I keep finding posts that say you SHOULD do this but I can't find a post or tutorial that says specifically how.
I emailed fontsforflash and they suggested I post an inquiry here, which wasn't very helpful but I'm hoping someone here will be.
My knowledge of ActionScripting is still fairly beginner so please be as specific as possible.
My current code for the scroll action (which works fine on antialiased fonts) is:
on (rollOver) {
tellTarget ("/upaction") {
gotoAndPlay ("up");
}
}
on (rollOut) {
tellTarget ("/upaction") {
gotoAndStop ("stop");
}
}
The down action is similar:
on (rollOver) {
tellTarget ("/scroll") {
play ();
}
}
on (rollOut) {
tellTarget ("/scroll") {
stop ();
}
}
The text itself is a movie clip scrolling behind a mask.
Also, if anyone has any tips to add to this on easing the stop action for a smooth stop that would be really nice too.
Thanks in advance!
-
Why don't you just read the _x or _y value of the object, and then set it to the integer value of same?
wholeX = parseInt(myObject._x)
myObject._x = wholeX
That should work..
Rich
-
i'm sure there is another code. The one that actually scrolls the MC, ie: alters it's _y position. It's there that you need to add a 'Math.round' to the position so it rounds up the _y property, avoiding the decimals.
parseInt just converts strings to numbers. What you want is to get rid of the decimals.
gparis
-
Still need help...
Thanks for responding -
I guess I wasn't very clear about my inexperience with ActionScript so I'll just say that it's pretty beginner and ask how I would use the Math () round script or the other suggestion someone made.
I tried using the Math () round dealie but it didn't work - probably because I put it in the wrong spot or something. I don't know. Any further insight/suggestions?
I was really hoping to find a working example with the script somewhere here but I didn't have any luck. Does anyone know of something like that?
-
Why don't you post your action script code and we can edit what you've got..
Rich
-
My current script...
This is the script I currently use on my "up" and "down" buttons to scroll any antialiased font. Is there someway to modify this to scroll a pixel font or do I need a different script entirely?
on (rollOver) {
tellTarget ("/upaction") {
gotoAndPlay ("up");
}
}
on (rollOut) {
tellTarget ("/upaction") {
gotoAndStop ("stop");
}
}
The down action is similar:
on (rollOver) {
tellTarget ("/scroll") {
play ();
}
}
on (rollOut) {
tellTarget ("/scroll") {
stop ();
}
}
-
What actions are executed when calling the various frames in other movie clips you have referenced in that code?
That is the code I am looking for..
Rich
-
Code...
I have an "up Action" MC that is empty with a stop action on the first frame and this code on the frame following:
tellTarget ("/scroll") {
prevFrame ();
}
gotoAndPlay ("up");
I hope that's what you were looking for...
-
Hi..
Well none of this code shows me up the movie is actually moving..
I'm guessing that is one frame "up"
If you want to e-mail me an attachment with the FLA, you can send it to rwmorey71@hotmail.com
Rich
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|