Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - Change color of selected button on mouse enter
  FAQ FAQ  Forum Search   Register Register  Login Login

Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

Change color of selected button on mouse enter

 Post Reply Post Reply Page  12>
Author
mark pigott View Drop Down
New Member
New Member


Joined: 08 Dec 2014
Points: 17
Post Options Post Options   Quote mark pigott Quote  Post ReplyReply Direct Link To This Post Topic: Change color of selected button on mouse enter
    Posted: 21 Jan 2015 at 5:05pm
Right now I've got a rather convoluted way of changing a referenced button when I mouse over or
mouse exit a master button.

On the master button I have the code:

mouse enter

 getField("TRIG01").display=display.hidden
 getField("TRIG01INV").display=display.visible

mouse exit

getField("TRIG01").display=display.visible
getField("TRIG01INV").display=display.hidden


This seems rather ineffiecient.

Is there a way to change the code to allow only using one button (ie TRIG01)
so when I mouse enter this button turns yellow
and when I mouse exit it turns back to normal?



Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 634
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 21 Jan 2015 at 5:19pm
You can simply change the field's fillColor property...
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com
Back to Top
mark pigott View Drop Down
New Member
New Member


Joined: 08 Dec 2014
Points: 17
Post Options Post Options   Quote mark pigott Quote  Post ReplyReply Direct Link To This Post Posted: 21 Jan 2015 at 5:20pm
Can you show an example of this.
I started javascript yesterday.


Edited by mark pigott - 21 Jan 2015 at 5:43pm
Back to Top
mmazal View Drop Down
New Member
New Member
Avatar

Joined: 20 Jan 2012
Location: Kitchener, ON
Points: 10
Post Options Post Options   Quote mmazal Quote  Post ReplyReply Direct Link To This Post Posted: 21 Jan 2015 at 5:53pm
mouse enter
run javascript
event.target.fillColor = color.yellow

mouse exit
run javascript
event.target.fillColor = color.transparent  <- or wahtever your original color was
Back to Top
mark pigott View Drop Down
New Member
New Member


Joined: 08 Dec 2014
Points: 17
Post Options Post Options   Quote mark pigott Quote  Post ReplyReply Direct Link To This Post Posted: 21 Jan 2015 at 6:34pm
That only works on the master button.
I want to change the shading of another button
when the mouse enters the master button.



Originally posted by mmazal mmazal wrote:

mouse enter
run javascript
event.target.fillColor = color.yellow

mouse exit
run javascript
event.target.fillColor = color.transparent  <- or wahtever your original color was
Back to Top
mmazal View Drop Down
New Member
New Member
Avatar

Joined: 20 Jan 2012
Location: Kitchener, ON
Points: 10
Post Options Post Options   Quote mmazal Quote  Post ReplyReply Direct Link To This Post Posted: 21 Jan 2015 at 6:40pm
ok

if you mean mouse enter and exit of Button1 changes the color of Button2 then

Button1 gets the code...

mouse enter
run javascript
getField("Button2").fillColor = color.yellow

mouse exit
run javascript
getField("Button2").fillColor = color.transparent  <- or wahtever your original color was
Back to Top
mark pigott View Drop Down
New Member
New Member


Joined: 08 Dec 2014
Points: 17
Post Options Post Options   Quote mark pigott Quote  Post ReplyReply Direct Link To This Post Posted: 21 Jan 2015 at 6:52pm
I figured it out:

MOUSE ENTER

 getField("TRIG01").fillColor=color.yellow

MOUSE EXIT


 getField("TRIG01").fillColor=color.transparent


Now I need to figure out how to copy paste the javascript to 8 other buttons then edit.
Nitro Pro  is used and it seems a little wanting.


I have programmed maxscript so all I need is a little push.
Back to Top
mark pigott View Drop Down
New Member
New Member


Joined: 08 Dec 2014
Points: 17
Post Options Post Options   Quote mark pigott Quote  Post ReplyReply Direct Link To This Post Posted: 21 Jan 2015 at 7:25pm
We both came to the same answer. Thanks.

Why is javascript case sensitive, whilst maxscript is not.
In maxscript
PCont.particlePosition=[0,0,0] works the same as PCONT.PARTICLEPOSITION=[0,0,0]
Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 634
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 21 Jan 2015 at 7:35pm
What does "maxscript" (whatever that is) have to do with JS? Why should they behave the same?
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com
Back to Top
mark pigott View Drop Down
New Member
New Member


Joined: 08 Dec 2014
Points: 17
Post Options Post Options   Quote mark pigott Quote  Post ReplyReply Direct Link To This Post Posted: 21 Jan 2015 at 7:59pm
http://docs.autodesk.com/3DSMAX/14/ENU/MAXScript%20Help%202012/
Back to Top
mark pigott View Drop Down
New Member
New Member


Joined: 08 Dec 2014
Points: 17
Post Options Post Options   Quote mark pigott Quote  Post ReplyReply Direct Link To This Post Posted: 21 Jan 2015 at 8:12pm
uploads/2002/pdficon.png

I was thinking changing the border color does not really cut it.
Here is the unshaded png that I'd like to highlight as we discussed earlier.
Let's call the master button "Button1"

and this slave button "Button2"

I'd like to have this Button2 change to a yellow highlight when mouse over is on Button1


Edited by mark pigott - 21 Jan 2015 at 8:13pm
Back to Top
 Post Reply Post Reply Page  12>
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.031 seconds.