Making link to external swf stop

Using flash 8.  Inserted a link to a 2:15 second swf on the internet (get URL xxx.swf) at the beginning of my fla file, it plays fine but when the swf is over, how can I make it go away, in order to continue on with my presentation? 

This is an onstage presentation so there are no buttons available, just
letting it play through.  Doesn't sound favorable. Thanks very much for
your help.
From:
Ned Murphy <[email protected]>
To:
rwcorgis <[email protected]>
Date:
07/16/2012 11:22 AM
Subject:
making link to external swf stop
Re: making link to external swf stop
created by Ned Murphy in ActionScript 1 and 2 - View the full discussion
If you have no control over that external swf there probably is not much
you can do outside of opening it in a separate browser window so that the
window can be closed and your original page is still showing in its
browser window..
Replies to this message go to everyone subscribed to this thread, not
directly to the person who posted the message. To post a reply, either
reply to this email or visit the message page: [
http://forums.adobe.com/message/4560470#4560470]
To unsubscribe from this thread, please visit the message page at [
http://forums.adobe.com/message/4560470#4560470]. In the Actions box on
the right, click the Stop Email Notifications link.
Start a new discussion in ActionScript 1 and 2 by email or at Adobe Forums
For more information about maintaining your forum email notifications
please go to http://forums.adobe.com/message/2936746#2936746.
STATEMENT OF CONFIDENTIALITY
The information contained in this email message and any attachments may be confidential and legally privileged and is intended for the use of the addressee(s) only.  If you are not an intended recipient, please: (1) notify me immediately by replying to this message; (2) do not use, disseminate, distribute or reproduce any part of the message or any attachment; and (3) destroy all copies of this message and any attachments.

Similar Messages

  • Stopping external SWF when new SWF is loaded

    Ok.... hmmmmm. I am currently working on a flash site that
    loads external SWFs for each page. one of the SWFs contains a
    sitepal movie. the sitepal has been coded to stop playing and
    unload on a frame change but it keeps playing when a link in the
    index is clicked and another SWF comes in. (in other words there is
    no frame change. the new SWF loads but the old one keeps playing)
    make sense?
    I just need the site pal to stop playing when the next SWF
    loads!
    each link on the bottom is part of the main.swf
    (index.swf)...
    I need the links on the bottom to "turn off" the SWF when a
    new page is choosen. the External SWFs are labled 1-5....
    attached is a simple diagram in .jpg format explaining the
    functionality of the site!
    any insight is appreciated...
    PS
    IM NO CODE MONKEY.... more of a point-click, copy-paste type
    o dude..

    HI,
    My files loads an external swf (containing the video) into a
    container on my stage. The loaded swf contains the embedded wmv
    movie file, which is quite large I might add. Do I need to cut file
    size or change to flv?
    thanks again.

  • How to detect external SWF has stopped not using totalFrames

    Trying to find a way to detect when an externally loaded SWF has stopped. Using "totalFrames" like the example below doesn't work for what I'm trying to accomplish.
    I need something that simply listens and detects when the clip has stopped. Editing the external SWF is not an option. Thanks in advance for any insight.
    function onfrm( evnt: Event ): void
    if (newMC.currentFrame == newMC.totalFrames )
    newMC.removeEventListener( Event.ENTER_FRAME, onfrm);
    trace("End of banner");

    Just did a small test, and at least with loading a swf that has a timeline the totalFrames option works fine:
    var m:MovieClip;
    var a:Loader = new Loader();
    a.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
    a.load(new URLRequest("anim.swf"));
    function done(e:Event):void
      m = MovieClip(a.content);
      m.addEventListener(Event.ENTER_FRAME, chek);
      addChild(m);
    function chek(e:Event):void
      if(m.currentFrame == m.totalFrames){
      trace("done");
      m.removeEventListener(Event.ENTER_FRAME, chek);

  • Stopping external swf's with no timeline

    Hey!
    I just released my portfolio at http://www.hyperactive.se/ which consists of a lot of externally loaded swf's (progressive banners). These swf's contains no timeline really, just one keyframe with an imported FLV. I don't have the source files so I need to control these from my Main flash file.
    As these external swf's are auto-playing, I would like it to be user initiated instead, so the users click on a button and it plays. But commands like "loader.stop()", "gotoAndPlay" etc. doesn't seem to work obviously. Anyone know a solution for this?

    What do you mean by "you'll need to know what's inside the loaded swfs"? there's not much in there, just a video. Then I guess I maybe have to probe.. is this the post? http://forums.adobe.com/message/2017776

  • Problem with making remote toppics when linking with external chm

    Hi to everybody,
    i m novice to robohelp html when i am creating chm files from
    my exsisting project that is a robohelp word project which take
    input doc file in Robohelp word and create .hpj poject and then i
    open this .hpj project into robo help Html to create chm file .
    when i m opening this project into robohelp html it is making .xpj
    project from the hpj project .
    but at this time poject has some links with external chm but
    when i m making hyper link with external chm using Remote toppic
    option this option i couldn't unable to found any where in robohelp
    html plz anyone can know help me out from this
    probelm....................plz...................i need help
    ,,,,,,,,,,,,,,,,,,,if anyone know how to remote toppic occur in
    such situation plz let me know,......
    Thx
    Rgard's

    Hi Ruziyo and welcome to the RH forums.
    If you are opening up your project via the XPJ file in
    RoboHelp HTML the remote topic should be able to be found by:
    - Highlighting what is to be hyperlinked.
    - Clicking the Insert > Hyperlink menu item (or use the
    toolbar icon or Cntl + K).
    - Click on the arrow to the right of the "Link To" field.
    - Select the Remote Topic option.
    - Select the CHM file that contains the topic to which the
    hyperlink is linked to.
    - Select the required topic.
    You will be asked to copy the CHM into your project
    directory. Hope this answers your question. If not, please do come
    back.

  • Need to stop cursor moving when external swf loads???

    Hi, I am using a magnifying glass as part of my portfolio but when I click on another section and this loads an external swf above the main movie, because you can still see the main movie below, you can see the magify glass still moving as you move the cursor above??
    you can see what I mean at :
    www.zoeglazebrook.co.uk
    any ideas how I can stop the magnify glass moving while i am on the external swf above?

    OK, I wasn't following what that code was doing before, but try replacing all the code I gave you before with this (put it all on the timeline, and remove that function from the movie clip):
    var mGInt;
    magnifyingGlass.onPress = function(){
         startGlass();
    function startGlass() {
         magnifyingGlass.startDrag("", true, 215, 120, 1080, 660);
         mGInt = setInterval(updateGlassImage,100);
    function stopGlass(){
         magnifyingGlass.stopDrag();
         clearInterval(mGInt);
    function updateGlassImage(){
         largeobject._x = (original._x-magnifyingGlass._x)*2;
         largeobject._y = (original._y-magnifyingGlass._y)*2;
         updateAfterEvent();
    webBtn.onRelease = function()
         disableBtns();
         stopGlass();
         loadMovieNum("Advertorial/Advertorial.swf", 1);
    function enableBtns():Void
          webBtn.enabled = true;
    function disableBtns():Void
          webBtn.enabled = false;

  • How can I stop timeline sounds in external swf files from playing during loading?

    I am having a problem with timeline sounds in external swf files playing during loading in a main swf. Can anyone help me?
    Here is some of the code from the main swf. I hope I have included enough.
    Thanks.
    import flash.events.MouseEvent;
    import flash.display.MovieClip;
    import flash.display.Loader;
    import flash.events.ProgressEvent;
    import flash.events.Event;
    import flash.net.URLRequest;
    import fl.events.SliderEvent;
    import flash.media.SoundTransform;
    preloader_mc.fill_mc.scaleX = 0;
    var swfA:Array = ["part1.swf","part2.swf"];
    var frameA:Array = [];
    var currentLoader:Loader;
    var swfTotalFrames:int;
    var tl:MovieClip = this;
    var st:SoundTransform = new SoundTransform()
    var index:int = 0;
    loadNextF();
    play_slider.enabled = false;
    function loadNextF():void{
                    tl["loader_"+index] = new Loader();
                    tl["loader_"+index].name = index.toString();
                    tl["loader_"+index].contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,progressF);
                    tl["loader_"+index].contentLoaderInfo.addEventListener(Event.COMPLETE,completeF);
                    tl["loader_"+index].load(new URLRequest(swfA[index]));
    function progressF(e:ProgressEvent):void{
                    var fractionLoaded:Number = index/swfA.length+e.bytesLoaded/(e.bytesTotal*swfA.length);
                    preloader_mc.fill_mc.scaleX = fractionLoaded;
                    preloader_mc.tf.text = (100*fractionLoaded)+"% Loaded";
    function completeF(e:Event):void{
                    tl["loader_"+index].contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS,progress F);
                    tl["loader_"+index].contentLoaderInfo.removeEventListener(Event.COMPLETE,completeF);
                    SoundMixer.stopAll();
                    var mc:MovieClip = MovieClip(tl["loader_"+index].content);
                    mc.gotoAndStop(1);
                    frameA.push(mc.totalFrames);
                    index++;
                    if(index<swfA.length){
                                    loadNextF();
                    } else {
                                    // all loads complete.  start play.
                                    restart_mc.buttonMode = true;
                                    restart_mc.alpha = 1;
                                    tl.addEventListener(Event.ENTER_FRAME,playUpdateF);
                                    tl.removeChild(preloader_mc);
                                    preloader_mc = null;
                                    play_slider.enabled = true;
                                    playpause_mc.alpha = 1;
                                    currentLoader = tl["loader_0"];
                                    tl.addChild(currentLoader);
                                    MovieClip(currentLoader.content).play();
                                    sliderParamsF();

    import flash.events.MouseEvent;
    import flash.display.MovieClip;
    import flash.display.Loader;
    import flash.events.ProgressEvent;
    import flash.events.Event;
    import flash.net.URLRequest;
    import fl.events.SliderEvent;
    import flash.media.SoundTransform;
    preloader_mc.fill_mc.scaleX = 0;
    var swfA:Array = ["part1.swf","part2.swf"];
    var frameA:Array = [];
    var currentLoader:Loader;
    var swfTotalFrames:int;
    var tl:MovieClip = this;
    var st:SoundTransform = new SoundTransform()
    var index:int = 0;
    loadNextF();
    play_slider.enabled = false;
    function loadNextF():void{
        tl["loader_"+index] = new Loader();
        tl["loader_"+index].name = index.toString();
        tl["loader_"+index].contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,progressF);
        tl["loader_"+index].contentLoaderInfo.addEventListener(Event.COMPLETE,completeF);
        tl["loader_"+index].load(new URLRequest(swfA[index]));
    function progressF(e:ProgressEvent):void{
        var fractionLoaded:Number = index/swfA.length+e.bytesLoaded/(e.bytesTotal*swfA.length);
        preloader_mc.fill_mc.scaleX = fractionLoaded;
        preloader_mc.tf.text = (100*fractionLoaded)+"% Loaded";
    function completeF(e:Event):void{
        tl["loader_"+index].contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS,progress F);
        tl["loader_"+index].contentLoaderInfo.removeEventListener(Event.COMPLETE,completeF);
        SoundMixer.stopAll();
        var mc:MovieClip = MovieClip(tl["loader_"+index].content);
        mc.gotoAndStop(1);
        frameA.push(mc.totalFrames);
        index++;
        if(index<swfA.length){
            loadNextF();
        } else {
            // all loads complete.  start play.
            restart_mc.buttonMode = true;
            restart_mc.alpha = 1;
            tl.addEventListener(Event.ENTER_FRAME,playUpdateF);
            tl.removeChild(preloader_mc);
            preloader_mc = null;
            play_slider.enabled = true;
            playpause_mc.alpha = 1;
            currentLoader = tl["loader_0"];
            tl.addChild(currentLoader);
            MovieClip(currentLoader.content).play();
            sliderParamsF();
    ///////////////// start sliders /////////////////////////////////
    sound_slider.addEventListener(SliderEvent.CHANGE,soundSliderF);
    function soundSliderF(e:SliderEvent):void{
        st.volume = e.value/100;
        tl.soundTransform = st;
    play_slider.addEventListener(SliderEvent.CHANGE,playSliderF);
    play_slider.addEventListener(MouseEvent.MOUSE_DOWN,playSliderDownF);
    //play_slider.addEventListener(MouseEvent.MOUSE_UP,playSliderUpF);
    function playSliderDownF(e:MouseEvent):void{
        tl.removeEventListener(Event.ENTER_FRAME,playUpdateF);
        stage.addEventListener(MouseEvent.MOUSE_UP,playSliderUpF);
    function playSliderUpF(e:MouseEvent):void{
        tl.addEventListener(Event.ENTER_FRAME,playUpdateF);
    function playSliderF(e:SliderEvent):void{
        SoundMixer.stopAll();
        var frameNum:int = Math.ceil(swfTotalFrames*e.value/100);
        var partialTotalFrames:int = 0;
        for(var i:int=0;i<frameA.length;i++){
            partialTotalFrames += frameA[i];
            if(partialTotalFrames>=frameNum){
                break;
        partialTotalFrames -= frameA[i];
        //trace(i,frameNum,frameNum-partialTotalFrames);
        if(currentLoader!=tl["loader_"+(i)]){
            tl.removeChild(currentLoader);
            MovieClip(currentLoader.content).stop();
            currentLoader = tl["loader_"+(i)];
            tl.addChild(currentLoader);
        if(playpause_mc.currentFrame==1){
            MovieClip(currentLoader.content).gotoAndPlay(frameNum-partialTotalFrames);
        } else {
            MovieClip(currentLoader.content).gotoAndStop(frameNum-partialTotalFrames);
    function sliderUpdateF(e:Event):void{
        var playedFrames:int = 0;
        for(var i:int=0;i<Number(currentLoader.name);i++){
            playedFrames += frameA[i];
        playedFrames += MovieClip(currentLoader.content).currentFrame;
        play_slider.value = Math.round(100*playedFrames/swfTotalFrames);
    function sliderParamsF():void{
        swfTotalFrames = 0;
        for(var i:int=0;i<swfA.length;i++){
            swfTotalFrames += MovieClip(tl["loader_"+i].content).totalFrames;
    ///////////////// end  sliders //////////////////////////////////
    ///////////////// start playpause restart ///////////////////////
    playpause_mc.addEventListener(MouseEvent.CLICK,playpauseF);
    playpause_mc.alpha = .2;
    restart_mc.addEventListener(MouseEvent.CLICK,restartF);
    restart_mc.buttonMode = false;
    restart_mc.alpha = .2;
    function playpauseF(e:MouseEvent):void{
        if(!e.currentTarget.toggle){
            MovieClip(currentLoader.content).stop();
            tl.removeEventListener(Event.ENTER_FRAME,playUpdateF);
            e.currentTarget.gotoAndStop(2);
        } else {
            MovieClip(currentLoader.content).play();
            tl.addEventListener(Event.ENTER_FRAME,playUpdateF);
            e.currentTarget.gotoAndStop(1);
        e.currentTarget.toggle = !e.currentTarget.toggle;
    ///////////////// end playpause //////////////////////////////
    function playUpdateF(e:Event):void{
        sliderUpdateF(e);
        var playingFrame:int = MovieClip(currentLoader.content).currentFrame;
        if(playingFrame==frameA[Number(currentLoader.name)]){
            // next loader
            MovieClip(currentLoader.content).stop();
            SoundMixer.stopAll();
            MovieClip(currentLoader.content).mute();
            var nextIndex:int = Number(currentLoader.name)+1;
            if(nextIndex<swfA.length){
                tl.removeChild(currentLoader);
                currentLoader = tl["loader_"+nextIndex];
                tl.addChild(currentLoader);
                MovieClip(currentLoader.content).gotoAndPlay(1);
            } else {
                tl.removeEventListener(Event.ENTER_FRAME,playUpdateF);
                playpause_mc.gotoAndStop(2);
                playpause_mc.toggle = !playpause_mc.toggle;
                //playpause_mc.alpha = .2;
                // all swfs have completed play
    function restartF(e:MouseEvent):void{
        MovieClip(currentLoader.content).stop();
        tl.removeChild(currentLoader);
        SoundMixer.stopAll();
        MovieClip(currentLoader.content).mute();
        currentLoader = tl["loader_"+0];
        tl.addChild(currentLoader);
        if(playpause_mc.currentFrame==1){
            MovieClip(currentLoader.content).gotoAndPlay(1);
        } else {
            MovieClip(currentLoader.content).gotoAndStop(1);

  • Making external SWF internal

    hello. i recently downloaded a XML splash rotator from flash
    den.
    http://flashden.net/item/zoom-slideshow-banner-rotator/13523
    i set up the XML files so that its loading the pictures i
    want and it is working fine when i publish it and check the html.
    i than open up my main website in flash, i select what frame
    i want the swf to load and use the "Load movie" command. i check
    the published file and the swf loads fine but its WAY to big,
    stretches off the screen and its all out of proportion????? whats
    goin on?
    the ideal thing would be to have the "rotator" actually be
    part of my main flash document, i want to be able to control and
    set it up right in the main file. is there a way to import SWF's or
    FLA's so that they are a single movie clip?
    i also need particular video to start playing once a slide on
    the rotator is clicked. i can set this up in the XML file but all
    you can do is redirect it to an HTML file. i need it to control the
    timeline in the main SWF file.
    here is my website without any of the "rotator" stuff. it
    would go under the "video" section
    www.wafflecone.ca

    you're loading an external swf using the loader class into your main swf, correct?  you're then resizing your main swf and there's a problem, correct?
    if yes and yes, what's the problem?

  • External swf unload & stop not working

    I am trying to load & unload external swf that contain audio & video. Problem is that when I unload the swf's, the sound continues and I get overlapping sound. This is the code I am using:
    var swf_loader:Loader = new Loader();
    ///unload previous swf
    swf_loader.unloadAndStop();
    removeChild(swf_loader);
    ////load new swf
    swf_loader.load(new URLRequest("welcome.swf"));
    swf_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, finishLoading);
    function finishLoading(e:Event):void{
    if(swf_loader.content){
    addChildAt(swf_loader, 0);
    swf_loader.y = 75;
    swf_loader.x = 0;

    (welcome to the stupid-error club.  you're in good company.)
    and, you're welcome.

  • How do I load an external swf at a frame after ClickToGoToAndStopAtFrame?

    Hi, I'm quite new in working with AS3.
    I am designing a site with a menupage with buttons.
    Some of these buttons are linked to a frame that contains an external swf, which is a portfolio.
    By pressing the buttons 'AQUAREL" and "OLIEVERF" you will go to another frame and the swf-portfolio shows up.
    Now the problem is: sometimes it seems to work, sometimes it doesn't.
    You can check out yourself at www.erwinvanzijl.nl
    Is there a better whay of programming these functions?
    Am I doing something wrong or is there a better way to do it?
    This is the actionscript that I put on the second frame where the swf is to show up:
    stop();
    var Xpos_2:Number = 52;
    var Ypos_2:Number = 59;
    var swf_2:MovieClip;
    var loader_2:Loader = new Loader();
    var SWF_2:URLRequest = new URLRequest("aquaportfolio.swf");
    loader.load(SWF_2);
    loader.x = Xpos;
    loader.y = Ypos;
    addChild(loader);
    btn_menu.addEventListener(MouseEvent.CLICK, unloadcontent_2);
    function unloadcontent_2(event:MouseEvent):void {
    removeChild(loader);
    gotoAndStop("menu");

    For the unloading it is a simple matter of...
    function unloadcontent_2(event:MouseEvent):void {
       loader.unload();
       removeChild(loader);
       gotoAndStop("menu");
    Follow what Dave has to say... he's far more experienced than I.  I was too hung up wondering what swf2 was all about to ntoice there were two loaders involved in the code.

  • Checking an external swf is loaded?

    Hi
    I'm loading an external .swf via typing the swf name into an input text field and hitting a submit button.
    The swf loads fine, but I'm trying to incorporate updating a status text field on a succesful load or if there is an error during loading.
    I can't find my mistake in the code - to me it should be making  load_status_txt display "ok", but the swf just loads with no status update.
    All the text fileds are fine, because if I code  load_status_txt.text = "hello" straight after addChild(loader); -  load_status_txt displays "hello"
    Can anyone see an obvious mistake below?
    Thanks so much again.
    Shaun
    loadSwfBut.addEventListener("mouseDown", sendData)
    function sendData(evt:Event){
        if(loadSwf.text !=""){
    var Xpos:Number = 0;
    var Ypos:Number = 100;
    var swf:MovieClip;
    var loader:Loader = new Loader();
    var defaultSWF:URLRequest = new URLRequest(loadSwf.text);
    loader.load(defaultSWF);
    loader.x = Xpos;
    loader.y = Ypos;
    addChild(loader);
            loader.addEventListener(Event.COMPLETE, dataOnLoad);
        } else load_status_txt.text = "All fields are mandatory"
    function dataOnLoad(evt:Event): void{
        load_status_txt.text = "ok";
    stop();

    use:
    loadSwfBut.addEventListener("mouseDown", sendData)
    function sendData(evt:Event){
        if(loadSwf.text !=""){
    var Xpos:Number = 0;
    var Ypos:Number = 100;
    var swf:MovieClip;
    var loader:Loader = new Loader();
    var defaultSWF:URLRequest = new URLRequest(loadSwf.text);
    loader.load(defaultSWF);
    loader.x = Xpos;
    loader.y = Ypos;
    addChild(loader);
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, dataOnLoad);
        } else load_status_txt.text = "All fields are mandatory"
    function dataOnLoad(evt:Event): void{
        load_status_txt.text = "ok";
    stop();

  • Loading external swf file in a new window

    Hi,
    I've got a few .swf files with video tutorials I've created using Captivate 4.
    I wanted to link them so I've created a main screen with menu with buttons in Flash.
    I've added AS to load the external swf files but they load in the same window. How can I load these .swf files in seperate window so that you could get back to the main window after you've finished watching?
    Here's my code:
    stop();
    var myLoader:Loader = new Loader();
    button1_btn.addEventListener(MouseEvent.CLICK, movie1_1);
    function movie1_1(e:MouseEvent):void
        var myURL:URLRequest = new URLRequest("01_01_Welcome.swf");
        myLoader.load(myURL);
        addChild(myLoader);
    I'm also attaching screenshot with menu in flash

    I've deleted the line and now the code lookes like that:
    stop();
    var myLoader:Loader = new Loader();
    button1_btn.addEventListener(MouseEvent.CLICK, movie1_1);
    function movie1_1(e:MouseEvent):void
        var myURL:URLRequest = new URLRequest("01_01_Welcome.swf");
        addChild(myLoader);
    Unfortunately, it doesn't load the .swf file when you click on the button...

  • GotoAndPlay specific frame in external swf from main swf

    I have a main swf that loads 2 external swfs.
    I click on button to see content of external swf #1 and see stuff. I do something that causes external swf to show other stuff (i.e. not at beginning state)
    In the main swf I click on button to see content of external swf #2. External swf #1 content is made invisible and I see content of external swf stuff.
    NOW, if I click on button to take me back to see external swf #1, I see it's content in current state. I want to force it to start over again at frame #1 which will reset content.
    However, no matter what I try, I can't seem to control which frame to go to in external swf using gotoAndplay.
    Here is code in frame #1 of main swf to load external swfs:
    //load academic movie
    var swfLoader1:Loader = new Loader();
    container1.addChild(swfLoader1);
    var url1:URLRequest = new URLRequest("academic.swf");
    swfLoader1.load(url1);
    //load wisdom movie
    var swfLoader3:Loader = new Loader();
    container3.addChild(swfLoader3);
    var url3:URLRequest = new URLRequest("wisdom.swf");
    swfLoader3.load(url3);
    Here is code in frame 2 of main swf that checks button to see where to go in external swf:
    //academic button clicked
    function academicClick(event:MouseEvent){
       container3.alpha = 0;
       container3.visible = false;
       container1.visible = true;
       container1.gotoAndPlay(1); //this is where I am trying to force it to start at frame 1
       container1.alpha = 1;
    I don't want to reload the external movie to force it to start over.
    Any help would be much appreciated.

    You can easily control this by making the external swf to load with your movieclip, The below is the code snippet that clear on accessing the specific frame on external swf.
    //Loading clips content
    var ldr:Loader;
    var mcExt:MovieClip;
    //Loading
    loadswf("external.swf");
    function loadswf(tmp:String):void{
        unloadSwf();
        ldr= new Loader();
        ldr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressListener);
        ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoaded);
        ldr.load(new URLRequest(tmp));
        function progressListener (e:ProgressEvent):void{
            ploader.visible=true;
        function swfLoaded(e:Event):void {
            mcExt = e.target.content as MovieClip;
            ldr.contentLoaderInfo.removeEventListener(Event.COMPLETE, swfLoaded);
            mcExt.addEventListener(Event.ENTER_FRAME,onEnterfn);
            ploader.visible=false;
            addChild(mcExt);
    //UnLoading
    function unloadSwf():void{
        if (ldr!=null){
            ldr.unloadAndStop();
            removeChild(mcExt);
            mcExt=null;
    //Intervals (The part you work on the specific frame within the external swf
    function onEnterfn(e:Event):void{
        var num:int=mcExt.currentFrame;
        if (num==1) mcExt.play();
        if (num==9) {
                mcExt.skipmc.addEventListener(MouseEvent.CLICK,skipfn);
                function skipfn(e:MouseEvent):void{
                    mcExt.stop();
                    mcExt.removeEventListener(Event.ENTER_FRAME,onEnterfn);
                    gotoAndStop("help");
        if (num==mcExt.totalFrames){
            mcExt.removeEventListener(Event.ENTER_FRAME,onEnterfn);
            gotoAndStop("help");
    hope it solve

  • Get external swf width height

    Hi,
    I'm am trying to load an external swf file using a different swf that is on a different domain. I have noticed that it is possible to use addChild on the external swf, but when I try to get its contents width and height using contentLoaderInfo I get a security sandbox error.
    It seems it is possible to fix it by using  Security.allowDomain("*") and Security.allowInsecureDomain("*") in the external file.
    And now it's get tricky, the external swf file is a file that users upload to my site so I don't have control on the code so I can't add the "allowDomain" part.
    The second swf (the host file that loads the external file) is a file that I let others to embed on their site.
    The intresting thing is that when I share the host swf on facebook there is no problem, and I don't even need to add the code for "allowDomain" on the external file.
    I it makes a different, I use HTTPS protocol to access to the external swf.
    I tried to load the crossdomain.xml file, but it didn't help.
    What can I do? the only data I need to get on the external swf is its width and height to scale it to the host file.
    Thank you

    Thank you.
    Now it looks i am getting close but not exacly there.
    Everytime I get near something else doesn't work properly.
    Now I get the dimension after two things:
    I added 'secure="false"' to the https' crossdomain and added LoaderContext to when I load the external event:
    context.securityDomain = SecurityDomain.currentDomain;
    context.checkPolicyFile = true;
    Now you probably ask what's the problem.
    well I have no idea why, but it looks like the external swf file I load (which is as2, but I still didn't check if it matters) keeps on jumping between its first frame and second frame ( The swf has two frames). If you having hard time to imaging what I mean, lets  say this jumping between frames is really not recommended for people with Epilepsy.
    It has a stop() action, but sadly the player doesn't care.
    let me remind you that if I only addChild the Loader (without the context)  it looks fine, but I need the width and height to resize the swf.
    anyone knows what can cause this?
    and thx again martinjamesroberts1 for the link, it put me on the right track.

  • Preloader ignores external swf's actionscript

    Hey guys
    I have an External.swf file that is a video. The swf is 1135 frames long and running just fine by itself, stopping as I want when the actionscript says stop(); on the first frame and looping the end of the clip with gotoAndPlay(837).
    The preloader SwfLoader.swf linked to the External.swf shows the percentage of bytes loaded as it should. However, it runs the video (sound playing in the background) while the preloader shows the loading progress I think it's because it doesn't load the first frame first.
    Once the external swf is loaded, it plays the video again, still ignoring the first actionscript frame that says stop(); and the last frame gotoAndPlay(837).
    Thank you.
    Here is the preloader's actionscript on the first and only frame:
    import flash.geom.*
    import flash.display.*
    var loadurl:String = "External.swf";
    var nDepth:Number = 0;
    var nWidth:Number = 200;
    var nHeight:Number = 20;
    var nPadding:Number = 3;
    var cLoader:MovieClipLoader = new MovieClipLoader();
    var oListener:Object = {onLoadInit:onContentLoaded};
    var mcLoader:MovieClip = this.createEmptyMovieClip("Loader_MC", 0);
    var mcContent:MovieClip = this.createEmptyMovieClip("Content_MC", 1);
    var mcLoadBarBg:MovieClip = mcLoader.createEmptyMovieClip("LoadBarBg_MC", nDepth++);
    var mcLoadBar:MovieClip = null; //Duplicated later with mcLoadBarBg
    var txtPercLoad:TextField = null; //Create after duplication
    var cMatrix:Matrix = new Matrix();
    mcLoader._alpha = 0;
    cMatrix.createGradientBox(nWidth, nHeight, 0, nPadding, nPadding);
    cLoader.addListener(oListener);
    mcLoader.lineStyle(1, 0x000066, 100);
    DrawRect(mcLoader, 0, 0, nWidth, nHeight);
    mcLoadBarBg.lineStyle(1, 0x0000FF, 0);
    mcLoadBarBg.beginGradientFill("linear", [0x006699, 0x0066FF], [100,100], [0, 255], cMatrix, SpreadMethod.PAD);
    DrawRect(mcLoadBarBg, 0, 0, nWidth - nPadding*2, nHeight - nPadding*2);
    mcLoadBarBg.endFill();
    mcLoadBar = mcLoadBarBg.duplicateMovieClip("LoadBar_MC", nDepth++);
    txtPercLoad = mcLoader.createTextField("PercLoad_TXT", nDepth++, 0, 0, nWidth, nHeight);
    mcLoadBar._alpha = 80;
    mcLoadBarBg._alpha = 30;
    Translate(mcTextMask, nPadding, nPadding);
    Translate(mcLoadBarBg, nPadding, nPadding);
    Translate(mcLoadBar, nPadding, nPadding);
    mcLoadBar._xscale = 0;
    mcContent._alpha = 0;
    mcContent._lockroot = true;
    mcLoader._x = Stage.width/2 - mcLoader._width/2;
    mcLoader._y = Stage.height/2 - mcLoader._height/2;
    txtPercLoad._x = mcLoader._width/2 - txtPercLoad._width/2;
    txtPercLoad._y = mcLoader._height/2 - txtPercLoad._height/2;
    SetTextFormat(txtPercLoad, "0%");
    mcLoader._alpha = 100;
    cLoader.loadClip(loadurl, mcContent);
    _root.onEnterFrame = function()
       var nBytesLoaded:Number = mcContent.getBytesLoaded();
       var nBytesTotal:Number = mcContent.getBytesTotal();
       var nPercLoaded:Number = Math.round(nBytesLoaded / nBytesTotal * 100);
       if(nPercLoaded > 0)
          SetTextFormat(txtPercLoad, nPercLoaded.toString() + "%");
                mcLoadBar._xscale = nPercLoaded;
    function onContentLoaded(Void):Void
       //trace(_root + "::onContentLoaded");
       SetTextFormat(txtPercLoad, "100%");
       cLoader.removeListener(oListener);
       delete _root.onEnterFrame;
       delete oListener;
       delete cLoader;
       _root.onEnterFrame = function()
          //trace(_root + "::onContentLoaded::_root.onEnterFrame");
                var nInc:Number = 5;
                mcLoader._alpha -= nInc;
                mcContent._alpha += nInc;
                if(mcLoader._alpha <= 0) startLoadedContent();
    function startLoadedContent(Void):Void
       delete _root.onEnterFrame;
       mcLoader.removeMovieClip();
       mcContent._alpha = 100;
       mcContent.play();
    function DrawRect(mc:MovieClip, nX:Number, nY:Number, nW:Number, nH:Number, nR:Number)
       trace("DrawRect in: " + mc);
       if(nR == undefined) nR = 6;
       mc.moveTo(nX+nR,nY);
       mc.lineTo(nX+nW-nR,nY);
       mc.curveTo(nX+nW,nY,nX+nW,nY+nR);
       mc.lineTo(nX+nW,nY+nH-nR);
       mc.curveTo(nX+nW,nY+nH,nX+nW-nR,nY+nH);
       mc.lineTo(nX+nR,nY+nH);
       mc.curveTo(nX,nY+nH,nX,nY+nH-nR);
       mc.lineTo(nX,nY+nR);
       mc.curveTo(nX,nY,nX+nR,nY);
    function SetTextFormat(txtField:TextField, sText:String)
       var txtFmt:TextFormat = new TextFormat();
       sText = "Loading... " + sText;
       txtFmt.font = "Verdana";
       txtFmt.align = "center";
       txtFmt.size = 11;
       txtFmt.color = 0x000066;
       txtFmt.bold = true;
       txtField.selectable = false;
       txtField.text = sText;
       txtField.setTextFormat(txtFmt);
       txtFmt = null;
    function Translate(mc:MovieClip, nX:Number, nY:Number):Void
       mc._x = nX;
       mc._y = nY;

    Hi kglad,
    The external swf is a movieclip (flv embedded with an AS3 layer to control the timeline) exported as an swf file .
    The first frame of the external swf is just stop();
    I didn't know the proloader code was AS2 though
    The preloader works fine with the external swf locally, but the problem happens when I run them from my server.
    The external swf itself and its code works fine from the server, both combined don't, so I guess the problem comes from the preloader. Probably because of the AS being 2 insted of 3.

Maybe you are looking for

  • Problem with Function Key in multiple JTextArea's

    Hi all, I have an unusual problem that I'm hoping someone has run into before. I'm working on a chatroom with multiple JTextArea's. I'm filter incoming keystrokes to run the appropriate method. I want to use function keys to perform various functions

  • How to retain Transparency in PDF file while exporting?

    Hi All, In our project we export the PDF file by using two option. 1. By using PDF Style file 2. By using Default settings (IPDFExportPrefs Interface) We have one image frame in template which contains transparent image. 1. In this case it copies IPD

  • How to veto a JComboBox selection change in ItemListener

    I have a JComboBox whose current value is tied to some data cached in my application. I want to be able to examine the selection in an ItemListener attached to the JComboBox, and if the value is different than what I have cached, I want to ask the us

  • Documents in multiple folders

    What I need to acheive is a search for all documents that appear in folders A, B and C with certain attributes. I started with find all documents in Folder A using a FolderRestrictQualification and the documents have search attributes, no problems. H

  • Creating Users for Oracle DB residing in xMII server

    Hi, We are on xMII 12.0.3 Build(107). We have the Oracle 10g database residing in the xMII server. Now, in order to create users to access the DB, do we have to create in SAP front or externally create users on oracle front? Thanks in advance, Regard