Following mouse bar resizeble (more or less)

Hi there!
In my main movie i got few buttons of different size and one bar on the bottom of the stage which is following the mouse.
Because the buttons are different i would like to shape this bar with the same size ( width ) every time.
sample :
small link like HOME will have a bar so long ----
long link like PERSONAL RESEARCH will have this bar ----------------------

hope u get what i mean.

//action for the controller

onClipEvent (enterFrame){
cX=_root.follow._x;
difX=cX-xPos;
setProperty (_root.follow, _x, cX-(difX/3));
}

//action for buttons

on (rollOver){
_root.control.xPos= 41;
}
// i know i should use and define a function but …don’t know how.

thank for any suggestion u can make
:toad:

just set the _width property of _root.follow (assuming follow is the instance name of the bar… ?) equal to the width of each button.

if you’re using Button symbols, you’ll need to use the instance name.

on (rollOver) {
_root.control.xPos = 41;
_root.follow._width = buttonInstance._width;
}

if you’re using a MovieClip symbol as Button:

on (rollOver) {
_root.control.xPos = 41;
_root.follow._width = this._width;
}

hope it helps. =)

thanks man
guess i 'll need few hours to realize what u suggested me.
i am using button symbols.
iz 15 mins to 4 am here but i 'll try ur way.
be back soon
thanks again

ok first trial.

on (rollOver){
_root.control.xPos=187;
_root.follow._width = tw._width;
}
on (release) {
loadMovie(“tw.swf”,“bio_dummy”);
}

// tw is the button istance.

as soon as u go over this button the bar became very very long (nearly the w-stage ) and it doesn’t change anymore.
funny trick but i guess i miss something…

i assigned an istance to the one of the buttons and i paste your code after mine as above…
going to try again
thanks
ciao

it can be sounds very stupid but i was thinking
who 's gonna tell the controller to reset the size bar when the user goes out of the hit area ??
do i need a onRollOut action ??
very stupid but…

yup… you could store the original width of the bar in a variable, then in the rollOut event:

on (rollOut) {
_root.follow._width = yourVariable;
}

:slight_smile:

sorry man i am thick
can u be more clear because i am not having breakfast with variables…

paste this code in the timeline:

_global.originalWidth = follow._width;

on the buttons you’d have this code:

on (rollOut) {
_root.follow._width = originalWidth;
}

:wink:

going now 2 paste
what time is in there?

09:15 pm

i’m leaving at 11:00 pm (party!!) so we still have time. :stuck_out_tongue:

man i am so sorry ,
following ur tips but it doesn’t work to me and i hope i’ll get u in few hours .
ciao and grazie!!!

gonna be alive for 10 mins
can we do it
don’t forget i am thick!

ok… i guess i could set up an example for you. :wink:

on one of the buttons:

on (rollOver) {
_root.control.xPos = 187;
_root.follow._width = thougtswords._width;
}

on (rollOut) {
_root.follow._width = originalWidth;
}

on the first frame of the timeline:

_global.originalWidth = follow._width;

smelling errors
did i still miss smthing?

don’t work too much …save energy x the party
appreciating

ok… here it is. =)

sorry… my friends are here (a bit early!?). got to go. :-\

i hope you can solve the problem. :wink:

dead now
thanks
need to sleep
thanks
do u mind a question after the party
ciao

Originally posted by thekok
do u mind a question after the party

shoot. :wink:

ps. party sucked big time. :-\

i am here but i guess u sleeping now…??