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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:59:49+00:00 2026-06-09T19:59:49+00:00

I have a bit of a problem… I’m trying to do my friends flash

  • 0

I have a bit of a problem… I’m trying to do my friends flash project for university.. it’s actually really easy stuff but I have basically no knowledge of AS3 as I stopped using flash in place of full time coding a few years ago. Anyway it’s gotta be in tomo morn so if anyone break this code down for me I (and my poor friend) will be eternally indebted..

What does this line do:

var numFrames:int = this.dances_mc.totalFrames;

There is a symbol called dances_mc on the first frame of the timeline, in which there are 5 or so frames and a stop function. Each of these frames contains different text and an image. There is a completed demo in which the button causes the text and image to change and this loops back round at the end.

The AS in the file looks like this:

trace("movie starts"+this.dances_mc.totalFrames);

var index_num:Number= 1;
var numFrames:int = this.dances_mc.totalFrames;

// Your code goes here

stop();

I need to write an Event Handler that displays the next dance each time the button is pressed. Then improve the Event Handler so that once the last dance is displayed, pressing the button will display the first dance again.

Thanks in advance !!

  • 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-09T19:59:50+00:00Added an answer on June 9, 2026 at 7:59 pm

    The line in question is telling you how many frames are in that movieClip, so you can know when to loop back to the first frame.

    In place of your //your code goes here:

    function nextDance(e:MouseEvent = null):void {
        index_num++;  //increment your current index when the button is clicked
        if(index_num > numFrames){  //if your index is higher than the total amount of frame, go back to the first one
            index_num = 1;
        }
        this.dances_mc.gotoAndStop(index_num); //go to the frame of the new current index;
    }
    
    yourButton.addEventListener(MouseEvent.CLICK,nextDance,false,0,true);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bit of a problem with my project for the university. I
I have a bit of a problem i am trying to sort out. I
I have a bit of a problem. I'm trying to add,remove and edit items
Hey I have a bit of a problem trying to locate my application in
I have bit of a strange problem. In have a MovieClip i resize, but
I have a bit of a problem when I'm trying to connect to my
I have a bit of strange problem on this page: http://www.bluprintliving.com/locations it seems that
I have a bit of a problem with my PHP code, I am assigning
i have a bit of logical problem here. I have a catalog of products
I have a bit of a problem with actionscript 3.0 dynamic movieclip placement. The

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.