If order is important to you, then you can use a numeric array.
However if you are insistant about using alphanumeric arrays and want them to be ordered as Sound1 ,Sound2 and Sound3, then the way for that would be
function(...)-- temp is an array that already has the files added into it and have the convention SoundX.mp3, where X is a number from 1 to 9999for i=1,3do-- or you can use the #temp (for all items)print(i .. " = " .. temp["Sound" .. i])endend
However I would simply use a numeric array as it is faster AND I can still access sounds[1], sounds[2] and sounds[3] rather than sounds["sound1"], sounds["sound2"] and sounds["sound3"]
Comments
http://www.nightspade.com
However if you are insistant about using alphanumeric arrays and want them to be ordered as Sound1 ,Sound2 and Sound3, then the way for that would be
hope that helps you in some ways
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps