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

  • SEARCH
  • Home
  • 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 532841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:26:48+00:00 2026-05-13T09:26:48+00:00

Hi I have an actionscript that moves a box across the stage when the

  • 0

Hi I have an actionscript that moves a box across the stage when the mouse is over a left or right arrow shaped button . The script below does just that. BUT what I want to do is have the box repeatedly move until the mouse is moved off the arrow button . I have tried all ways can anybody please point me in the right direction .I have removed a lot of the code but hope this is enough to get my point across. Thanks Mick

right_arrow.addEventListener(MouseEvent.mouseOver, moveR) ;
left_arrow.addEventListener(MouseEvent.mouseOver, moveL) ;

function moveL(e:MouseEvent)    {
box_image.x = box_image.x - 5 ;
    }
  • 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-05-13T09:26:48+00:00Added an answer on May 13, 2026 at 9:26 am

    you could use the setInterval Method:

    right_arrow.addEventListener(MouseEvent.mouseOver, handleMouseOver) ;
    right_arrow.addEventListener(MouseEvent.mouseOut, handleMouseOut) ;
    
    function handleMouseOver( event:MouseEvent):void {
      setTimeout( moveBoxR, 500 ); //every 500ms
    }
    
    function handleMouseOut( event:MouseEvent):void {
      clearTimeout( moveBoxR );
    }
    
    function moveBoxR() {
      box_image.x -= 5 ;
    }
    

    or the ENTER_FRAME Event

    right_arrow.addEventListener(MouseEvent.mouseOver, handleMouseOver) ;
    right_arrow.addEventListener(MouseEvent.mouseOut, handleMouseOut) ;
    
    function handleMouseOver( event:MouseEvent):void {
      addEventListener( Event.ENTER_FRAME, moveBoxR )
    }
    
    function handleMouseOut( event:MouseEvent):void {
      removeEventListener( Event.ENTER_FRAME, moveBoxR )
    }
    
    function moveBoxR(event:Event) {
      box_image.x -= 5 ;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the library, right-click on a movieclip that you have written an ActionScript class
Does Actionscript have a built-in function that accepts a number and can return a
I have a pure ActionScript 3 project that I build using the open source
I have written an ActionScript client program that tries to connect to a local
I have a book, Essential ActionScript 3 (O'Reilly), to learn about using that language.
I have an mxml component PresentationWindow that is for brevity's sake, simply: <fx:Script> //...
I have an Actionscript project that I was building using Flash CS4. I embedded
I have made an actionscript that loads an external text file, and scrolls its
I have this action script that pulls images from a xml file > myPhoto
I have an actionscript class in my flex app that looks like this: package

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.