Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8555767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:11:58+00:00 2026-06-11T15:11:58+00:00

I am developing an iOS game in Flash CS6. I have a basic movement

  • 0

I am developing an iOS game in Flash CS6.
I have a basic movement test that I put in an Event.MOUSE_DOWN handler.

What I’m expecting/wanting is when I held my finger down on the button, that the player would keep moving until I stop touching the screen.

What happens though, is I have to keep constantly tapping to keep the player moving – rather than just hold my finger on the button and the player keeps moving.

What code should I use to accomplish what I want?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:11:59+00:00Added an answer on June 11, 2026 at 3:11 pm

    To accomplish this, you’ll need to run a function continuously in between MouseEvent.MOUSE_DOWN and Event.MOUSE_UP as MouseEvent.MOUSE_DOWN will only get dispatched one time per press.

    Here is a simple script to do just that:

    myButton.addEventListener(MouseEvent.MOUSE_DOWN,mouseDown);
    
    function mouseDown(e:Event):void {
        stage.addEventListener(MouseEvent.MOUSE_UP,mouseUp); //listen for mouse up on the stage, in case the finger/mouse moved off of the button accidentally when they release.
        addEventListener(Event.ENTER_FRAME,tick); //while the mouse is down, run the tick function once every frame as per the project frame rate
    }
    
    function mouseUp(e:Event):void {
        removeEventListener(Event.ENTER_FRAME,tick);  //stop running the tick function every frame now that the mouse is up
        stage.removeEventListener(MouseEvent.MOUSE_UP,mouseUp); //remove the listener for mouse up
    }
    
    function tick(e:Event):void {
        //do your movement
    }
    

    As an aside, you may want to use the TOUCH events, as it gives more flexibility with multi-touch control. Though if you’re only ever going to allow one item to be pressed at any given time, it’s not an issue.

    TO do that, just add Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT in your document class, then replace your MouseEvent listeners with the appropriate touch event:

    MouseEvent.MOUSE_DOWN becomes: TouchEvent.TOUCH_BEGIN
    MouseEvent.MOUSE_UP becomes: TouchEvent.TOUCH_END

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a new iOS programming and I'm developing a simple iPhone game that needs
I have been developing a simple game for iOS which involves dragging and using
I've been having some fun with Flash developing IOS apps. I currently have two
I'm developing a game for iOS that should include the multiplayer. It's not a
I am developing an iOS game that will need to render 500-800 particles at
I am developing and arcade game for Android and iOS . I have an
I am developing an iOS game and I have two questions. First, I am
I am developing a game for iOS. The memory I am using is around
I'm developing an iOS app using Core Plot headers. I have different UI for
I am developing an IOS app. I need a functionality that includes undo and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.