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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:20:13+00:00 2026-06-05T04:20:13+00:00

my goal is to have multiple (animated) objects loaded in my stage as a

  • 0

my goal is to have multiple (animated) objects loaded in my stage as a movieclip trought an Array.

My current code:

var vijand:Array;

vijand = new Array  ;
vijand.push(new Vijand(-580,-200));
vijand.push(new Vijand(-500,-200));
vijand.push(new Vijand(-420,-200));
for (var n:int = 0; n < vijand.length; n++)
{
    this.addChild(vijand[n]);

}
    //not working part. They do load on my stage. But I cant control the animation within the file(its a .SWF file I load)

    for (var n:int = 0; n < vijand; n++){
   gotoAndStop(1)
       }

So basically my question is how can I get all these doing the animation with “gotoAndStop(1)” and or “gotoAndStop(2)”, so on and so on.

EDIT: the external file to load it, in Code

public function Vijand(positieX:int, positieY:int)
    {
        vijand = new Loader();
        vijand.load(new URLRequest("resources/vijand.swf"))
        this.addChild(vijand);
        vijand.x = positieX;
        vijand.y = positieY;



    }
  • 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-05T04:20:15+00:00Added an answer on June 5, 2026 at 4:20 am

    Is that what you need?

    var vijand:Array;
    
    vijand = new Array  ;
    vijand.push(new Vijand(-580,-200));
    vijand.push(new Vijand(-500,-200));
    vijand.push(new Vijand(-420,-200));
    for (var n:int = 0; n < vijand.length; n++)
    {
        this.addChild(vijand[n]);
        MovieClip(vijand[n]).gotoAndStop(1); //or gotoAndPlay(1) - depending on your needs
    
    }
    

    EDIT

    Loaded SWF is a MovieClip. You need to access loader’s content. I am not sure how to call the variable as in your code you use vijand for an Array and for a Loader.

    Sample code:

    var myMovieClip:MovieClip;
    var loader:Loader = new Loader();
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded);
    loader.load(new URLRequest("resources/vijand.swf"));
    
    function onLoaded(e:Event):void
    {
        myMovieClip = MovieClip(loader.content);
        myMovieClip.gotoAndStop(1);
        //you can add this MovieClip to the array and so on...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My goal is to have an AsyncTask that can execute multiple times (one task
I have a project here the goal is to merge multiple Access DB's into
I have a maven pom.xml file with multiple instances of a same goal defined
The goal is to have an array where all strings are of length n.
My goal is to have multiple mp4's stores in different folders on a server.
Goal : I have a view which displays multiple nodes in full view including
goal: I have the string 1234432144 I want to only replace the first 2
Let me first describe my goal: I have created an object with 3 properties:
My goal is to have the url routing as following: http://www.abc.com/this-is-peter-page http://www.abc.com/this-is-john-page What is
My goal is to have a jQuery datepicker pop up when the user clicks

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.