Skip navigation
Currently Being Moderated

Get ByteArray out of HTTPNetStream?

Aug 23, 2011 1:35 AM

Is it possible to send the bytes loaded in HTTPNetStream to a MXML ?

For example, add a custom event (contains the bytes) in attemptAppendBytes, and addEventListener in MXML?

I'm hoping to share the ByteArray with another P2P peer.

 

// ... somewhere inside HTTPNetStream.as

private function attemptAppendBytes(bytes:ByteArray):void
{
            // Do nothing if this is not an Argo player.
            CONFIG::FLASH_10_1
            {
                appendBytes(bytes);
            }

            // dispatchEvent (new MyCustomEvent( MyCustomEvent.READY, true, false, bytes ));

}

 

public class MyCustomEvent extends Event
    {       
        public static const READY:String = "Ready";       
       
        public var _data:ByteArray;
                       
        public function MyCustomEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, data:ByteArray=null)
        {
            super(type, bubbles, cancelable);
            _data = data;
        }
       
        override public function clone():Event{
            return new MyCustomEvent(type,bubbles,cancelable,_data);
        }

 

}

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points