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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T21:44:22+00:00 2026-05-19T21:44:22+00:00

I had a hard time trying to word my question properly, so i’m sorry

  • 0

I had a hard time trying to word my question properly, so i’m sorry if it seems confusing. Also i’m using the flixel library in flash builder. It may not be that important butcause probably anyone that knows a little more than me or even a little AS3 could probably see what i’m doing wrong.

Anyway, what i’m trying to do is basically create 10 instances of this square object I made. all I have to do is pass it an x an y coordinate to place it and it works. so ive tested if i just do:

var testsquare:Bgsq;
testsquare = new Bgsq(0,0);
add(testsquare);

it works fine and adds a square at 0,0 just like i told it to, but i want to add 10 of them then move the next one that’s created 25 px to the right (because each square is 25px)

my problem is that I only ever see 1 square, like it’s only making 1 instance of it still.

anyone possibly have an idea what I could be doing wrong?

var counter:int = 0;
var bgsqa:Array = new Array;

for (var ibgs:int = 0; ibgs < 10; ibgs++)
    {
    bgsqa[counter] = new Bgsq(0,0);
    bgsqa[counter].x += 25;
    add(bgsqa[counter]);
    counter++;
    }
  • 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-19T21:44:22+00:00Added an answer on May 19, 2026 at 9:44 pm

    There’s a lot you’re doing wrong here.

    First off, you’re using a pseudo-iterator (counter) to access array elements through a loop instead of, well, using the iterator (ibgs).

    Second, I don’t see anything in the array (bgsqa) you’re iterating through. It’s no wonder you’re having problems. Here’s what you should do.

    var bgsqa:Array = [];
    for(var i:int=0;i<10;i++)
    {
        var bgsq:Bgsq = new Bgsq(i * 25, 0);
        add(bgsq);
        bgsqa.push(bgsq);
    }
    

    That should probably do it if your post is accurate.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the jQuery plugin for TinyMCE and have had a hard time trying
I've had a hard time finding anything like what I'm trying to accomplish, seems
(Sorry if this is a repeat question, I had a hard time thinking of
If this was previously talked about, I'm sorry, I had a hard time searching
I had a hard time framing that question. I hope it gets the gist
I had a hard time coming up with a title for this question, but
I had a hard time trying to find out why my assignments where lost,
I've had a hard time trying to find good examples of how to manage
Please forgive the bad title - I had a hard time trying to think
I've had a hard time sitting in front of UML and getting value out

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.