0 Replies Latest reply on Nov 8, 2006 6:18 AM by FlextasmicD

    How Does On Reference An Array Of Objects?

    FlextasmicD
      Howdy!

      Ive read through Flex 2's help and also through the wonderful book 'Developing Rich Clients With Flex' for topics relating to this question but very strangely with no luck (and I assume it's quite straight forward)! So hopefully you chaps can help...

      Now, to get a value from an object model is very straight forward -
      quote:


      <mx:Model id="MyModel">
      <Inbox>
      <Message>
      <Sender>some@email.com</sender>
      <Subject>Blah Blah</Subject>
      <Content>This is the content of the email!</Content>
      </Message>
      </Inbox>
      </mx:Model>


      To get the <Sender> value its a simple case of -
      quote:


      MyModel.Inbox.Message.Sender


      Because obviously 'Sender' is just an object. But when I have an array of objects like so -
      quote:


      <mx:Model id="MyModel">
      <Inbox>
      <Message>
      <Sender>some@email.com</sender>
      <Subject>Blah Blah</Subject>
      <Content>This is the content of the email!</Content>
      </Message>
      <Message>
      <Sender>some@email.com</sender>
      <Subject>Blah Blah</Subject>
      <Content>This is the content of the email!</Content>
      </Message>
      </Inbox>
      </mx:Model>


      How do I reference the individual 'Sender' objects?

      Any help would really perk up my day :-)

      Thanks