Alex, Thanks. Yes I have seen that, but there is noting similar for what I want, that is to read the flv content to get its tags according to FLV spec from http://www.adobe.com/devnet/flv/.
Pete, that is a good starting point, thank you. However, I need more help to be able to "read" the data from the FLV. readByte() returns an int and readBytes expects at least one parameter of type ByteArray which I have no clue what to put in there. And readObject(0 throws an ouf of bounds error. Gilbert --- In [email protected], Peter Farland <pfarl...@...> wrote: > > You may want to have loader as a member variable so that you can access it in > other contexts or make subsequent requests without using init() > > private var loader:URLLoader; > > > Also, you should set the loader.dataFormat to URLLoaderDataFormat.BINARY > before loading binary data. See: > http://livedocs.adobe.com/flex/3/langref/flash/net/URLLoader.html#dataFormat > > Finally, in the complete event, you can cast loader.data to a ByteArray: > > private function onComplete(e:Event):void > { > var byteArr:ByteArray = loader.data as ByteArray; > // ... > } > > Pete > > -----Original Message----- > From: [email protected] [mailto:[email protected]] On > Behalf Of gilbert_mizrahi > Sent: Wednesday, March 18, 2009 11:22 AM > To: [email protected] > Subject: [flexcoders] Where I can examples of how to use ByteArray > > I have searched everywhere and I can't find useful examples of how to use the > ByteArray class and the Flex 3 documentation does not include much. > > I want to read and FLV file with ByteArray, but I don't know how. > > I tried: > > private function init():void > { > var request:URLRequest = new URLRequest("assets/street.flv"); > var loader:URLLoader = new URLLoader(); > try { > loader.load(request); > } catch (error:ArgumentError) { > trace("An ArgumentError has occurred."); > } catch (error:SecurityError) { > trace("A SecurityError has occurred."); > } > loader.addEventListener(Event.COMPLETE, onComplete); > } > > private function onComplete(e:Event):void > { > var byteArr:ByteArray = new ByteArray (); > byteArr.readByte(); //???? > trace("byteArr "+byteArr); > } > > the ByteArray readByte method accept 0 parameters, so what should I do? > > > > ------------------------------------ > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Alternative FAQ location: > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links >

