Thanks malmansari,Mohamad and Mani for your sugeestion. Finally I got a good
solution from [email protected]
Solution follows . It reduced time drastically ( from 45 seconds to 7
seconds)

You can try compressing the xml file first and decompressing it when loaded
- I've used this to good effect and see something like a 10x reduction in
the filesize -
This blog covers the technique
http://www.ghostwir e.com/blog/ archives/ as3-saving-
xml-as-binary/<http://www.ghostwire.com/blog/archives/as3-saving-xml-as-binary/>

Regards
Kiran

On Wed, Dec 9, 2009 at 7:40 AM, mman <[email protected]> wrote:

> Hi Kiran,
> have you tried to use flash.net.FileReference?
>
> in init function, attach a listener to the FileReference object for
> the DataEvent.UPLOAD_COMPLETE_DATA event and in your handler use
> event.data, sth like following:
>
> public function init():void {
>  fr = new FileReference();
>  fr.addEventListener(Event.SELECT, selectHandler);
>  fr.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA,
> uploadCompleteHandler);
> }
>
> private function uploadCompleteHandler( event:DataEvent ) :void {
>  testId = XML( event.data );
> }
>
> hth
> mman
>
> On Dec 8, 9:35 pm, Kiran Kumar Vasireddy <[email protected]> wrote:
> > Dear All,
> >
> > I have a 2 MB XML file locally and if I try to import that file using
> >
> > <mx:XML id="testId" source="StudentData.xml"/>
> >
> > It is loading all the data at compile time  ( In fact flex builder is
> > throwing memory exception)
> >
> > I loaded the same file using HTTPService and It is taking significant
> amount
> > of time to load the data in production environment .
> >
> > Could some body suggest a better way to load this? ( I don't have an
> option
> > of loading this to database and reading it from there)
> >
> > Regards
> > Kiran
>
> --
>
> 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