Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

AS2 How to make a button that moves every two seconds

New Here ,
Mar 19, 2014 Mar 19, 2014

How can I make a button that moves every two seconds by itself in ActionScript2?

At the moment, I have to use the on(press) command, but what I really need is for the button to be able to move randomly by itself every two seconds. For example:

(insert the code here) {

     bc1._x = random(250)

     bc1._y = random(250)

}

Thanks!

TOPICS
ActionScript
371
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Mar 19, 2014 Mar 19, 2014

You can use the setInterval function to have a function repeated for specific time intervals.  Here is a link to a tutorial that explains how to use it...

http://www.republicofcode.com/tutorials/flash/setinterval/

Translate
LEGEND ,
Mar 19, 2014 Mar 19, 2014
LATEST

You can use the setInterval function to have a function repeated for specific time intervals.  Here is a link to a tutorial that explains how to use it...

http://www.republicofcode.com/tutorials/flash/setinterval/

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines