RageW0lf
August 30th, 2002, 01:38 PM
Hi,
I have contructed a movie, which consists of 6 buttons.
upon clicking a button text will appear in a box in the center of the movie clip (dif text for each button).
To demonstrate to the user which of the 6 buttons they are currently on, I want a "pointer" to slide about under the buttons.
I have constructed the following script for the pointer to move.
This script is attached to only 1 button (just want to get 1 button working at first) :
on (release) {
if (pointer._x == -155.0) {
pointer._x = -155.0;
} else if (pointer._x>-155.0) {
rateOfChange = 5;
pointer._x -= rateOfChange;
if (pointer._x == -155.0) {
pointer._x = -155.0;
}
} else if (pointer._x<-155.0) {
rateOfChange = 5;
pointer._x += rateOfChange;
if (pointer._x == -155.0) {
pointer._x = -155.0;
}
}
}
"pointer" is the instance name of my movie clip with the pointer in it.
Ok the problem is this script "kind of" works.
But It moves "5" each time the button is pressed. if you press is like 20 times it gets to where it is supposed to be! However I want it to slide accross after only 1 press!
What do I need to change to do this?
PS. I KNOW I could make it work with slight alterations using "onclip event" script attached to "pointer", but I would like to know what I need to do to get it working like this. If possible :P because it keeps thing simpler, easier to change and more mogical (In my mind)
So basically I don't need to know what I need to do to make it work with on clip event. I'm such a pain in the *** eh?
Those who have read my posts before will know I like to do things My way, and hate to know why things that should work don't. :bandit:
- I am still using FLASH (5) FIVE, until I get a bigger screen :ninja:
Thanks for help
I have contructed a movie, which consists of 6 buttons.
upon clicking a button text will appear in a box in the center of the movie clip (dif text for each button).
To demonstrate to the user which of the 6 buttons they are currently on, I want a "pointer" to slide about under the buttons.
I have constructed the following script for the pointer to move.
This script is attached to only 1 button (just want to get 1 button working at first) :
on (release) {
if (pointer._x == -155.0) {
pointer._x = -155.0;
} else if (pointer._x>-155.0) {
rateOfChange = 5;
pointer._x -= rateOfChange;
if (pointer._x == -155.0) {
pointer._x = -155.0;
}
} else if (pointer._x<-155.0) {
rateOfChange = 5;
pointer._x += rateOfChange;
if (pointer._x == -155.0) {
pointer._x = -155.0;
}
}
}
"pointer" is the instance name of my movie clip with the pointer in it.
Ok the problem is this script "kind of" works.
But It moves "5" each time the button is pressed. if you press is like 20 times it gets to where it is supposed to be! However I want it to slide accross after only 1 press!
What do I need to change to do this?
PS. I KNOW I could make it work with slight alterations using "onclip event" script attached to "pointer", but I would like to know what I need to do to get it working like this. If possible :P because it keeps thing simpler, easier to change and more mogical (In my mind)
So basically I don't need to know what I need to do to make it work with on clip event. I'm such a pain in the *** eh?
Those who have read my posts before will know I like to do things My way, and hate to know why things that should work don't. :bandit:
- I am still using FLASH (5) FIVE, until I get a bigger screen :ninja:
Thanks for help