Hi Larry,
As you know, I am a complete beginner with Flex, but what I've seen of your book so far has been very helpful. But I am keen to try something probably before I've gone far enough into the book, and it is more AIR focused than web focused, but maybe you or someone can help me.
All I'm trying to do so far is to enable the user to select a directory from the PC file system that the app is running on. In Flash Builder, I have the following:
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="
library://ns.adobe.com/flex/spark"
xmlns:mx="
library://ns.adobe.com/flex/mx">
<fx:Script>
<![CDATA[
var file:File = new File();
file.addEventListener(Event.SELECT, dirSelected);
file.browseForDirectory(
"Select a Directory");
function dirSelected(e:Event):void {
trace(file.nativePath);
}
]]>
</fx:Script>
</s:WindowedApplication>
Flash Builder is giving me several errors which I don't understand:
On the addEventListerner line of code two errors are showing - 'access of undefined property dirSelected' and 'access of undefined property file'
For the following line (file.browserForDirectory) the error that shows is 'access of undefined property file'.
Any help will be appreciated, and thanks in anticipation.
Cheers, Necuima