1 Reply Latest reply on Jul 12, 2010 12:30 PM by DTshults

    Getting Object Data at Runtime

    DTshults Level 1

      Hello!

       

      I have an AS file that declares and sets data for a bunch of objects.  Specifically, they are locations for a business, as well as phone numbers, addresses, etc, associated with each location.  Ultimately, they will appear as pins on a map, and clicking a pin will reveal information like phone number, etc.

       

      I need to come up with a way for a separate SWF file to draw in the data from the AS file so it can be implemented on the map.  The trouble is that the AS file will be frequently updated, and it will not always contain the same number of objects.

       

      So basically, at runtime, the swf needs to reference the AS file, and generate a pin on the map for each object within the AS file.

       

      I've already set up my SWF to "#include" the AS file, and I can successfully use the data within using dot notation, but I don't know how to set it up to automatically go through the AS file and process each object, especially since the total number of objects is subject to change!

       

      Any ideas woulf be very much appreciated!  Thanks.

        • 1. Re: Getting Object Data at Runtime
          DTshults Level 1

          Update-

           

          I've created a "locationsGroup" class which contains an array.  I am assigning each object in the swf to the array, sequentially, so that I should be able to just run through the array and perform my necessary functions, hopefully with just a nice elegant "for loop".  If you guys have any better ideas please let me know, but this shoudl work, I hope.