View Full Version : following mouse bar resizeble (more or less)
thekok
April 24th, 2003, 08:34 PM
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:
kode
April 24th, 2003, 09:36 PM
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. =)
thekok
April 24th, 2003, 09:45 PM
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
thekok
April 24th, 2003, 09:55 PM
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
thekok
April 24th, 2003, 10:01 PM
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...
kode
April 24th, 2003, 10:07 PM
yup... you could store the original width of the bar in a variable, then in the rollOut event:
on (rollOut) {
_root.follow._width = yourVariable;
}
:)
thekok
April 24th, 2003, 10:11 PM
sorry man i am thick
can u be more clear because i am not having breakfast with variables.........
kode
April 24th, 2003, 10:14 PM
paste this code in the timeline:
_global.originalWidth = follow._width;
on the buttons you'd have this code:
on (rollOut) {
_root.follow._width = originalWidth;
}
;)
thekok
April 24th, 2003, 10:15 PM
going now 2 paste
what time is in there?
kode
April 24th, 2003, 10:19 PM
09:15 pm
i'm leaving at 11:00 pm (party!!) so we still have time. :P
thekok
April 24th, 2003, 10:21 PM
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!!!
thekok
April 24th, 2003, 10:23 PM
gonna be alive for 10 mins
can we do it
don't forget i am thick!
kode
April 24th, 2003, 10:23 PM
ok... i guess i could set up an example for you. ;)
thekok
April 24th, 2003, 10:27 PM
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?
thekok
April 24th, 2003, 10:30 PM
don't work too much ....save energy x the party
appreciating
kode
April 24th, 2003, 10:36 PM
ok... here it is. =)
kode
April 24th, 2003, 10:43 PM
sorry.. my friends are here (a bit early!?). got to go. :-\
i hope you can solve the problem. ;)
thekok
April 24th, 2003, 10:48 PM
dead now
thanks
need to sleep
thanks
do u mind a question after the party
ciao
kode
April 25th, 2003, 02:02 AM
Originally posted by thekok
do u mind a question after the party
shoot. ;)
ps. party sucked big time. :-\
thekok
April 25th, 2003, 10:28 AM
i am here but i guess u sleeping now....??
kode
April 25th, 2003, 01:17 PM
now i'm here... :P
thekok
April 25th, 2003, 06:16 PM
i'll be on line from now up 2 hours.
kode
April 25th, 2003, 06:31 PM
what's your question then? =)
thekok
April 25th, 2003, 06:59 PM
ciao
still having problems
i notice that in your sample u are using movie clip as buttons but i am using only buttons.
do u think this can be the bug ?
thekok
April 25th, 2003, 07:05 PM
one more thing , i notice that in all ur script there is no numbers about the size or the _X pos of the bar ( i call'it <follow>) and this make me think??
i trust u but i am still doing something wrong... :(
thekok
April 25th, 2003, 07:06 PM
call' it "follow"
kode
April 25th, 2003, 07:23 PM
Originally posted by thekok
i notice that in your sample u are using movie clip as buttons but i am using only buttons.
do u think this can be the bug ?
i could sworn i used buttons!! :P
anyway, it doesn't matter... it works if you change its behavior to Button. :-\
Originally posted by thekok
one more thing , i notice that in all ur script there is no numbers about the size or the _X pos of the bar ( i call'it ) and this make me think??
i trust u but i am still doing something wrong... :(
nope... certainly i didn't. i used the _x and _width properties of each Button instead. ;)
kode
April 25th, 2003, 07:27 PM
i forgot... why don't you attach your file? i could tell you what you're doing wrong. :)
thekok
April 25th, 2003, 07:27 PM
ok let me have another go!
:) :) :)
thekok
April 25th, 2003, 08:08 PM
i got 4 pics x u (88k) , hope u don't mind
but i prefer do not to post them here
should i use a service yahoo account or u got some spare e-mail ?
ps= if u want to give up i'll understand :) :) :)
c
thekok
April 25th, 2003, 08:12 PM
i prefer to keep my main (messy) fla reserved but i'll be glad to post u ( in a private way ) a smaller version, the original with sounds and stuff is 2,2MB;
I can do it a smaller version and post it 2 u ( i am in adsl , {few minutes}
or the original 2,2
but in the maintime i'll be glad if u can have a look to this pics.............:) :) :)
kode
April 25th, 2003, 08:23 PM
ok... got the jpg's. ;)
you can send me the fla to the same address. :)
edit. by the way, a .zip would be fine. ;)
thekok
April 25th, 2003, 10:01 PM
did u get the zip ???:beam:
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.