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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:23:28+00:00 2026-05-31T10:23:28+00:00

Hopefully this should be a quick question. I’m having trouble accessing some movie clips

  • 0

Hopefully this should be a quick question. I’m having trouble accessing some movie clips in my library dynamically using an array.

Basically, my array holds a bunch of letters..

var monarray:Array =("AAACBCBCAABBC").split("");

Now, my library holds three movie clips. They have the following AS3 linkage:
monsterA
monsterB
monsterC

What I want to do is create a new instance of an object based on where I am in the array.. For example, when monarray is at index [0], I want monsterA to be added..

This is the code I am using to try and achieve this effect:

var b = new monster[monarray[i]];
b.x = mouseX;
b.y = mouseY;
addChild(b);
i ++;

However, upon compiling my .swf, I get this error:

Scene 1, Layer 'Layer 1', Frame 1, Line 9   1086: Syntax error: expecting semicolon before leftbracket.

I understand this is because I’m obviously not doing it right, but I’ve only ever used arrays to call up a specifically-indexed instance.

I’m sorry if this is noobish, but I’m not quite sure how I can dynamically choose between these three library instances on the go!

Thanks a lot in advance!

Harry.

  • 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-05-31T10:23:29+00:00Added an answer on May 31, 2026 at 10:23 am

    not sure try:

    var mst = getDefinitionByName("monster"+monarray[i]) as Class;
    var b = new mst;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hopefully this should be a quick and simple one, using PHP I'm trying to
This should hopefully be a simple one. When using a date time picker in
Hopefully this should be a fairly straightforward question, I just don't know enough about
Ok, this should be simple, but I'm having a fair amount of trouble with
This should hopefully be a quick one. I have a StringBuilder like so: StringBuilder
This should hopefully be a quick one, in a 2d array in C# which
Just a quick question about my Domain Layer/ Domain Service... Should I allow this
This should be an easy question hopefully but as a rookie I don't know
Hopefully this should be an easy question. In Java I think it's compareTo() .
Hopefully this should be a quick one to solve but - I'm building a

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.