Wednesday, 15 February 2012

actionscript 3 - Create new specified folder with AS3 and AIR -



actionscript 3 - Create new specified folder with AS3 and AIR -

i relatively new air world , need help (on windows 7 operating system). tried searching help, dumbfounded do. knowledge of actionscript 3 fundamental , new working adobe air. maintain thread short , not go great detail rest of application.

any help appreciated, lost.

steps:

the user runs adobe air application. (and open, buttons don't work yet)

user clicks "save as" button , prompted window take desired directory.

after take directory directory path stored in string variable.

then user clicks "ok" button. grab path directory variable , create new folder. folder have name variable string.

here sample code selecting directory

protected function browsebtn_clickhandler(event:mouseevent):void { var browsefile:file = fileutils.documentsdirectory(); browsefile.addeventlistener(event.select, fileselected); browsefile.browsefordirectory("select local folder"); function fileselected(e:event):void { browsefile.removeeventlistener(event.select, fileselected); if(localdirpath.text != browsefile.nativepath){ localdirpath.text = browsefile.nativepath; changed=true; } } }

this sample, localdirpath textinput display selected path, changed flag, utilize file class in air desktop.check documentation file class reference check methods contain "browse" browseforopen, browseforsave, createdirectory

actionscript-3 air directory-structure

No comments:

Post a Comment