A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Target Game

  1. #1
    Junior Member
    Join Date
    Feb 2000
    Posts
    21
    Can someone please help!!

    I have a target(movieClip) randomly moving around the stage and I need to detect the percentage of time the user keeps their cursor in the centre of the target!

    I'm thinking of a time limit of 60 seconds and the user must achieve 20% (12 seconds in the target) to win.


    Thanx

    Nick

  2. #2
    i'm thinking off the top of my head, so i could be wrong here:

    to detect if the mouse is within the target
    put a transparent button in the target .in the button u put:

    on(mouseOver) {
    _root.enterTime = getTimer();
    }

    on(mouseOut) {
    _root.timeWithin += getTimer() - _root.enterTime;
    }

    _root.timeWithin will keep count of how many miliseconds the mouse was over the button. of course u will have to set it to zero beforehand, and also to keep track of the 60 second time period, and find the ratio but that's more or less trivial.


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