5 Replies - 2521 Views - Last Post: 29 October 2009 - 06:26 PM

#1 cosmicappuccino  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 25
  • Joined: 23-December 08

Can I make an array of dynamic textboxes?

Posted 16 May 2009 - 07:16 AM

Hi,

Is it possible to make an array of dynamic textboxes such that I can refer to them as txtBox[0], txtBox[1] etc.? If so, how would I go about doing that?
(Flash CS3)

Thanks a lot!
Is This A Good Question/Topic? 0
  • +

Replies To: Can I make an array of dynamic textboxes?

#2 William_Wilson  Icon User is offline

  • lost in compilation
  • member icon

Reputation: 199
  • View blog
  • Posts: 4,807
  • Joined: 23-December 05

Re: Can I make an array of dynamic textboxes?

Posted 16 May 2009 - 07:24 AM

Please do not post duplicate threads. I have removed the others.


I know it is possible, but someone else will need to explain it as I do not have experience with AS.
Was This Post Helpful? 0
  • +
  • -

#3 cosmicappuccino  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 25
  • Joined: 23-December 08

Re: Can I make an array of dynamic textboxes?

Posted 16 May 2009 - 07:34 AM

Thanks, good to know it's possible. I'd appreciate if anyone would explain how to do it, please!

Sorry about the duplicates - my browser crashed and I didn't realise I'd posted so many! Thanks for deleting them.
Was This Post Helpful? 0
  • +
  • -

#4 theRemix  Icon User is offline

  • D.I.C Regular

Reputation: 15
  • View blog
  • Posts: 439
  • Joined: 19-October 05

Re: Can I make an array of dynamic textboxes?

Posted 16 May 2009 - 12:39 PM

View Postcosmicappuccino, on 16 May, 2009 - 06:16 AM, said:

Hi,

Is it possible to make an array of dynamic textboxes such that I can refer to them as txtBox[0], txtBox[1] etc.? If so, how would I go about doing that?
(Flash CS3)

Thanks a lot!


i'm assuming your text boxes are on your stage already, give them instance variables.
for example

fname_ti
lname_ti
email_ti
password_ti
validate_password_ti

var txtBox:Array = new Array(fname_ti, lname_ti, email_ti, password_ti, validate_password_ti);


then you can access txtBox[0]; // will be fname_ti

you can pretty much store anything in arrays

hth
Was This Post Helpful? 1
  • +
  • -

#5 cosmicappuccino  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 25
  • Joined: 23-December 08

Re: Can I make an array of dynamic textboxes?

Posted 17 May 2009 - 02:04 AM

Thanks very much, that looks perfect -- I'll try that :)
Was This Post Helpful? 0
  • +
  • -

#6 aedesign53  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 29-October 09

Re: Can I make an array of dynamic textboxes?

Posted 29 October 2009 - 06:26 PM

View Postcosmicappuccino, on 16 May, 2009 - 06:16 AM, said:

Hi,

Is it possible to make an array of dynamic textboxes such that I can refer to them as txtBox[0], txtBox[1] etc.? If so, how would I go about doing that?
(Flash CS3)

Thanks a lot!

do you want to place information in dynamic textboxes from an array? if so here is how:
1. create an object and place in library
2. right click on the object name and select the linkage option then click on the export for Actionscript option
3. enter a class name in the class name field and click ok
4. double click on the object in the library so it opens
5. place you dynamic text in the object
6. in the properties area give the dynamic text box an instance name
7. on the main stage go to the action script and create the array for the information you want
8. to place the information in the array create a for loop and add you information to the text field
9. add to stage

the code should look some thing like this:
yourarray = new Array;
for (var i:Number=0;i<yourarray.length;i++){
// create instances of button_proto
objectname = new objectname();

//add track items here
objectname.textfieldinstancename.text = yourinformation;

addChild(myMC);
}
hope that helps
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1