A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Scrollbar within button?

  1. #1
    Senior Member
    Join Date
    Jun 2009
    Posts
    171

    Unhappy Scrollbar within button?

    I have a movie clip button with a text box within it. The text box also has a scrollbar component attached.

    Since the movie clip button has roll-over functionality [ btn.onRollover = function() ], I believe that's taking precedence over the inner scrollbar. I guess this goes back to the common problem of a button inside of a button.

    Any good fixes out there?

    Thanks.

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    Just don't use button-behavior actions for the movieclip, use movieclip-behavior actions, like onMouseMove and hitTest.

    gparis

  3. #3
    Senior Member
    Join Date
    Jun 2009
    Posts
    171
    I've been doing a lot of modification to make that work for my situation. I think this may work; however, do you know of any other ways around it?

    Thanks.

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    no. just this one (onMouseMove and hitTest). A button in a button will never work.

    gparis

  5. #5
    Senior Member
    Join Date
    Jun 2009
    Posts
    171
    I'm just having trouble because I'm duplicating the movie clip dynamically and I only want one to work at a time.

    There are little people. When you hover over one, it shows the speech bubble with text & scrollbar. The characters need to be at random positions, so sometimes they will overlap. For example, the speech bubble may be over top of the hit area of a person behind it. Now there are 2 bubbles open (not good).

    I've tried a bunch of things like using a boolean so it only shows 1 at a time, but still now luck.

  6. #6
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    The overlap could be solved with swapDepths on the hitTest. The 'one at a time' can be solved with a shape, invisible, button (useHandCursor:false) on the lowest layer of the little person's mc.

    gparis

  7. #7
    Senior Member
    Join Date
    Jun 2009
    Posts
    171
    Oh I was already using swapDepths(), so they were overlapping properly.

    Could you please further explain:

    The 'one at a time' can be solved with a shape, invisible, button (useHandCursor:false) on the lowest layer of the little person's mc.

    I think I know what you mean, but since it's onMouseMove, rather than onRollOver, it's able to show the rollOver for 2 (movie clip) buttons at the same time, you know?

  8. #8
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    An invisible button (a shape in the hit Area of the button) will prevent being able to target the object that is underneath the one that has the highest depth (therefore is in front).

    In order to prevent the cursor to change into a hand when hovering over that invisible button, give the button an instance name, for example 'hidder' and write:
    Actionscript Code:
    hidder.useHandCursor = false;

    gparis

  9. #9
    Senior Member
    Join Date
    Jun 2009
    Posts
    171
    the one behind it stills shows because it's using a hitTest with the mouse, not a rollOver

Tags for this Thread

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