Hi Baskaran,

You can use FileReference for that.

With FP 9 you could only upload/download file but with FP 10 you can now
load the file content and do the parsing stuff on client side.

Sample code for reference is here:

---

fileReference = new FileReference();
                fileReference.addEventListener(Event.SELECT, onFileSelect);
                fileReference.addEventListener(Event.CANCEL,onCancel);
                fileReference.browse(FILE_TYPES);

private function onFileSelect(e:Event):void
            {
                fileReference.addEventListener(Event.COMPLETE,
onLoadComplete);
                fileReference.addEventListener(IOErrorEvent.IO_ERROR,
onLoadError);
                fileReference.load();
            }

private function onLoadComplete(e:Event):void
            {
                var datas:ByteArray = fileReference.data;
                var content:String =
datas.readUTFBytes(datas.bytesAvailable);
                parseFile(content);
                fileReference = null;
            }
---------

@Edwin, there can be multiple scenario like pasring the file, loading data,
allowing user the selection on that data..etc.etc.

HTH
-Jai
http://jaibeermalik.wordpress.com


On Wed, Dec 2, 2009 at 9:27 PM, <[email protected]> wrote:

> Why would you load a text file from a disc?
> Can anyone answer what scenario this would be for?
>
> Thanks
>
>
> On Wed, Dec 2, 2009 at 9:55 AM, baskaran rajendran 
> <[email protected]>wrote:
>
>>
>> hi,
>>
>>     I want to load text file from disc and load into textarea in mxml
>> --
>> Best Regards
>> Baskaran.R
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Flex India Community" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<flex_india%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/flex_india?hl=en.
>>
>
>
>
> --
> Ed Melendez
> Print/Web/Media
>
> 646.246.4368
> [email protected]
> http://jobcircle.com/resumes/edwin_melendez.html
>
> --
> You received this message because you are subscribed to the Google Groups
> "Flex India Community" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<flex_india%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/flex_india?hl=en.
>

--

You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.


Reply via email to