A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] Trouble with creating textfields in a for loop

  1. #1
    Flash by name, Flash by nature
    Join Date
    May 2006
    Location
    Oslo, Norway
    Posts
    70

    [RESOLVED] Trouble with creating textfields in a for loop

    Hi.

    I'm making a calendar application, and for each month I want a for loop to dynamically add textfields with the date value of each day to the stage. But because of the new naming system, or rather the lack of the old, I don't know how to make each textfield unambiguosly referenceable.

    Whereas I would use the []-type of brackets in AS2 to give each textfield an unique name to reference, I can't find a solution to achieve the same in AS3.

    Does anyone sit on some info that may help me?

    Thanks in advance

    PS. Just let me know if I'm not making myself clear, I blame my not speaking english on a daily basis.

  2. #2
    Member
    Join Date
    May 2007
    Location
    Poland
    Posts
    65
    Use the TextField.name property - in AS3 you have to assign a name to the object by yourself.

    After you add the TextField to display list, you can reference it using getChildByName('the_name_you_gave')
    Last edited by ampo_webdesign; 05-31-2007 at 02:08 PM.

  3. #3
    Flash by name, Flash by nature
    Join Date
    May 2006
    Location
    Oslo, Norway
    Posts
    70
    Thanks a bunch, ampo!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center