5 Replies Latest reply on Dec 13, 2007 2:55 PM by mcadle

    addChild() to a canvas get object name?

    mcadle Level 1
      So once you add an object to a canvas via drag drop and the addChild() method, how do you get that objects flex assigned name? When you move it, you can call event.dragInitiator.name and it will tell you the childs name. I need that name the moment the user drops it. Here is the code that I have:

      var items:Array = event.dragSource.dataForFormat("items") as Array;
      var img:Image = new Image()
      // What is this childs name now? OR After it has been dropped, how do you get its source from img.source?

      So as I said in the comment, if you can't get the childs name, after the drop, can you get the childs original source, i.e. the actual path - images/photo.jpg?