What's the property that stores the file name in newImageRect?

So I’m using a listener to pass either a display object or a sprite object to a function that will handle it and I need a way for the function to determine exactly what the object is that it’s acting on.

In other words, say I have a bunch of enemies, all newImageRect objects, and each is a unique type of enemy with it’s own corresponding *.png. I had though that I could determine the enemy type by simply using something like “object.imageFile” but that doesn’t seem to exist.

This feels like an easy question but I haven’t been able to find the answer. Could someone help me out?

I guess I could just add a name attribute to all of my objects… [import]uid: 106115 topic_id: 31744 reply_id: 331744[/import]

Hi there,

No, I don’t think there’s a property of a display object to indicate the source file name. You should create your own property of the object to store the filen ame or an identifier that suits your needs.

Hope this helps.

  • Andrew [import]uid: 109711 topic_id: 31744 reply_id: 126745[/import]

Hi there,

No, I don’t think there’s a property of a display object to indicate the source file name. You should create your own property of the object to store the filen ame or an identifier that suits your needs.

Hope this helps.

  • Andrew [import]uid: 109711 topic_id: 31744 reply_id: 126745[/import]