6 Replies Latest reply on Jun 15, 2009 11:43 AM by benz03

    Changes in id/name handling!?

    benz03 Level 1

      On my search to find a good way to compensate the lack of event triggers with the new Animate effects I encoutered a strange problem. A really basic one

      So I have an empty application with a button like this (simplyfied):

      <s:Application>
      <s:Button id="myButton" click="trace(event.target)" />
      </s:Application>


      When i click the Button I would expect it to trace something like
      app.ApplicationSkin2.Group3.myButton
      but instead i get
      EventSanityCheck0.ApplicationSkin2.Group3.Button4

      just some auto generated Button4 identifier!?
      Seems like my identifier is lost somehow. It turns out that if I set the name property of my Button like so:
      <s:Button name="myButton" click="trace(event.target)" /> it actually gives me the correct name in the trace.

      This is not really what one would expect or? It certainly was different in Flex 3 and I don`t think it makes sense. The identifier should be the identifier or?

      What is the difference between name and id anyway? In Flex3 it made sense but now it`s treated in a different way I think?
      From the manual:
      name = Indicates the instance name of the DisplayObject.
      id = ID of the component. This value becomes the instance name of the object

      I get the feeling I`m asking something really dumb here - just need to do a sanity check
      BTW I have much more probems with events and objects in a group but first need to sort this out
      Thanks for any clarifications on these changes.

      Benz