Skip to main content
Participant
February 16, 2008
Question

Help with unloading movie

  • February 16, 2008
  • 2 replies
  • 297 views
So here's the situation.
I'm trying to create a flash movie that has a two buttons and a loader component.
One button will pull a video from one streaming source and load it using the loader, the other will pull from another streaming source and load it using the same loader.

When I click button 1 the stream loads up fine and in my FMS Admin console, I see the number of clients increase by 1. When I click button 2, the steam loads up and the total client increase again.
So basically, everytime I click the button, the number of clients increases even if I load the same stream over and over again. This will continue until I close the movie or the server limit is reached (I am currently using the development version of FMS).

My code is pretty simple.
It's as follows:
btn1.onPress = function() {
loader1.unload();
loader1.load("url1");
}
btn2.onPress = function() {
loader1.unload();
loader1.load("url2");
}

The issue here is that I can't get it to properly unload the movie so the connection with FMS remains. I've tried making button 1 load the streame and button 2 unload the stream, but no matter how much I press button 2, it would not unload and the stream will remain there running.

If anyone has any suggestions, it would be much appreciated.
Thanks.
    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    February 18, 2008
    Are you using NetConnection API inside loader1.load("uri1") ?

    In that case it would be required to explicitly close the Netconnection using NetConnection.close();

    99foreverAuthor
    Participant
    February 18, 2008
    I placed a loader component on the stage and gave it an instance name of "loader1" and set autoLoad to false.
    In the actionscript window, I added the code in my first post.
    I'm not sure if the load function uses the NetConnectionAPI or not. The load command is a predefined method of loader.

    I've tried loading the external swf streams into a MC using NetCommand with no luck so far.
    If any one has any suggestions on the best way to do this, I'm flexible in the approach to take as long as it works.
    All I want to do is load SWF files which are just containers for rmtp streams and I want to be able to switch between different SWF/streams.
    Thanks.