A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 22 of 22

Thread: [pre-alpha]test

  1. #21
    Flash Incompetent ChaseNYC's Avatar
    Join Date
    Jun 2002
    Location
    new york city
    Posts
    693
    Nice, I have to go soon but I've been toying with it some, figured out a way to make the bonus appear in different places for the three levels. by inserting
    Code:
    this.levels=[
    {type:"Game",number:1, bonusx:200},
    and then later on putting:
    Code:
    this.game.bonus._x=level.bonusx;
    so this.levels is or is NOT one of the objects we have been talking about above? You called it an array in comments and it looks different than the code above but seems to be able to work in the same way as an object if I'm not mistaken. Anyways thanks a lot... going to have a lot of fun fooling around with this. I can very quickly see how this would be of great use to me.

    ChaseNYC
    mmm signature

  2. #22
    crossconscious
    Join Date
    Sep 2005
    Location
    Belgium
    Posts
    1,188
    level's isn't of type Object, it's an array. But each element in the array is an Object.
    So levels[0] is an Object, levels[1] is an object, etc.
    Basically, stuff between [ and ] makes an array. Stuff between [ and ] with name:value pairs makes an Object.
    Code:
    var someArray:Array=[ // an array containing
    	{x:1,y:10}, // an Object
    	{x:10,y:5} // and another Object
    ];

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