Get image path from image object

Just a quick newbie question; is there any way to access the path that a display object image refers too?  I don’t need to change it; just read it.

Also, I noticed that when I try to print out imageObj.path, I get a userdata value.  Is there some other useful info in there that I should be aware of?

When you create the image, store the file name in the object:

local obj = display.newImageRect(“hello.png”, 100, 100)

obj.fileName = “hello.png”

obj.directory = system.ResourceDirectory

.directory will still be userdata, if you need to know the name of it:

obj.directoryName = “resources”

Rob

When you create the image, store the file name in the object:

local obj = display.newImageRect(“hello.png”, 100, 100)

obj.fileName = “hello.png”

obj.directory = system.ResourceDirectory

.directory will still be userdata, if you need to know the name of it:

obj.directoryName = “resources”

Rob