A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Need syntax for defining an array of names

  1. #1
    Senior Member
    Join Date
    Feb 2003
    Location
    miami
    Posts
    540

    Need syntax for defining an array of names

    Hello,

    Can someone tell me the syntax for defining an array of names.

    I will put in the values myself, like myArray["pete.swf", "laura.swf".....]

    This array will be accessed later from a function in the same level.

    So something like

    _level0.myArray["pete.swf", "laura.swf"...]

    and then,

    name = _level0.myArray[i];

  2. #2
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    Code:
    var trumpton:Array = ['Pugh', 'Pugh', 'Barney McGrew', 'Cuthbert', 'Dibble', 'Grub'];
    
    for(var i:Number=0; i<trumpton.length; i++)
    {
        trace( trumpton[i] );
    }
    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  3. #3
    Senior Member
    Join Date
    Feb 2003
    Location
    miami
    Posts
    540
    Thank you very much. One quick question, what does trace do?

    Thanks again

  4. #4
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    it writes to the 'output' window in Flash.
    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

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