Removing a Video Stream From The Stage

what I have:
main.swf 1 frame
btns load various external.swfs
I have 3
one swf (commercial.swf)has a slideshow inside using the SlideShowPro component Not the flv player
problem: stream remains after swf is swapped out with new.
AS code  main timeline
var Xpos:Number = 0;
var Ypos:Number = 0;
var swf:MovieClip;
var loader:Loader = new Loader();
var defaultSWF:URLRequest = new URLRequest("swfs/home.swf");
loader.load(defaultSWF);
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);
// Btns Universal function
function btnClick(event:MouseEvent):void {
    removeChild(loader);
    var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf");
    loader.load(newSWFRequest);
    loader.x = Xpos;
    loader.y = Ypos;
    addChild(loader);
// Btn listeners
home.addEventListener(MouseEvent.CLICK, btnClick);
bio.addEventListener(MouseEvent.CLICK, btnClick);
commercial.addEventListener(MouseEvent.CLICK, btnClick);
NOW
home and bio.swf's have _mc's inside
the commercial.swf has the slideshow pro component inside
once commercial.swf is on stage after another btn is clicked the audio remains.
slide show pro is being used not an .flvPlayer
I need to know where the code to stop the stream goes in the main.swf or the swf with the slideshow component?

I did get somewhere, I have a few different main.swfs I used as I was experimenting. I have one that uses  UI loaders to load all the static (no videos inside) swfs to the main timeline those work fine
Also in that main.swf I have one loader being called by the loader class which also works. But I still had the stream remaining problem. I was able to add another set of event listeners that call the "unload and stop" method on the same buttons for my main navigation that call the gotoandstops to frames and they now unload the commercial.swf (which is the only swf I have using the slideshow pro component AND stop the stream as well.
Here's what I have
in main.swf
gotoAndStop("home");
btn_home.addEventListener(MouseEvent.CLICK, btn_home_click);
function btn_home_click(evt:MouseEvent):void {
    gotoAndPlay("home")
btn_bio.addEventListener(MouseEvent.CLICK, btn_bio_click);
function btn_bio_click(evt:MouseEvent):void {
    gotoAndPlay("bio")
btn_commercial.addEventListener(MouseEvent.CLICK, btn_commercial_click);
function btn_commercial_click(evt:MouseEvent):void {
    gotoAndStop(12)
// event listeners for unloads
btn_home.addEventListener("click",afterClick);
btn_bio.addEventListener("click",afterClick);
function afterClick(e:MouseEvent):void {
    ldr.unloadAndStop();
as layer of frame 12 only loader class
var ldr:Loader = new Loader();
var url:String = "commercial.swf";
var urlReq:URLRequest = new URLRequest(url);
ldr.load(urlReq);
addChild(ldr);
this method will unload and stop commercial.swf when the home_btn or bio_btn buttons are clickedI did not try this using the UI Loader
So I now will either need to use just the loader class to call all the swfs (like a variable) what I had used before and have the afterclick function in the home and bio in all the buttons (which I will add later)
I hope this helps as there has to be a solution.
thanks again for all your help by the way.
rd

Similar Messages

  • How to effectively remove a loaded SWF from the stage?

    I can not figure out a proper coding to remove a loded SWF from the stage.
    Here is my set up.
    I have a layout segmented into labeled section. In the section labeled "products" I have a layout consisting of product images acting as buttons which bring a user to another labeled section "prdctsPopUps"
    In the "prdctsPopUps" section I have placed an instance of LoaderMax placed into an mc container. Placing LoaderMax into an mc container automatically resolved an issue of clearing loaded SWFs from stage when I come back to "products" section.
    I specified the variable in the "products" section with the following set up:
    var sourceVar_ProductsPopUps:String;
    function onClickSumix1PopUp(event:MouseEvent):void {
                        sourceVar_ProductsPopUps="prdcts_popups/sumix1-popup_tl.swf";
                        gotoAndPlay("prdctsPopUps");
    So each button has its own "....swf" URL and they all open fine and I can come back to "products" section without any issues.
    However inside the swf (which loads through LoaderMax which is placed into an mc) there are other buttons which bring a user to labeled section "xyz". Which also functions properly. It opens as it is supposed to be and without any previously loaded "...swf" on the stage.
    At the labeled section "xyz" there is a limited set of buttons repeating from section "products" which has to bring a user back to the same set up in the "prdctsPopUps" labeled section and open a corresponding "...swf" .
    However only the last opened "...swf" will appear in that section. Effectively the one which was originally opened from the "prdctsPopUps" section and not the one which was supposed to be opened from the "xyz" section.
    I can not understand why it would work from one labeled section and not from another. I can not figure out on which section which code/function needed to be placed.
    Here is the set up from a button from the "xyz" section whcih supposed to bring a user to the same "prdctsPopUps" section but to load a different "...swf"
    var sourceVar_ProductsPopUps_fromXYZ:String;
    function onClick_floralytePopUp_fromXYZ(event:MouseEvent) :void {
                        sourceVar_ProductsPopUps_fromXYZ="prdcts_popups/floralyte-popup_tl.swf";
                        gotoAndPlay("prdctsPopUps");
    Here is the code set up for the LoaderMax from the "prdctsPopUps" section:
    var loaderProductPopUps:SWFLoader = new SWFLoader(sourceVar_ProductsPopUps,
                                                                                                        estimatedBytes:5000,
                                                                                                        container:holderMovieClip,
                                                                                                        onProgress:progressHandler,
                                                                                                        onComplete:completeHandler,
                                                                                                        centerRegistration:true,
                                                                                                        alpha:1,
                                                                                                        scaleMode:"none",
                                                                                                        width:540,
                                                                                                        height:730,
                                                                                                        crop:true,
                                                                                                        autoPlay:false
    function progressHandler(event:LoaderEvent):void{
              progressBarPopUp_mc.gradientbarPopUp_mc.scaleX = loaderProductPopUps.progress;
    function completeHandler(event:LoaderEvent):void{
              var loadedImage:ContentDisplay = event.target.content;
              TweenMax.to(progressBarPopUp_mc, 1.5, {alpha:0, scaleX:0.25, scaleY:0.25});
    loaderProductPopUps.load();
    Is there something which needs to be imported, or specific function needs to be specified in a specific labeled section?

    actually, i think you'll need to use something like:
    var loaderProductPopUps:SWFLoader;
    if ((loaderProductPopUps){
    if(loaderProductPopUps.content)){
       loaderProductPopUps.unload();
    loaderProductPopUps= new SWFLoader(sourceVar_ProductsPopUps, //the value of sourceVar_ProductsPopUps allows to load mulitple SWFs from the products page.
                                                                                                         estimatedBytes:5000 ,
                                                                                                         container:holderMov ieClip,// more convinient and easier to manage if to place the LoaderMax into an empty mc (holderMovieClip)
                                                                                                                                                                         // if not will work as well. Then the line container:holderMovieClip, has to be replaced with container:this,
                                                                                                                                                                         // can be any size, can not be scaled as it distorts the content
                                                                                                         onProgress:progress Handler,
                                                                                                         onComplete:complete Handler,
                                                                                                         centerRegistration: true,
                                                                                                         //x:-260, y:-320, //no need for this is if used: centerRegistration:true,
                                                                                                         alpha:1,
                                                                                                         scaleMode:"none",
                                                                                                         //scaleX:0, scaleY:0,
                                                                                                         //vAlign:"top",
                                                                                                         width:540,
                                                                                                         height:730,//scales proportionally but I need to cut off the edges
                                                                                                         crop:true,
                                                                                                         autoPlay:false
    function progressHandler(event:LoaderEvent):void{
              progressBarPopUp_mc.gradientbarPopUp_mc.scaleX = loaderProductPopUps.progress;
    function completeHandler(event:LoaderEvent):void{
              var loadedImage:ContentDisplay = event.target.content;
              //TweenMax.to(loadedImage, 1.5, {alpha:1, scaleX:1, scaleY:1});//only need this line if corresponding values are changed in SWF loader constructor
              TweenMax.to(progressBarPopUp_mc, 1.5, {alpha:0, scaleX:0.25, scaleY:0.25});
    loaderProductPopUps.load();

  • Does Premier Elements allow me to record video streaming from the internet?

    Does Premier Elements allow me to record video streaming from the internet?  If so which version and how?

    kc42k
    Although Premiere Elements is not going to record streaming video from the Internet but there are other programs that can, you should consider the terms of service for the web site that is the source for the streaming video.
    Online, there are very comprehensive articles on numerous programs that will do the recording.
    But, even those articles point out that many of the Internet web sites that you target for their videos have terms of service that would legally prohibit the recording of streaming video from the named web sites, one example, YouTube, if no download button and depending on the terms of service.
    Please consider. Any questions about the above, I can point you to the appropriate documentation on the matter.
    Thank you.
    ATR

  • How to remove a dynamic symbol from the stage?

    I'm loading dynamically copies of a Library symbol with a button click. Question is, when I move around in the timeline, I don't want to see the symbols at certain points. Can I loop through the json file and remove each symbol from the stage? Or is there a better way of accomplishing this?
    Being new to Edge Animate, I'm also unsure as to the names of the symbols as they are placed on the stage. If I use the browser's developer tools, I can see that the divs are named Stage_90, Stage_91, Stage_92 etc. However doing something like the following does not seem to work:
    sym.$("Stage_90").hide();
    I appreciate the help. Thanks again.

    I got it. It should be:
    $("#region1").remove();  
    // # was missing.
    I actually added that to time 0 on the main timeline so when I got back there it removes the image.
    It's not working from the symbol yet but I guess I should eventually get it working from there instead.
    Thanks for your time.

  • I need to remove a library item from the stage

    Right now I have a button that brings a library symbol to the stage. Ideally, I want to be able to click on the symbol itself to make itself from the stage. Can anyone help me with this?

    for example:
    var sym:WhateverClass=new WhateverClass();
    sym.addEventListener(MouseEvent.CLICK,clickF);
    function clickF(e:MouseEvent):void{
    e.currentTarget.parent.removeChild(e.currentTarget);

  • Having the same problem with my music videos streaming from the icloud.  Used to work fine.  Music streams OK

    My apple TV no longer will stream the music videos, especially when in shuffle mode.  Music is fine.  Music Videos from the computer library work just fine.
    All was well until about 3 weeks ago
    Appears from reading the different communites the problem is widespread
    Anyone found a solution
    I even purchased another Apple TV thinking the original may have been defective

    Welcome to the Apple Community.
    I believe you can only wait for Apple to resolve this issue.

  • Removing a movie clip from the stage - need help

    I am learning AS3 after using AS2 for a long time.  I'm making progress but need help.  I have a simple Flash website with the sections laid out the timeline with labels.  In one section called Media, I have a movie instance of a Flash movie gallery player.  It loads just fine but when I leave that section to go to another, the sound of the video is still playing.  Visually it's not seen but the sound still plays.  I suspect I need to put some sort of remove commamnd in the script but I'm having trouble getting the right result.
    I appreciate any help I can get with this.
    Thanks!
    BC

    See if the following posting helps...
    http://forums.adobe.com/thread/754549?tstart=0

  • Saving video stream from webcam periodically!!!

    Hi there, I want to catch every 1 minute video stream from the webcam, or video file, and save it into separate files. Of course I woudl like to have possibility to save many streams simultaneously. Any idea?
    Best regards

    Hi,
    I want to do the same thing ... I was able to stream audio through the socket but could not stream video.
    I posted my question at http://forum.java.sun.com/thread.jspa?threadID=674676&tstart=15
    and presented a sketch of my implementation design. But until now no one has answered my question.
    This is how you should hook up the components on the transmitter side
    Webcam --> Processor --> Custom DataSink --> PushBufferStream --> PushBufferHandler --> Socket --> Network.
    You can implement the transferData() method of the PushBufferHandler to write to a socket.
    And on the Receiver side the components should be hooked up like this
    Network --> Socket --> PullBufferStream --> custom DataSource --> Player
    Now as I mentioned in
    http://forum.java.sun.com/thread.jspa?threadID=674676&tstart=15
    the audio works fine but the video does not. The video does not render on the receiver side.
    Note: I tried TCP sockets with audio and it is terrible (not practical at all) so I reverted to UDP datagrams and the result was better than I expected. I didn't take care of the ordering of received packet at the receiver but it still worked fine.
    I am still looking waiting for some help in why video is not rendering and how can I sovle this problem.
    I am workning on a project and time is running out.
    Any help?
    -Adel

  • [svn:fx-trunk] 10826: When a Video is removed from the stage or becomes invisible, the video will now pause playback.

    Revision: 10826
    Author:   [email protected]
    Date:     2009-10-02 10:28:43 -0700 (Fri, 02 Oct 2009)
    Log Message:
    When a Video is removed from the stage or becomes invisible, the video will now pause playback.  This features is controlled through a new property, playWhenHidden, which defaults to false (meaning we don't play the video when it's hidden).  When it becomes visible/on-stage again, we will start playing the video if autoPlay=true.  Otherwise, the video will not automatically start playback.
    This property still needs to be reviewed by PARB.
    Also, updating a comment in SkinnableContainer relating to a FIXME I own.
    QE notes: -
    Doc notes: -
    Bugs: SDK-21928
    Reviewer: Deepa
    Tests run: checkintests, mustella VideoElement/VideoPlayer
    Is noteworthy for integration: Yes
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-21928
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/SkinnableContainer.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VideoPlayer.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/VideoElement.as

    Is this the same trouble you are having?
    http://discussions.apple.com/thread.jspa?threadID=826805&tstart=0
    DP G5 2GHz    

  • How do you remove a symbol from the stage in Edge animate?

    Hello-
    I'm wondering how to remove a symbol from the stage in Edge Animate so you can jump to another place in the timeline.  In Flash, the symbol was only on the stage for the amount of frames you indicated.  Not sure how it works here.
    For example, I have 2 buttons on my first screen with some text that animates in.  I want the button click to take the user to another section in the timeline or (basically another scene, like in Flash)  that contains different content.  If I change the visibility the buttons are still there and will ( I assume) create problems when other elements are placed on top. 
    Or is the only way with code.  If that is the case what would that code be?
    I would appreciate any help.
    Thank you!

    What I usually do, is, once you have everything set up in the scene you are done with. highlight it all
    right click
    group elements in DIV
    Now all those items act as 1 group and then you give it a properties name, much like a symbol.
    THEN you can refer to that scene name and move it anywhere or hide it and slide in another scene that has the content for that next scene.
    basically you take all the elements that make up 1 scene, gruop it up, name it, and then in the code for the button say something like:
    on click:
    scenename.play(framenumber);
    that will then animate that scene according to any animation you gave it, such as moving to the left, off stage. while moving scene 2 that you create into the stage.
    or just have something like this hide it
    sym.$("scenename").hide();
    sym.$("scene2name").show();
    but if you do that, make sure in your CompositionReady code you hide all scenes EXCEPT the 1st one, so the user doesnt see them all instanatly anyway.

  • Video streamed from YouTube using the Apple Composite AV Cable

    I used to have video streamed from YouTube on my iPad to my TV using the Apple Composite AV Cable, this was in previous versions till the iOS 6 release, then YouTube no longer streams video through this cable :'(
    Very annoying really to miss a feature through a software upgrade!
    Please help me.

    Looks like the connector that goes into the iPad doesn't precisely connect all pins and lock the whole thing in place as well as we would think an Apple-branded product would. I discovered after four hours that if I pull my AV composite cable from the iPad without turning the iPad off (not the Apple recommended way - perhaps there's a better way, like replugging with it off?) and plugging it back in, *poof* I get video again. Now, Netflix still isn't working, but U-Tubes and photo slideshows are back with awesome-quality sound. I believe I'll get similar results when I try this on my iPhone 4.
    I guess Apple TV is really the only way to get the luxury back of being able to stay focused on your entertainment and not this equipment because this was spozed to be a movie nite for me four hous ago. I just wish Apple TV had as much content as the Roku.
    Anyway, just plug and re-plug, but don't be too hard on it. You might also have to turn widescreen off and back on again.

  • TypeError: Error #1006 - Removing MovieClip from the stage

    I have a movie clip that is called to the stage and once the movieclip is finished it calls a function that removes it from the stage. The code works but I get an error message about 4 seconds after the movie clip ends.
    Here’s the error message:
    TypeError: Error #1006: exitWordMicroscopic is not a function.
                    at ASvocabulary_microscopic/frame110()[ASvocabulary_microscopic::frame110:1]
    Here’s the stage code:
    //************************Removes the movieclip from the stage and enables the button.*************************
    function exitWordMicroscopic():void
                    bnt_vocab_microscopic.mouseEnabled = true;
                    removeChild(word_Microscopic);
    //******************************Stage buttons**************************************
    stage.addEventListener(MouseEvent.MOUSE_DOWN, goButtonsHomeRead_1);
    function goButtonsHomeRead_1(event:MouseEvent):void
                    //Vocabulary buttons
                    if (event.target == bnt_vocab_microscopic)
                                    bnt_vocab_microscopic.mouseEnabled = false;
                                    SoundMixer.stopAll();
                                    addChild(word_Microscopic);
                                    word_Microscopic.x = 47;
                                    word_Microscopic.y = 120;
    Here’s the code inside the movie clip. This is what the error message is referring to:
    //****************** Calls function to remove itself from the stage****************************
    Object(parent).exitWordMicroscopic();
    What am I doing wrong?

    Here' how the code looks now:
    Objective: To remove the current movieclip while it's playing so that it does not show on the next (or previous) frame.
    Here’s the stage code:
    var word_Microscopic:ASvocabulary_microscopic = new ASvocabulary_microscopic();
    //Removes the movieclip from the stage and enables the button.
    function exitWordMicroscopic():void
        bnt_vocab_microscopic.mouseEnabled = true;
        removeChild(word_Microscopic);
    //******************************Stage buttons**************************************
    stage.addEventListener(MouseEvent.MOUSE_DOWN, goButtonsHomeRead_1);
    function goButtonsHomeRead_1(event:MouseEvent):void
        //Vocabulary buttons
        if (event.target == bnt_vocab_microscopic)
            SoundMixer.stopAll();
            bnt_vocab_microscopic.mouseEnabled = false;
            addChild(word_Microscopic);
            word_Microscopic.x = 47;
            word_Microscopic.y = 120;
            word_Microscopic.play();
    //This button takes the user to the Main Screen
        if (event.target == bnt_ReadGoHome_1)
           // exitWordMicroscopic(); [If I use this function I get this error ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.]
            SoundMixer.stopAll();
            gotoAndPlay("1","Main");
            stage.removeEventListener(MouseEvent.MOUSE_DOWN, goButtonsHomeRead_1);
    //This takes the user to the next frame.
    if (event.target == GoNext_1)
            SoundMixer.stopAll();
            gotoAndPlay("2");
            stage.removeEventListener(MouseEvent.MOUSE_DOWN, goButtonsHomeRead_1);
    Here’s the code inside the movie clip.
    //****************** Calls function to remove itself from the stage****************************
    Object(parent).exitWordMicroscopic();

  • Removing UI Loader from the stage

    I have 5 GoToframe activated UI loaders that appear on stage when a btn is clicked. All work fine except when either video galleries are clicked (there are two) . After the video gallery appears on stage any button clicked after that adds the next UI loader but the video gallery remains playing.
    Do I use a removeEventListener?
    Do I use on all buttons?
    Create separate functions?
    Any help which code and where to put????
    here is the code to one of the galleries
    this.stop();
    btnGallImg.addEventListener(MouseEvent.CLICK, vgall2);
    function vgall2(evt:Event):void {
        gotoAndStop("gallery2");

    you need to explicitly stop the video stream in the loaded swf.  how you do that depends on how the stream is started.
    for example, if you're using an flvplayback component with instance name flv, and your uiloader has instance name uiLDR, you could use:
    MovieClip(uiLDR.content).flv.stop()

  • [svn] 4233: When an FxComponent is removed from the stage and then re-added , we no longer reload the associated Skin unless it is absolutely necessary .

    Revision: 4233
    Author: [email protected]
    Date: 2008-12-04 12:15:28 -0800 (Thu, 04 Dec 2008)
    Log Message:
    When an FxComponent is removed from the stage and then re-added, we no longer reload the associated Skin unless it is absolutely necessary.
    Bug Notes: None
    QE Notes: None
    Doc Notes: None
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxComponent.as

    please let me know the linksys device model number you are using ..

  • Can Flash publish video to FMS generated from the Stage?

    I know NetStream can publish video from a camera, but is there anyway to generate video from the stage?
    If would be nice to record what is on the stage to the FMS for playback.
    Even combining the camera with elements on the stage.
    This would be even better once Stage3D is available to generate 3D generated videos.
    Is there anyway to overload Camera to insert any display object you wanted?
    Thanks.

    Maybe something like this:
    var ns:NetStream;
    //...init...
    ns.attachStage(this);
    while (condition) {
      moveObjectsOnStage();
      ns.nextFrame();
    ns.close();

Maybe you are looking for

  • MacBook Pro (Mid-2009, 13", 2.26) Memory Upgrade Question

    I currently own a MacBook Pro (2.26; 13") (Mid-2009) with 2GB of memory. I purchased a single 4GB memory card that I plan to add in one of the slots. If I understand correctly that would leave me with a total of 5GB of memory (4GB   1GB). Is this wor

  • My apple tv is not connecting to the internet via ethernet

    Got home tonight, have not been having problems before this, turned on my tv and started the aptv the same as always and got the regular splash screen with the usual icons, netflix, Hulu etc. Went to Hulu and it went to the usual menu screen, but fro

  • Fpga compile error Port width mismatch

    When I try to compile a FPGA vi, the following error occurs.  LabVIEW FPGA: The compilation failed due to a Xilinx error. Details: ERROR: [Synth 8-549] port width mismatch for port 'cEIOParameter0Signal': port width = 32, actual width = 24 [C:/NIFPGA

  • Can Oracle 10g EM manage DB2 or SQL Server

    Need to know if Oracle 10g EM do have the capability to manage DB2 and SQL Server, as ct has this requirement. If so ct will manage all DB`s using Oracle 10g EM and use it for his enterprise.

  • Difference between "type"'s of laptop model's - X201

    I've got two X201 laptops, that seem identical, except for the processor (one is an i5 2.4. and the other is an i5 2.53).  Also, the computer "type" is different on them.  One is a 3249 and the other is a 3680.  The only reason I care is that I was m