A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: How to force a mouse up event ?

  1. #1
    Junior Member
    Join Date
    May 2009
    Posts
    20

    How to force a mouse up event ?

    How would one force/trigger a mouse up event (besides lifting finger) in as3?

  2. #2
    Senior Member
    Join Date
    Jul 2009
    Posts
    113
    Look into "dispatchEvent".

    Try...
    Code:
    buttonName.dispatchEvent(new MouseEvent(MouseEvent.MOUSE_UP));

  3. #3
    Junior Member
    Join Date
    May 2009
    Posts
    20
    It's not a button. It's on the stage. However, I think I see what your are getting at and will try it.

    Thank you

  4. #4
    Junior Member
    Join Date
    May 2009
    Posts
    20
    hmmm ... that didn't work as expected (the call was correct and good to know that for future reference).

    Also discovered onMouseUp(null) did the same thing.

    Essentially pressing the mouse button shoots a bullet. When I get a hit I get another bullet shot out immediately after the hit which isn't what I need. I need to have a set delay between firing.

    timer, perhaps?

  5. #5
    Junior Member
    Join Date
    May 2009
    Posts
    20
    I got it working ... it was my own stupid fault ... just had to get the booleans squared away ... not sure how to mark this as resolved :-S

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