Created
June 27, 2011 20:35
-
-
Save jonalter/1049763 to your computer and use it in GitHub Desktop.
List files in the resourcesDirectory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var win = Ti.UI.createWindow({ | |
| backgroundColor: '#fff', | |
| layout: 'vertical' | |
| }); | |
| var testButton = Ti.UI.createButton({ | |
| title: "list files", | |
| top: 20, | |
| height: 50, | |
| width: 250, | |
| }); | |
| testButton.addEventListener('click', function(e){ | |
| var dir = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory); | |
| var files = dir.getDirectoryListing(); | |
| Ti.API.info('ALL FILES '+files); | |
| var qty = files.length; | |
| i=0; | |
| while (i < qty) | |
| { | |
| Ti.API.info('ROW '+files[i]); | |
| i++; | |
| } | |
| }); | |
| win.add(testButton); | |
| win.open(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment