Upvote 2

Some basic best approaches

Known Peter 7 years ago

Hi guys

Confused about best way to approach the following:


Button scenario

I have a simple box (a button) and I want a rollover state. I *could* do this quite simply by on mouse over > change style

However, this box appears in numerous places so the solution seems to be to create a Master item of the box and apply my style changes within that.


However, when I place this master item onto the screen, It doesn't seem to accept any Events and even though I've selected the Master if my box, I just see 'No item selected' in the Events panel.


Q1: Is this a bug or can Events be attached to Master items? It just seems very wierd that events can't be attached to Master Items.


Q2: Am I better off creating a Dynamic Panel for this button instead where the Dynamic Panel has two layers?

Layer 1 = Default state

Layer 2 - Hover state


I tried this and created mouse on and mouse leave events and get get a rapid flickering of states when I mouse over.


Q3: Common items on Dynamic layers

Lets say I have a dynamic panel (a button) with two layers (default and hover styles) and BOTH layers have the text 'click me'.

I see to have to duplicate that text on both layers.

I'd love to see an option that allows my text to be shared between layers instead of having to duplicate it


Thanks

Replies (5)
photo
1

Hi Peter,


Q1: Unfortunately any event can't be attached to a Master.


Q2: Yes, an option would be creating a Dynamic Panel with two layers.


Q3: Unfortunately this is not possible to accomplish. You will need to duplicate it.


Best,


Sonia Durán

photo
1

Thanks Sonia


Is there a simple example of a Dynamic Panel containing 2 states / layers

Layer 1 = Default state

Layer 2 - Hover state


I want the Hover state to display on mouse-over and I want it to revert to default on mouse-out

This seems really simple and I've done it before in multiple interactive Apps but I seem to be overlooking something crucial.

On mouse-over my attempt is flickering rapidly between the two states

Thanks

photo
1

Hi Peter,


The following example should help. Let me know how this works for you.


Best,


Sonia Durán

photo
1

Hey Sonia, I also have the same flickering problem when using Dynamic Panel states for the hover. I'm working off a mac though and can't expand that .rar file. Could you send me a sample file I could open? Thanks!

photo
1

Hi Adam. Here you are a video capture. Hope it helps.


Best,

photo
1

Hey Sonia, I can't expand .rar files, could you attach it as a .zip or just as the movie file itself? Thanks!

photo
1

Hi Adam


Here you are. :)

photo
2

Got it, rigging up 'mouse enter' and 'mouse leave' individually instead of using the 'mouse over', thanks!

photo
1

Glad to hear you got it to work!

photo
Leave a Comment
 
Attach a file