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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:31:54+00:00 2026-05-19T00:31:54+00:00

It is possible to dynamic change the name of the vars is AS3 using

  • 0

It is possible to dynamic change the name of the vars is AS3 using flash? I mean, create for example 10 vars with one root name like: myvar and then incrementing a number, like myvar0, myvar1, myvar2 and so on.

I while ago i achived this in AS2 with this code:

for (i = 0; i < 5; i++)
{
    var mc = _root.attachMovie("my_square", "my_square_"+i, i);
    mc._x = i * 50;
}

But now im in AS3 and the var a need to copy is this:

var caja1:HTMLTextBlock = new HTMLTextBlock();

How can in generates in a FOR, caja1, caja2, caja3 and sp.

Thanks for any help!

  • 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-19T00:31:54+00:00Added an answer on May 19, 2026 at 12:31 am

    I think a very simple and clean way of achieving this is creating an array.

    var caja:Array = new Array();
    
    for (i = 0; i < 5; i++)
    {
        caja[i] = new HTMLTextBlock();
    }
    

    Just remember that the first entry in the array starts with 0 and not 1 (i.e. caja[0]).

    Hope this helps 🙂

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

Sidebar

Related Questions

is it possible to extract dynamic loaded text from a swf (flash application) programatically
Is it possible to create a dynamic xml file which changes in some fields
can i create a view at design time, using dynamic objects? (with visual studio
Is it possible to add dynamic colors to a TextBlock ..i.e. have one character
Possible Duplicate: Javascript Regexp dynamic generation? I am trying to create a new RegExp
Is it possible to make the schema name dynamic in a BIRT query. I
Possible Duplicate: Representing dynamic typing in C A professor at my History of Computation
I am wondering whether it is possible to make dynamic variables in Java. In
Is it possible to hide a dynamic query from the result sets provided from
is it possible to perform a dynamic role assignment based on a quiz result

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.