Since the load method is asynchronous, it relies on a completion (or any other of the supported events).
You can't block on a load call. --- In [email protected], "Jim Hayes" <[EMAIL PROTECTED]> wrote: > > Not as far as I know, if anyone can tell me one then I'd love to know > also! > > -----Original Message----- > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of Giro > Sent: 01 April 2008 11:05 > To: [email protected] > Subject: RE: [flexcoders] [AIR] Load image return null > > > And don't exists a solution to load an image that I need a complete > event? > > Thk. > Giro. > > -----Mensaje original----- > De: [email protected] <mailto:flexcoders%40yahoogroups.com> > [mailto:[email protected] <mailto:flexcoders% 40yahoogroups.com> > ] En nombre > de Jim Hayes > Enviado el: martes, 01 de abril de 2008 11:55 > Para: [email protected] <mailto:flexcoders% 40yahoogroups.com> > Asunto: RE: [flexcoders] [AIR] Load image return null > > the bitmapdata in loader wll only be valid when the loaders > contentLoaderInfo Complete event fires. > > So add a listener for it and only then access the data. > > > > loader.contentLoaderInfo.addEventListener (Event.COMPLETE,loaderCompleteH > andl > er); > > This one got me also :( > > See http://ifeedme.com/blog/?p=5 <http://ifeedme.com/blog/?p=5> > > -----Original Message----- > From: [email protected] <mailto:flexcoders% 40yahoogroups.com> > [mailto:[email protected] <mailto:flexcoders% 40yahoogroups.com> > ] On > Behalf Of Giro > Sent: 01 April 2008 10:28 > To: [email protected] <mailto:flexcoders% 40yahoogroups.com> > Subject: [flexcoders] [AIR] Load image return null > > Because this piece of code, that user AlivePDF make error and say that > image > variable is null. > > var fileimg:File = File.desktopDirectory.resolvePath ("images/1.jpg"); > var filestream:FileStream=new FileStream(); > filestream.open(fileimg,"read"); > var bytesRead:ByteArray=new ByteArray(); > filestream.readBytes(bytesRead,0,filestream.bytesAvailable); > var loader:Loader=new Loader(); > loader.loadBytes(bytesRead); > var image:Bitmap = Bitmap(loader.content); > myPDF.addImage(image, 1 , "Normal", null , false, ImageFormat.JPG, 100, > 0, > 0, 0, 0); > > > Thank. > Giro. > > > __________________________________________________________ > This communication is from Primal Pictures Ltd., a company registered in > England and Wales with registration No. 02622298 and registered office: > 4th > Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, > UK. > VAT registration No. 648874577. > > This e-mail is confidential and may be privileged. It may be read, > copied > and used only by the intended recipient. If you have received it in > error, > please contact the sender immediately by return e-mail or by telephoning > +44(0)20 7637 1010. Please then delete the e-mail and do not disclose > its > contents to any person. > This email has been scanned for Primal Pictures by the MessageLabs Email > Security System. > __________________________________________________________ > > ------------------------------------ > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > <http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt> > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo > <http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo> ! Groups > Links > > > ______________________________________________________________________ > This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration No. 648874577. > > This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not disclose its contents to any person. > This email has been scanned for Primal Pictures by the MessageLabs Email Security System. > ______________________________________________________________________ >

