20 Replies Latest reply on Oct 16, 2007 2:06 PM by Greg Dove

    Naming an Object dynamically

    tommyboy777
      I am developing an application where you can develop a beverage bar similar to what you would find in 7-11 or some other conveniance store. I am creating each machine as its own swf file and all the information about that machine is stored in the swf file in an Object. I want it so that the user can place as many machines on the counter as they want. After each machine is placed on the counter I need to keep track of what counter it is on and which position (left to right) it holds. I have globals variables that are keeping track of what coutner and what position numerically. When a machine is selected to go on the counter I want to create a new Object that is dynamically created using the counter number and the position number in its name.

      I tried: concantinating a name like --
      var "side"+sideNum+"Machine"+currentNum:Object = new Object()

      but the compiler didn't like that.

      I need some way to dynamically name the Object (or some kind of container) to hold all the information about the machine that is place on a certain counter in a certain order so I can reference it at a later date.

      Any thoughts?....I don't have time to learn XML so that's not an option.