Playback of SWF loaded SWFLoader control

I am loading a swf file into my Flex Application that I would like to control simple playback of the Flex application.  It is a test application.

Essentially:

I have a SWFLoaded swf with id = "swfLoader".  When I try to use the command in the click handler function...

swfLoader.play ();  or nextFrame();   I get the error...

Property not found on mx.controls.SWFLoader NextFrame and there is no default value.

Do I need to import anything?  Or do you use other commands to control swf?

Thank you.

swfLoader.content.play)

Tags: Flex

Similar Questions

  • How to control the video swf loaded in the loading component?

    I have an external swf file loaded into the loading component. The external swf loaded into the component loading stops at departure. I want to play by a button outside the loading component that is located in the main swf movie. CAN SOMEONE HELP ME CONTROL THE VIDEO SWF LOADED INTO THE COMPONENT OF LOADING EXTERNAL?

    You can target the SWF via the content property of the UILoader.  If the name of the instance the UILoader is ldr...

    MovieClip (ldr.content) .play ();

  • Controls the main scenario for swf loaded.

    Hello

    I use a textfield for debug information.

    I am loading a swf in the main timeline and I show the status in the textfield of debugging.

    function swfLoaderCompleteHandler(event:Event)

    {

    Debug.Text += "Swf loaded.";

    }

    This works.

    But,

    I am loading a png file in the loaded swf file. I'm showing the State of the png file that I showed the status of the swf file.

    function pngLoaderCompleteHandler(event:Event)

    {

    MovieClip (parent). Debug.Text += "Png loaded.";

    }

    I can't control the main swf from inside the loaded swf file. Same Stop or a function call does not work.

    I need to add something when I load the swf file, it's a MovieClip or something?

    Here is also a fla. http://flashfocus.nl/Forum/attachment.php?attachmentid=9885 & d = 1282509233

    You are welcome.

    Please mark this thread as answered, if you can.

  • Calling function flex SWF loaded into Flex

    Hi, just a few days in flex development and a question about SWFLoader.

    Is it possible to call a function from flex to a SWF file loaded by SWFLoader control?

    For example, I have a SWF animation with a button, loaded into a Flex application and I would like that when the user clicks the button, it will call a function in the flex application.

    If possible, can we send parameters with the function call?

    Thank you for all your help.
    Mika

    There are two possibilities, depending on what type of SWF you load. If you load a SWF9, then check on ApplicationDomain. If you load SWF8 or earlier, then read this technical note:
    http://www.Adobe.com/go/749eaa47

  • SWF swf communication - swf loaded swf loading

    Hello
    I read the article by kglad SWF SWF communication when two SWF files uses actionscript 3.0 gratefully, but, probably because of my stubbornness, I have swf loaded at loading swf communication problems to work for me.

    Loading of swf (swf1.swf) as loaded swf (swf2.swf) by casting to a MovieClip loader.content worked well for me.

    I want the swf to call a function on the timeline of the swf file loading.  (Aside, I'm doubting it's possible, but I'm really very uneducated on this topic)

    I copied the article code in swf2.fla as below;

    Create a variable to refer to the main scenario for swf1

    var swf1Main_mc:MovieClip; This assumes that swf1 is a movieclip.

    Create your listener to ensure that loaded swf has been added to the display list and can get a

    the reference to the main timeline (which is always the main timeline of the SWF loading).

    this.addEventListener (Event.ADDED_TO_STAGE, initF);

    function initF(e:Event):void {}

    swf1Main_mc = MovieClip (this.root);

    }

    and add a simple button with an event listener for mouse to invoke a function (in swf2) for example

    function btnClicked(e:Event)

    {

    swf1Main_mc.showME ();

    }

    where showME() is a function in swf1.  for example

    function showME()

    {

    trace ("swf1 called swf2 showME");

    }

    All I get is a runtime error "TypeError: Error #1006: showME is not a function."  to swf2_fla::MainTimeline/btnClicked().

    I took out what little hair remains try different variations in the code then, in desperation, please someone can spot what I'm doing wrong or point me in the right direction?

    Thanks for your time,
    Bob

    A loaded swf file should not try to control its parent.  The child must only be send an event to the parent to take action.  In this way, the child is completely independent of the parent as well as to be able to publish on his own.  To load completion than the parent must assign an event listener to the child for this event, and the event handler function.

    Example:

    Add something to raise the event in the child:

    dispatchEvent (new Event ("eventTriggered")); (if problem dispatchEvent, see: http://www.kirupa.com/forum/showthread.php?p=1899603#post1899603)

    In your SWF to loading/parent, listen for the complete event on the Loader.contentLoaderInfo.  In the complete event handler, add a listener for the event on the loaded swf file.

    triggered when external swf loading event handler
    function loaderCompleteHandler(event:Event) {}
    MovieClip (event.currentTarget.content) .addEventListener ("eventTriggered", eventHandler);
    }

    function eventHandler(event:Event):void {}
    trace ("event sent in loaded swf");
    }

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

    I can't understand a correct coding to remove a SWF loded in the scene.

    Here is my set upwards.

    I have a layout that is segmented in section labeled. In the section titled 'products', I have a scheme consisting of images of products acting as buttons that bring a user in another section labeled "prdctsPopUps."

    In the "prdctsPopUps" section, I placed an instance of LoaderMax placed in a container of mc. Place LoaderMax in a container of mc automatically resolved a problem of clearing loaded SWFs from the stadium when I go back to the section "products".

    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 very well and I can go back to the topic 'produced' without any problem.

    However inside the swf (that charge by LoaderMax which is placed in a mc) there are other buttons that lead a user to the section labeled "xyz". That works as well. It opens as he's supposed to be and without any previously loaded "... swf ' on the stage.

    In the section labeled "xyz", there is a limited set of buttons with the heading 'products' that must raise a user to the same game in the labeled 'prdctsPopUps' section and open a correspondent "... swf»

    However only the last opened "... swf" will appear in this section. Actually the only one that has been opened at the origin of the "prdctsPopUps" section, not who was supposed to be opened from the section "xyz".

    I do not understand why it would work a labeled section and not the other. I can't know which section what function/code should be placed.

    Here is the set up through a button in the section "xyz" supposed to bring a user to the same section of "prdctsPopUps" but to load another '... 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's the code in place for the LoaderMax of the section "prdctsPopUps":

    var loaderProductPopUps:SWFLoader = new SWFLoader (sourceVar_ProductsPopUps,

    {

    estimatedBytes:5000,

    container: holderMovieClip,.

    onProgress:progressHandler,

    onComplete:completeHandler,

    centerRegistration:true,

    Alpha: 1,

    ScaleMode (ScaleMode): 'none',

    Width: 540,

    height: 730,.

    harvest: 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 that must be imported, or specific function must be specified in a specific titled section?

    in fact, I think that you will 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 several SWF files from the page produced.

    {

    estimatedBytes:5000,

    container: holderMov ieClip, / / convinient and easy to manage cases of placing the LoaderMax one mc empty (holderMovieClip)

    If this is not the case, will work as well. Then the container line: holderMovieClip, must be replaced by container: cela,.

    can be any size, cannot be resized as it distorts the content

    Manager onProgress:progress,

    onComplete: complete the Manager.

    centerRegistration: true,

    x:-260, y:-320, //no need for that is if used: centerRegistration:true,.

    Alpha: 1,

    ScaleMode (ScaleMode): 'none',

    scaleX:0, scaleY: 0,

    vAlign: "high."

    Width: 540,

    height: 730, / / scale proportionately but I need to cut the edges

    harvest: 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 the corresponding values are changed in Builder SWF loader

    TweenMax.to (progressBarPopUp_mc, 1.5, {alpha: 0, scaleX:0.25, scaleY: 0.25});

    }

    loaderProductPopUps.load ();

  • How to get the content incorporate the swf file in Swf Loader on the run time

    How to get the content incorporate the swf file in Swf Loader on the run time

    [Bindable]

    [Embed(source="assets/index.swf")]

    private var SWFSRC: Class;

    < mx:SWFLoader id = "_swfloader" source = "{SWFSRC}" / >

    It might be Loader (DisplayObjectContainer (_swfLoader.content) .getChildAt (0)) content

  • Unload the SWF using SWFLoader

    Hello

    I have a main app where I use a SWFLoader for loading a second application.

    In the second application, I want to put a (Close) button and when I click it I want to download this application.

    Is it possible to do this?

    I know that I can unload a swf file using the SWFLoader unloadAndStop method, but how do I access it the loaded application?

    I think a different approach would be adding eventlisteners to the loaded swf but I do not know how.

    Can someone help me?

    Thanks in advance,

    Alberto

    Hello

    @Alberto

    I think a different approach would be adding eventlisteners to swf loaded but I don't know how to do this.

    I think you can use the event type to custom or built-in to send information to the hosting applications and SWFLoader * has * integrated dedicated routine to the context loaded unloading - which includes the removal of event listeners added to swf-types on content charge (Yes, there is a way in the kit Flex SDK to access applications above, but most often that is not advisable to access the methods and properties of the parent that it binds tightly) content together).

    For your initial claim could start listening to the custom events when the load completes and removes loading app like this:

    http://ns.Adobe.com/MXML/2009.

    xmlns:s = "library://ns.adobe.com/flex/spark".

    xmlns:MX = "library://ns.adobe.com/flex/mx" >

    protected function chidLoadedHandler(event:Event):void

    {

    swfLoader.content.addEventListener (Event.CLOSE, unloadChildHandler);

    };

    protected function unloadChildHandler(event:Event):void

    {

    swfLoader.content.removeEventListener (Event.CLOSE, unloadChildHandler);

    swfLoader.unloadAndStop (true);

    }

    ]]>

    <>

    Width = "100%" height = "100%".

    source = "ChildApplication.swf"

    Complete = "chidLoadedHandler (Event)" "

    ID = "swfLoader" / >

    While the demand of your children simply:

    http://ns.Adobe.com/MXML/2009.

    xmlns:s = "library://ns.adobe.com/flex/spark".

    xmlns:MX = "library://ns.adobe.com/flex/mx" >

    protected function unloadMeHandler(event:MouseEvent):void

    {

    We will ship event 'CLOSE' - this could be the type of custom event

    but I think it's just enoguht heres

    var closeEvent:Event = new Event (Event.CLOSE);

    root's highest - if it's 'content' more high display object so

    this.root.dispatchEvent (closeEvent);

    }

    ]]>

    Don't know if it's more evidence of ball or recommended solution but could be the starting point,

    Kind regards

    Peter

  • rinsing of the SWF loaded phase target mc?

    Hi, I'm using buttons to send the playhead to executives in which sovereign wealth funds are then loaded into an empty movieclip called "stage_target_mc"... .how I can then flush out the previously loaded swf then only a newly loaded swf displayed in "stage_target_mc"?  For example, after you click on the button 'about' swf 'about' load... then the "concepts" click the "concepts" swf loads - but the previously 'about' loaded swf plays again... I wish I could rinse the swf 'about' so only "concepts" are display, in this example.  Thank you!

    code associated with buttons that are used to send the playhead to frame "concepts" or "about":

    about_btn.addEventListener (MouseEvent.CLICK, displayAbout);

    function displayAbout(e:MouseEvent):void {}

    root.gotoAndStop ("about");

    }

    concepts_btn.addEventListener (MouseEvent.CLICK, displayConcepts);

    function displayConcepts(e:MouseEvent):void {}

    root.gotoAndStop ("concepts");

    }

    code on frame called "concepts":

    stage_target_loader. Load (new URLRequest("swfs/stages/concepts.swf"));

    MovieClip (root).stage_target_mc.addChild (stage_target_loader);

    code on frame called 'a way':

    stage_target_loader. Load (new URLRequest("swfs/stages/about.swf"));

    MovieClip (root).stage_target_mc.addChild (stage_target_loader);

    Before loading, try to use the method of the Loader class unloadAndStop() If you are using a version of Flash newr

  • How can I create buttons of switch trigger MC in swf loaded

    Hello

    I am a newbie in ActionScript 3 and I am currently working on a project that has a (zoom) swf that zoom/pan a swf loaded a map (carte_web.swf). Everything was going well until I got more requests.  There are now two cards, same background, one with images and one with only one road. I try to add code to two buttons on a toolbar that is generated by the zoom.swf, to switch between the two cards, without losing its zoom/pan my cards are the two Flash-oriented object programming.  I spent 27 hours, trying to find a way, and I'm definitely at the end of my mind!

    I have a suggestion "to charge both your SWF in a sprite separately.» Then switching between sovereign wealth funds by removing and adding them to their parent sprite. The parent sprite is what you zoom. "I've tried everything!

    Any suggestions?

    If you want to keep the current state of each 'card', you will need to load each of these sovereign wealth funds in different sprites. In this way, you can just addChild and removeChild and save the State without having to reload the SWF file. Another way, you could actually do, would be to just reload in a sprite, and before you unload the SWF file, save all data of zoom/pan in an array or variable or something of that sort and just restore data to the card when it is reloaded. Don't know if I make sense here, but without details of your exact problem, it is difficult to say.

  • Swf loader help

    Hello all, I use Flash CS4 with AS3.


    I have a problem with the preloader site. When I simulate the load it is 'invisible' for awhile and then appear from loading of ~ 24-27% or perhaps ~ 55%
    To resolve this problem some people suggested to create a loader.swf (where you want to preload) and the site.swf: when the loader.swf have loaded the site.swf then it appear.


    Well, I tried this with the following code:

    var file:Loader=new Loader();
    var: path string.
    load.bar.scaleX = 0;

    run the preLoader (event: Event): void {}
    If (file.contentLoaderInfo.bytesTotal! = 0)
    {
    load.bar.scaleX = (file.contentLoaderInfo.bytesLoaded / file.contentLoaderInfo.bytesTotal);
    Load.txt_perc. Text = String (Math.round ((file.contentLoaderInfo.bytesLoaded/file.contentLoad erInfo.bytesTotal)*100))+"%";))
    }
    trace (file.contentLoaderInfo.bytesLoaded);
    }

    function stopLoader (event: Event): void {}
    trace ("Downloaded");
    file.removeEventListener (Event.ENTER_FRAME, preLoader);
    load.bar.scaleX = 0;
    Load.txt_perc. Text ="";
    }

    file.contentLoaderInfo.addEventListener (Event.COMPLETE, stopLoader);

    function loadMovie (): void {}
    load.bar.scaleX = 0;
    var swf:URLRequest = new URLRequest (path);
    leader. Load (SWF);
    file.addEventListener (Event.ENTER_FRAME, preLoader);
    stage.addChild (file);
    }

    function path1(e:Event):void {}
    path = "example.swf";
    loadMovie();
    }

    stage.addEventListener (Event.ENTER_FRAME, path1);


    But he returns this error:

    #2044 error: Unhandled IOErrorEvent:. Text = #2036 Error: incomplete loading.


    Someone told me that this error is due to the impossibility to find the URL of the swf file, but this is false since the swf file is finished.

    If I look at the load simulation I see multiple copies of the swf file are "loaded", but nobody is 100%.

    However, I said "responsible" because if I put a trace (file.contentLoaderInfo.bytesLoaded); I see a 0 permanent.


    Please help me I'm going crazy!

    where did,

    removeChild (file);

    come from?   which removes your swf loaded from the display list.  remove this line of code.

  • Could not load the control 4

    Hello
    I'm quite rusty with Robohelp, but trying to get up to speed. wWhen - I open a project, the following message appears:
    Could not load the control 4.
    He keeps the project of loading, I have not tested to see if it has an impact when I edit a topic, but nobody knows what is the cause? I searched for help online, but this error is not mentioned...
    In addition, robohelp has changed a bit since I used it last & I am struggling to come to grips with some of the provisions of the record - I understand the projects are now .xpj, but the level of the root of each subfolder contains a.fpj file. I read somewhere that this allows multi user access to a project, but can not see how it works - I could certainly not open an individual file using this file anyway! Can someone point me to documentation that explains what it is & what it does or does not? or quickly explain this for me?

    Thank you very much
    Maxine

    Hi, it was not related to Vista, no - we're under XP.
    It seems that RoboHelp has not been installed properly, so a reinstall fixes this problem!

    Thank you very much for answering.

  • TypeError: Error #1009 (SWF loaded)

    I'm pulling my hair out on this one!

    I'm just starting a website (website full-Flash) using CS3 and AS3. I'm pretty much used to the new changes in AS3. I built a rough structure to make sure that the way I wanted to create the site would work (external swf loading, etc.). The tests worked.

    Now, I'm going to do real things, and I get this error as soon as an external SWF to load in:

    ------------------------------------------------------------------------------------------ -----------------------------------------
    TypeError: Error #1009: cannot access a property or method of a null object reference.
    at test_fla::MainTimeline/test_fla::frame2()
    ------------------------------------------------------------------------------------------ -----------------------------------------

    I tried this shrinkage, impossible to find the exact culprit (had to remove every shred of ActionScript, before starting to work again). So, I started to rebuild this film entirely - allowed out of the library and deleted all the layers. Did not work. Impossible to add a stop(); action in Frame 1.

    Then I started completely expenses File > New, rebuilt again. I tested after every single change. I finally built it up to the point where I first tested the original, and it worked. Then added some things more re-tested and I get the error again. Ahh, so I removed EXACTLY what I had just added. Re-tested. SAME ERROR - now it won't go away little matter what I delete!

    Crazier still is that I can always load in my other test SWF files and they have stock in them and they are set up exactly the same way - but they work...

    The entire site is new, so each SWF is CS3/AS3. I'm even not doing something crazy, so I'm pretty frustrated trying to build an AS3 all the site and I even do basic stuff...

    I can download/email the FLA files in question, if someone has the time to watch...

    Thank you
    Brandon

    It sounds ridiculous, but I think it had to do with the file names...

    I think that Flash CS3 has some problem with multiple file names using a hyphen, and start with the same word... I changed this:

    -test - container.swf
    -test - home.swf

    to do this:

    -test - container.swf
    -home.swf

    And rebuilt the home.swf from zero (new). And it seems to work now.

    Here, loads of test - container.swf the home.swf inside himself, I think he cannot know how to distinguish between the two because of the initial error in screaming "test_fla" rather than the name 'test-container_fla' or 'test-home_fla.

    Ugh.

  • (MX04) Pause a swf loaded with sound objects

    Hello

    I'm working on a presentation PowerPoint-esque where a user observes and listens to a swf loaded in the main sequence, click the button following (who unload the SWF, advances to the next section and load the next swf file), and the following watches. Make lather, rinse, repeat. Some articles are quite long, and I want to give the user the opportunity to take a break and play by click button.

    I know how to stop and start the MC container, but this does not prevent the sound object (and embedded CSM). I know how to make a break and start a sound object using the name of the instance of the object. Is there a way to pause the main story and keep the general enough so that any object sound stops when the user clicks on?

    Any help is most appreciated! MX04 and AS2.0.

    Thank you!

    you will need to list them all, or scroll through all the likely suspects with a loop (obj in mc).

  • FLASH AS2 main swf loaded swf playback controls

    Hello

    I have two swf files. The main (main.swf) swf that loads another swf (external.swf).

    The current code in my main swf that loads external swf file is:

    Stop();

    this.createEmptyMovieClip ("holder", 1);

    holder.loadMovie ("content/swf/M01/disclaimer.swf");

    The loaded swf file must unload on a click event, then the main swf movie should resume playing.

    The code in the swf file is:

    on (release) {}

    _level0.gotoAndPlay ("hideMSG");

    _parent.unloadMovie("content/SWF/M01/disclaimer.swf",1);

    }

    The external swf file loads and unloads perfectly, but the film does not seem to take over.

    When I try to use _level0.play, it seems to reload and restart the file main.swf.

    Any help would be greatly appreciated.

    Laura

    No, there is no downtime in this context, there is indeed a play(); which is exactly what I want.

    I managed to get it using variables instead of work.

    Thank you

    Laura

Maybe you are looking for

  • Upgrade memory for the L-series satellites

    I have just installed a new 512 memory card that works very well.Is it possible to include the old card 256 as well? After trying to do, he does not connect and I'm afraid to do damage. If possible someone please give me the proverbial 'idiots guide

  • HP Pavilion 550-055na: new disk will not install the new operating system

    Hello I bought a new HP Pavilion 550 - 055na with Windows 8 a month or two ago but want to use Windows 7. However, I decided that I will keep the hard, the PC came with, and have the option of Windows 8 in future if I want. So, I'm installing Windows

  • I erased from my hard drive and can not use Win 7

    I tried to delete Grub/Ubuntu and eventually remove Win 7. At least it will not start. And if I use my repair disc, that's not restore my Win 7. I get an error in the hard drive is bad, or the MBR needs to be reset. I did it today. When I insurt my r

  • BlackBerry Smartphones Instant messaging apps doesn't work is not on the torch 9860

    I have torch 9860 with os7. Instant mess like googletalk, msn mess apps and yahoo mess do not work on it. When I try to connect, it says 'service not enabled for this pocket'. pls help

  • Report of registration troubleshooting

    Hi allI'm trying to convert a report seeded with output to Excel but I when the ratio test is taking too much time to run and finish by mistake.I don't know that I made a few mistakes. I'll list the steps I have done.Report - asset register reportDev