A Flash Developer Resource Site

+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Junior Member
    Join Date
    Feb 2002
    Posts
    9
    How do I make a Draggable Mask that can be clicked??? I mean I have a Draggable Mask working that moves on drag. But now the problem is, I want some buttons on the Mask Image... Can anyone help me out???

  2. #2
    Junior Member
    Join Date
    Feb 2002
    Posts
    9
    I tried putting the buttons directly on the Image's layer but that didn't really work...

  3. #3
    Didn't do it. japangreg's Avatar
    Join Date
    Mar 2001
    Location
    \o/ |o| |o_ /o\
    Posts
    784
    Hey, Shichang. I can't quite understand what you are trying to accomplish. Can you post a link to an example so the people who read this thread will see exactly what you are dealing with?

    Thanks!
    japangreg

  4. #4
    Junior Member
    Join Date
    Feb 2002
    Posts
    9
    http://www.studentgear.net/shichang/testing.swf

    just a rough example i did moments ago... Lets say I want the red button clickable (on the right you have to drag the mask over) how do i do it???

  5. #5
    Denim Demon
    Join Date
    Jun 2002
    Location
    Outside of society
    Posts
    514
    I made something similar that drags when the mouse is pressed and also has actions on the mouse up.
    What if you add actions to the on (release) event?

    My site is http://www.pure-sugar.com/newsite

  6. #6
    Junior Member
    Join Date
    Feb 2002
    Posts
    9
    Originally posted by davyPaycheck
    I made something similar that drags when the mouse is pressed and also has actions on the mouse up.
    What if you add actions to the on (release) event?

    My site is http://www.pure-sugar.com/newsite
    It would be better if the options stay stationary and when only changes the content when you click on the sections... but nicely done still anyway, who has an idea of how to make it clickable???

  7. #7
    Didn't do it. japangreg's Avatar
    Join Date
    Mar 2001
    Location
    \o/ |o| |o_ /o\
    Posts
    784
    Hey, Shichang. Can you post the code you used to make your example? It would help in figuring out how to achieve what you want.

    As it stands now, I assume you are using a button within that sliding movie clip which covers its entire surface; this could be interfering with the button below it. You have a few options, depending on your code.

    DavyPaycheck has a good idea. You could incorporate a series of onRelease commands, or you could use a dropTarget approach, but both depend on your visitor dragging the mask over the button area and releasing the mouse. From what I've seen, you just want a simple point-and-click interface behind a mask, correct?

    If you aren't too attached to the draggable mask approach, I would suggest attaching the mask to the mouse so it moves without being dragged (i.e., no "click-n-hold" necessary). This would allow you to use the buttons without any other buttons covering them.

    In order to do this, you would need to restructure your masking movie clip a bit. You have two options here: first off, you can just mask the background and tween the mask moving accross it. Then add some action script to the movie clip instance on the main stage to update its current frame depending on the mouse position on the screen. This would work well for you because the mask only moves in two directions.

    The other option is to create a movie clip for the background behind the mask within another movie clip, and action script it to move behind the mask as the mouse moves. This can get pretty messy, and I think it's a bit of overkill for your needs. But if you want to see how it's done, I can give you some help. For an example, see

    http://www.geocities.com/room_910/sniper.html

    hth
    japangreg


  8. #8
    Junior Member
    Join Date
    Feb 2002
    Posts
    9
    Originally posted by japangreg
    Hey, Shichang. Can you post the code you used to make your example? It would help in figuring out how to achieve what you want.

    As it stands now, I assume you are using a button within that sliding movie clip which covers its entire surface; this could be interfering with the button below it. You have a few options, depending on your code.

    DavyPaycheck has a good idea. You could incorporate a series of onRelease commands, or you could use a dropTarget approach, but both depend on your visitor dragging the mask over the button area and releasing the mouse. From what I've seen, you just want a simple point-and-click interface behind a mask, correct?

    If you aren't too attached to the draggable mask approach, I would suggest attaching the mask to the mouse so it moves without being dragged (i.e., no "click-n-hold" necessary). This would allow you to use the buttons without any other buttons covering them.

    In order to do this, you would need to restructure your masking movie clip a bit. You have two options here: first off, you can just mask the background and tween the mask moving accross it. Then add some action script to the movie clip instance on the main stage to update its current frame depending on the mouse position on the screen. This would work well for you because the mask only moves in two directions.

    The other option is to create a movie clip for the background behind the mask within another movie clip, and action script it to move behind the mask as the mouse moves. This can get pretty messy, and I think it's a bit of overkill for your needs. But if you want to see how it's done, I can give you some help. For an example, see

    http://www.geocities.com/room_910/sniper.html

    hth
    japangreg

    /me shrugs i want the drag there
    How about I pass you the source file and you see what you can do...
    [Edited by shichang on 06-13-2002 at 10:53 AM]

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