A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: button hit area

  1. #1
    Senior Member
    Join Date
    Feb 2004
    Location
    Halifax, MA
    Posts
    205

    button hit area

    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?

  2. #2
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    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

  3. #3
    Polak Maly ant_Z's Avatar
    Join Date
    Jul 2006
    Location
    Poland
    Posts
    440
    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 :]

  4. #4
    Senior Member
    Join Date
    Feb 2004
    Location
    Halifax, MA
    Posts
    205
    Quote Originally Posted by ant_Z
    "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.
    Code:
     _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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center