dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: do I need to close a connection?

  1. #1
    Senior Member
    Join Date
    Apr 2000
    Location
    Minneapolis
    Posts
    2,127

    do I need to close a connection?

    I am using a flash media server and doing dynamic switching.

    I set the size of my video object to the size of the playing video.
    sometimes when I switch videos quickly I get the video object resizing a couple of times between the correct size and the size of the previous video.

    The size is grabbed and set like this.
    PHP Code:

    function onMetaData(info:Object):void
    {
        
    vidHeight info.height;
        
    video.height vidHeight;
        
    trace("vidHeight " vidHeight);

    I see the size change in the trace.
    what might cause this?
    Do I need to close the connection before loading a new video?
    Or do I need to flush the buffer?

    You can see in this from the output window that I get a change in size from the metadata
    -------------
    NetConnection.Connect.Success
    NetStream.Buffer.Full
    NetStream.Play.Transition
    NetStream.Play.Reset
    NetStream.Play.Start
    vidHeight 370
    vidHeight 370
    NetStream.Buffer.Full
    NetStream.Play.Transition
    vidHeight 288
    vidHeight 370

  2. #2
    Senior Member
    Join Date
    Apr 2000
    Location
    Minneapolis
    Posts
    2,127
    Solved my problem.
    Just in case anyone else has this question
    I do not close the netConnection, just the netStream.

    simply call this disconnect function before creating a new stream and playing a new video.
    PHP Code:

    //_ds is the name of my stream in my createNetstream function
    //_ds = new DynamicStream( nc );

    function disconnect() { 
        
    // stops publishing the stream 
        
    _ds.close(); 

    Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center