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 9253093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:07:41+00:00 2026-06-18T11:07:41+00:00

I have 5 MovieClips ( 5 simple buttons ) and i need them play

  • 0

I have 5 MovieClips ( 5 simple buttons ) and i need them play one of them in every 4 seconds for ever, from second frame. What I’m doing wrong ? Thanks.

var clipArray:Array = new Array();



clipArray[0] = loader.button_01_mc.gotoAndPlay (2);
clipArray[1] = loader.button_02_mc.gotoAndPlay (2);
clipArray[2] = loader.button_03_mc.gotoAndPlay (2);
clipArray[3] = loader.button_04_mc.gotoAndPlay (2);
clipArray[4] = loader.button_05_mc.gotoAndPlay (2);




var clipTimer:Timer = new Timer(4000);
clipTimer.addEventListener(TimerEvent.TIMER, playClips);



function playClips(event:TimerEvent):void
{
    //Chooses a random clip in your array

     var randomClip:int = Math.random() * clipArray.length;

}



clipTimer.start();
  • 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-18T11:07:42+00:00Added an answer on June 18, 2026 at 11:07 am

    You need to store references to your movieclips in that array instead of the result (which is void) of a gotoAndPlay method call. Then get one of the clip from the array using a random index and call the gotoAndPlay method on it.

    var clipArray:Array = new Array();
    clipArray[0] = loader.button_01_mc;
    clipArray[1] = loader.button_02_mc;
    clipArray[2] = loader.button_03_mc;
    clipArray[3] = loader.button_04_mc;
    clipArray[4] = loader.button_05_mc;
    
    var clipTimer:Timer = new Timer(4000);
    clipTimer.addEventListener(TimerEvent.TIMER, playClips);
    
    function playClips(event:TimerEvent):void {
      var randomClip:int = Math.floor(Math.random() * clipArray.length);
      var mc:MovieClip = clipArray[randomClip];
      mc.gotoAndPlay(2);
    }
    
    clipTimer.start();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 3 movieclips, each one has 7 frames and labels that play different
I have some MovieClips that act like buttons, how can i do that when
Hi i have some movieclips like this one: game_mc.substage_mc.rightHand and inside the rightHand i
I have three different buttons. When you click one of the buttons, it is
I have two buttons that are in a movieclip, how can I reference them
My stage have 3 movieclip that is mc1,mc2 and mc3. each of them are
I have a container MovieClip that serves as a content area that I need
I have 2 overlapping movieclips on the stage. Both are instances of the same
I have a developed a application that allows users to draw simple images on
I have this set of codes to create a simple before and after image

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.