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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:21:07+00:00 2026-06-05T16:21:07+00:00

I have a class that gets a movieClip and then using addChild adds it

  • 0

I have a class that gets a movieClip and then using addChild adds it to be displayed. Problem is that I cannot play or stop it at all. Basically I can’t interact with the movieClip.

Here is the code:

public function Avatar(movieClip:DisplayObject) //class constructor
{   ...
    avatarSprite = MovieClip(movieClip)
    addChild(avatarSprite);
    avatarSprite.gotoAndStop(1); //this is not working
    trace(avatarSprite.currentFrame) //always returns 1
    trace(avatarSprite.isPlaying) // returns false
    ...
    }

When I run the code the movieClip plays in a loop and doesn’t stop as I expect it to. I am not sure what’s the problem. As you can see I didn’t do anything too complicated. Any idea what I am missing here please?

Thanks in advance

EDIT: As miguelSantirso pointed out. The problem is with the nested animations in the movieClip and not the actual code itself. Does anyone know how to stop nested animations from playing?

  • 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-05T16:21:09+00:00Added an answer on June 5, 2026 at 4:21 pm

    This function will stop all nested movieClips (or play them if you pass false to the useStop parameter)

    function recursiveStop(parentClip:DisplayObjectContainer, useStop:Boolean = true, gotoFrame:Object = null):void {
        var tmpClip:MovieClip = parentClip as MovieClip;
        if (tmpClip) {
            if (useStop) {
                (gotoFrame != null) ? tmpClip.gotoAndStop(gotoFrame) : tmpClip.stop();
            }else {
                (gotoFrame != null) ? tmpClip.gotoAndPlay(gotoFrame) : tmpClip.play();
            }
        }
    
        var i:int = parentClip.numChildren;
        while(i--){
            if(parentClip.getChildAt(i) is DisplayObjectContainer){
                recursiveStop(parentClip.getChildAt(i) as DisplayObjectContainer, useStop, gotoFrame);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a class that gets items from a database and then places
This is a two part question. I have a class that gets all processes
I have a C# class that gets generated using the wsdl.exe tool that looks
I have a a Java class that gets a form definition from database then
I have a service class UserService that gets an instance of IDocumentStore injected using
I have a class that occasionally gets passed null for File objects. During normal
I know that Reflection can be expensive. I have a class that gets/sets to
i have a IcyStreamMeta.class that gets the metadata info of shoutcast Stream i use
I have a class that gets arranged into a hierarchy, such as this: class
I have a class method that gets called by a view controller. I want

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.