Royale : Undefined FileReaer & Blob

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Royale : Undefined FileReaer & Blob

prashakumar@gmail.com
Hi,

I am trying to  Image preview with Royale  and used  Royale FileAPI but gettign following error. Please suggest.
 var fileReader:FileReader = new FileReader();
 fileReader.addEventListener("onload",onFileLoad);
 fileReader.readAsDataURL((fileProxy.model as FileModel).blob as Blob);


Error: Type was not found or was not a compile-time constant: FileReader.

                var fileReader:FileReader = new FileReader();
                               ^
d:\ApacheFlex\workspace\FileUpload\src\FileUpload.mxml(34): col: 49 Error: Call to a possibly undefined method FileReader.

                var fileReader:FileReader = new FileReader();
                                                ^
d:\ApacheFlex\workspace\FileUpload\src\FileUpload.mxml(36): col: 81 Error: Access of possibly undefined property Blob.
                fileReader.readAsDataURL((fileProxy.model as FileModel).blob as Blob);

Thanks,
Prashant Kumar

Reply | Threaded
Open this post in threaded view
|

Re: Royale : Undefined FileReaer & Blob

Gabe Harbs
It sounds like you’re missing the js.swc references.

> On Nov 27, 2017, at 5:04 PM, [hidden email] wrote:
>
> Hi,
>
> I am trying to  Image preview with Royale  and used  Royale FileAPI but gettign following error. Please suggest.
> var fileReader:FileReader = new FileReader();
> fileReader.addEventListener("onload",onFileLoad);
> fileReader.readAsDataURL((fileProxy.model as FileModel).blob as Blob);
>
>
> Error: Type was not found or was not a compile-time constant: FileReader.
>
>                var fileReader:FileReader = new FileReader();
>                               ^
> d:\ApacheFlex\workspace\FileUpload\src\FileUpload.mxml(34): col: 49 Error: Call to a possibly undefined method FileReader.
>
>                var fileReader:FileReader = new FileReader();
>                                                ^
> d:\ApacheFlex\workspace\FileUpload\src\FileUpload.mxml(36): col: 81 Error: Access of possibly undefined property Blob.
>                fileReader.readAsDataURL((fileProxy.model as FileModel).blob as Blob);
>
> Thanks,
> Prashant Kumar
>

Reply | Threaded
Open this post in threaded view
|

Re: Royale : Undefined FileReaer & Blob

prashakumar@gmail.com
I m getting intelligence under VCode but import statement not added. 

On 27-Nov-2017 9:02 PM, "Harbs" <[hidden email]> wrote:
It sounds like you’re missing the js.swc references.

> On Nov 27, 2017, at 5:04 PM, [hidden email] wrote:
>
> Hi,
>
> I am trying to  Image preview with Royale  and used  Royale FileAPI but gettign following error. Please suggest.
> var fileReader:FileReader = new FileReader();
> fileReader.addEventListener("onload",onFileLoad);
> fileReader.readAsDataURL((fileProxy.model as FileModel).blob as Blob);
>
>
> Error: Type was not found or was not a compile-time constant: FileReader.
>
>                var fileReader:FileReader = new FileReader();
>                               ^
> d:\ApacheFlex\workspace\FileUpload\src\FileUpload.mxml(34): col: 49 Error: Call to a possibly undefined method FileReader.
>
>                var fileReader:FileReader = new FileReader();
>                                                ^
> d:\ApacheFlex\workspace\FileUpload\src\FileUpload.mxml(36): col: 81 Error: Access of possibly undefined property Blob.
>                fileReader.readAsDataURL((fileProxy.model as FileModel).blob as Blob);
>
> Thanks,
> Prashant Kumar
>

Reply | Threaded
Open this post in threaded view
|

Re: Royale : Undefined FileReaer & Blob

prashakumar@gmail.com


On 2017-11-27 21:12, Prashant Kumar <[hidden email]> wrote:

> I m getting intelligence under VCode but import statement not added.
>
> On 27-Nov-2017 9:02 PM, "Harbs" <[hidden email]> wrote:
>
> > It sounds like you’re missing the js.swc references.
> >
> > > On Nov 27, 2017, at 5:04 PM, [hidden email] wrote:
> > >
> > > Hi,
> > >
> > > I am trying to  Image preview with Royale  and used  Royale FileAPI but
> > gettign following error. Please suggest.
> > > var fileReader:FileReader = new FileReader();
> > > fileReader.addEventListener("onload",onFileLoad);
> > > fileReader.readAsDataURL((fileProxy.model as FileModel).blob as Blob);
> > >
> > >
> > > Error: Type was not found or was not a compile-time constant: FileReader.
> > >
> > >                var fileReader:FileReader = new FileReader();
> > >                               ^
> > > d:\ApacheFlex\workspace\FileUpload\src\FileUpload.mxml(34): col: 49
> > Error: Call to a possibly undefined method FileReader.
> > >
> > >                var fileReader:FileReader = new FileReader();
> > >                                                ^
> > > d:\ApacheFlex\workspace\FileUpload\src\FileUpload.mxml(36): col: 81
> > Error: Access of possibly undefined property Blob.
> > >                fileReader.readAsDataURL((fileProxy.model as
> > FileModel).blob as Blob);
> > >
> > > Thanks,
> > > Prashant Kumar
> > >
> >
> >
> I added  js.swc under the external-library-path and  it compiled successfully.  First  time i used files API in Royale and create Image Preview Demo application.