;

PDA

Click to See Complete Forum and Search --> : button hit area


jimventola
08-21-2006, 07:03 PM
I have a comoponent push button that triggers a sound. I find that clicking outside the button for some distance causes the sound.

Is there a way to restrict the hit area of a button so that the user must click inside it to activate?

w.brants
08-22-2006, 01:24 AM
There isn't a way to set the hit area but it's good you mentioned this because it's a bug :)
I'll take a look at it.

Wilbert

ant_Z
08-22-2006, 09:01 AM
Hi

"What we cant make - we can fake" - that my favourite quote ;) so... remove click from button. If button takes us to frame "lol" for example, add in "lol" frame sound onLoad. You even dont have to use AS - just press F8, and set actions. This is quite nice :]

jimventola
08-22-2006, 01:18 PM
"What we cant make - we can fake" - that my favourite quote ;) so... This is quite nice :]

Thanks, I will play with this. I am actually streaming a sound file depending on where we are in the file shown in the contentpane.

Currently, the button is a component button and lives on the frame. I did experiment with using the code (it came from Chris) in the action of a regular (GUI button), and it didn't work. (I didn't use your frame method, just the sound playing stuff.)

I think it may have to do with scope of variables. The button has to get the current page in the contentpane and add it to the string of the audio filename for the streamed audio.
_root.mySound.loadSound("Reading"+contentpane1.getPage()+".mp3", true);

It may be that since the contentpane is in the frame 1 actions, it is not finding it. I am not sure.

I am glad to have a second way to skin this cat.