Way to reference .lua file name?

Is there a way in lua (or with the Corona SDK) to reference the name of the file the code in question resides in?

I’d like to be able to keep track of file names programatically so that I can use a function to remove storyboard API scenes rather than having to manually set up many different files. For instance I’m hoping I can develop a system that sets a meta table with the current scene’s file name, transitions to a new scene, references the meta table and then removes the previous scene.

Please let me know if anyone has any thoughts whether this is possible!

Thanks in advance :slight_smile: [import]uid: 105707 topic_id: 31723 reply_id: 331723[/import]

OK, looks like I’ve solved my own problem… too easy… funny how a night’s sleep can help :slight_smile:

I’ll use the storyboard.getCurrentSceneName() function to store the current scene name in an external module. Then I can reference that module in the next scene and use it to remove the last scene.

http://developer.coronalabs.com/reference/index/storyboardgetcurrentscenename

Although now that I’m looking at it all again I guess I can just use the storyboard.purgeAll() function? Gosh, lots of solutions, not sure why I was tunneling down and not seeing these clear options last night… [import]uid: 105707 topic_id: 31723 reply_id: 126718[/import]

OK, looks like I’ve solved my own problem… too easy… funny how a night’s sleep can help :slight_smile:

I’ll use the storyboard.getCurrentSceneName() function to store the current scene name in an external module. Then I can reference that module in the next scene and use it to remove the last scene.

http://developer.coronalabs.com/reference/index/storyboardgetcurrentscenename

Although now that I’m looking at it all again I guess I can just use the storyboard.purgeAll() function? Gosh, lots of solutions, not sure why I was tunneling down and not seeing these clear options last night… [import]uid: 105707 topic_id: 31723 reply_id: 126718[/import]