Load swf into movieclip // play pause buttons

I am going out of my mind trying to get this to work. I can do it in AS2 without a hitch - but not AS3.
I just need to load an external swf file into an empty movieclip. Then I have 2 buttons play and pause that need to be on the top layer of the new movie and they need to play and pause the loaded swf file.
I have tried a number of things and nothing is working. Please help.
Thank you in advance.
Shawna

you can use:
var ldr:Loader=new Loader();
addChild(ldr);
ldr.load(new URLRequest("yourswfthatyouwanttoload.swf"));
addChild(yourplaybtn);
addChild(yourpausebtn);
yourplaybtn.addEventListener(MouseEvent.CLICK,playF);
yourpausebtn.addEventListener(MouseEvent.CLICK.pauseF);
function playF(e:Event){
MovieClip(ldr.content).play();
function pauseF(e:Event){
MovieClip(ldr.content).stop();

Similar Messages

  • Controling a loaded swf into movieClip

    help!!
    i have loaded a {slide swf} into a movieClip .. on stage ..
    using the
    var loader:MovieClipLoader();
    using a button movie clip the is embeded into a seperate swf
    file that is loaded in at run time
    but the {slide swf} is runing a Interval that i need to clare
    ... so is there a way to talk to swf file after you load it into a
    movie Clip how do you address that

    var kglad : Master = new Master();
    Kglad .onReply=function(){
    " you are on to somthing big [ only the second picture fade
    in and thats where it stop ] it deos not seem to bee loading any
    more ... but when you click the next _btn.
    the caption keep changing ... but pictures don't change
    "........ i am sending you a better view of what ihave
    done<<<<<<<<<<start... // create
    variables
    var x:XML = new XML();
    x.ignoreWhite = true;
    var urls:Array = new Array();
    var captions:Array = new Array();
    var captions2:Array = new Array();
    var whoIsOn:Number;
    //XMl function
    x.onLoad = function() {
    var photos:Array = this.firstChild.childNodes;
    for (i=0; i<photos.length; i++) {
    urls.push(photos
    .attributes.url);
    captions.push(photos.attributes.caption);
    captions2.push(photos
    .attributes.caption2);
    holder.loadMovie(urls[0]);
    caption.text = captions[0];
    caption2.text = captions2[0];
    whoIsOn = 0;
    //Load XML
    x.load("pics/kingslandMarks/lmlist.xml");
    // The Button envents
    previous.onRelease = function() {
    clearInterval(nInterval);
    if (whoIsOn>0) {
    whoIsOn--;
    holder.loadMovie(urls[whoIsOn]);
    caption.text = captions[whoIsOn];
    caption2.text = captions2[whoIsOn];
    next.onRelease = function() {
    if (whoIsOn<urls.length-1) {
    whoIsOn++;
    clearInterval(transitionI);
    transitionI = setInterval(transitionF, 50, wholsOn);
    caption.text = captions[whoIsOn];
    caption2.text = captions2[whoIsOn];
    function transitionF(index) {
    if (!fadedOut) {
    holder._alpha -= 4;
    if (holder._alpha<0) {
    fadedOut = 1;
    holder._visible = 0;
    } else {
    if (!loadStart) {
    holder.loadMovie(urls[whoIsOn]);
    loadStart = 1;
    if (!loadComplete) {
    if (holder.getBytesLoaded()>0 &&
    holder.getBytesLoaded()>=holder.getBytesTotal()) {
    holder._visible = true;
    loadComplete = 1;
    holder._alpha = 0;
    } else {
    holder._alpha += 4;
    if (holder._alpha>=100) {
    clearInterval(transitionI);
    /*next.onRelease = function() {
    clearInterval(nInterval);
    if (whoIsOn<urls.length-1) {
    whoIsOn++;
    holder.loadMovie(urls[whoIsOn]);
    caption.text = captions[whoIsOn];
    caption2.text = captions2[whoIsOn];
    var s;
    //Experimenting with auto play slide show
    var nInterval:Number;
    autoPlay();
    function autoPlay() {
    function neXt():Void {
    if (whoIsOn<urls.length-1) {
    whoIsOn++;
    holder.loadMovie(urls[whoIsOn]);
    caption.text = captions[whoIsOn];
    caption2.text = captions2[whoIsOn];
    if (whoIsOn == urls.length) {
    clearInterval(nInterval);
    whoIsOn = 1;
    function prEv() {
    if (whoIsOn>0) {
    whoIsOn--;
    holder.loadMovie(urls[whoIsOn]);
    caption.text = captions[whoIsOn];
    caption2.text = captions2[whoIsOn];
    auto.onRelease = function() {
    nInterval = setInterval(neXt, 2000);
    this._visible = false;
    sTop._visible = true;
    if (whoIsOn<urls.length-1) {
    whoIsOn++;
    holder.loadMovie(urls[whoIsOn]);
    caption.text = captions[whoIsOn];
    caption2.text = captions2[whoIsOn];
    sTop.onRelease = function() {
    clearInterval(nInterval);
    this._visible = false;
    auto._visible = true;
    //try to fade the movieClip holder
    function fade():Void {
    holder._alpha -= 5;
    if (holder._alpha == 20) {
    holder._alpha = 100;

  • Loading swf into movieclip object

    I am trying to load a swf file into a movieclip object on the
    stage. The movieclip object is sized smaller than the screen, and
    placed in the middle. I have defined a loader with:
    var myMovieClipLoader:MovieClipLoader = new
    MovieClipLoader();
    then use it like this:
    _level0.myMovieClipLoader.loadClip("moviename.swf",
    _level5.movieclipinstancename);
    (the movieclip object is used in a swf loaded in level5)
    When I load the swf like this, the swf loads at the correct
    location according to where I have placed the movieclip object,
    however it "blows up" to fill the screen from that point down and
    across, ignoring the size of the movie clip object (the loading swf
    actually expands beyond it's created size to fill the screen,
    making all the graphics and text much larger than intended). The
    actual pixel size of the swf I'm trying to load matches the size of
    the movieclip object (1024x350 in a 1280x1024 screen).
    What is the magic setting or property that will tell the
    loading swf to honor the size of the movieclip object I'm loading
    into?
    Thanks for your help!
    Barb

    Something I've been working on:
    Place the following code in a new file <your project
    folder>\as\MovieContainer.as
    Then open the properties for the symbol you want to be your
    movie container
    Set the AS 2.0 Class to as.MovieContainer and give it a name
    (I named mine 'loader').
    To load the movie, simply call:
    loader.queueSWF('my.swf');
    Hope that makes sense. Basically, it's just a self contained
    class for loading into an object on the scene. It draws a simple
    progress bar on the center of the symbol when it's loading and it
    resizes the loaded object on init to conform to the size of the
    object on the stage. Why queueSWF? Well, if it's currently loading
    a SWF, it will wait till it's finished and load a new one. The
    biggest problem right now is the progress bar, but it's fairly easy
    to remove if you don't like it. Hopefully it helps.
    If anyone else is reading this. I'm trying to figure out if I
    can load these movies into an array of movieclips. So far I've had
    no luck. If you know of a way, feel free to drop some input.

  • When time line reaches a certain frame load swf into movieclip.

    Hi,
    I need some help with some actionsscript. When the timeline reaches a certain frame, I want an swf to load into a movieclip in that particular frame. I need this to occur on level 1 as the root of the site is pre loader. Any help would be much appreciated. Cheers

    In that frame, on an actions layer, use either the loadMovie method or the MovieClipLoader.loadClip method to load the swf into the movieclip.  There should be examples of using either in the help documents and via Google.

  • Play/Pause Button in AS3

    I have search the internet, but I cannot find a simple way to
    create a play/pause button in AS3. All the solutions I find are for
    older versions when buttons could have actionscript directly
    applied to them.
    I created a flash animation and exported it as a .swf to work
    with only one layer in a new .fla file. I have three layers
    created, button, video, and actionscript. What I need is a button
    that will look like a pause button when the animation is playing
    and to pause the animation when clicked. It would be nice if it
    could also switch to a play button when paused.

    I made a movieclip (ppBtn) with 2 frames. The first has the
    pause button and the frame label 'pause'. The second frame has the
    play button, 'play'. I placed your script into the action layer.
    When I preview the animation, the buttons just alternate really
    fast and have no fuction.

  • Removing client's ability to use play/pause button

    Hi all
    I am keen to use Presenter to put together a language listening test for some clients. My clients want their students to not be able to pause the presentation so, say, they can't pause, translate word, pause, translate word and so on. In order to do this, I need to remove or lock the Pause/Play button that appears in the skin of a Presenter module.
    I realise I can completely remove the Player bar by opening up the vconfig.xml file and changing the value next to <uishow name="playbar"> to false. This is a quick and dirty solution and may do the trick. However, I would like the students to still be able to see the time count down for each slide in the player bar. Why? Well, because my clients want their students to listen to an audio track, receive one minute's thinking time and then go on to answer a question about the track. The students should know how much time they still have available. This means somehow either removing the Play/Pause button or at least locking down its functionality.
    I'm not a Flash wiz (though I do have it) but I don't mind making changes to a few codes here and there. I just need to know which file/s and which code.
    Your thoughts/expertise would be greatly appreciated. Thanks in advance
    Peta

    Hi Peta,
    You're right...you could hide the playbar by setting that value to "false", but as you have no doubt already seen, that modification eliminates everything, which won't totally solve your problem.
    Since you have Flash, I'd recommend that you create a simple .swf file that will ultimately hide the Play/Pause button in the playbar area of Presenter content.  I'll be honest...I haven't "locked" the Play button, but that might be something to investigate IF what I'm proposing here doesn't do the trick for you.
    So here we go....
    In Flash, create a small stage area and on frame one in your timeline add the following:
    this.onEnterFrame = function () {
    _root.m_controlBar.m_playBtn._visible= 0;
    Save the Flash file as "playBtnKill.fla" and then publish it.  Then head back to PowerPoint and add the swf to the first slide in a presentation using Presenter's Import Flash function.  Publish the content and the Play button should be gone!
    Programming NOTE: because Presenter is set up for Flash Player 6/7/8, its best to code everything using Flash Player 6 / Actionscript 2.0 as the coding environment.
    A couple of things to keep in mind about this:
    First, by placing the swf file on the first slide of your PPT deck, the Play button will be affected for the entire duration of your presentation.  If you need it to show / hide / show /hide periodically throughout the deck, then you might want to think about how you want to handle the overall stucture of your course.  Meaning, that what might work is to kill off the Play button entirely, but use a PowerPoint graphic (that looks like a Play button) and then time that object to appear after a certain amount of time.  Of course, then you'd have to hyperlink the PPT object to the next slide in your deck so that folks will be given an opportunity to advance to the next slide.
    Second, since your intention is to remove the Play button, you should probably leave the "Advance by user" feature set to "NO", otherwise you will ahve to provide some mechanism of navigating from slide to slide (as mentioned above).  At least this way, by the time you've reached the end of the audio for a slide, the presentation will automatically advance.
    Hope that helps!
    Rob
    http://www.robrode.com/yabb/

  • Is it possible to add audio with a simple play/pause button and also have a clickTag attached to the full stage?

    my client wants to add audio to their banner ad (which always has a full stage clickTAG set). I'm trying to figure out a way to just use a simple play/pause button and attach a toggle action to it. Problem is when the user clicks it's going to the clickTAG URL that's attached to the full stage. Is there any way around this?
    Please advise and thank you in advance.

    I have the same issue. It is pretty annoying but at least the audio remains within the motion project. It just isn't accessible it seems as an FCPX template. So what I'm doing is this:
    I still use the video within FCPX's generator section so that you can edit the parameters as you need to
    For the audio, open the project in motion then under Share, click 'Export Audio'. Select 'CAF' format and save to your hard disk
    I then import the audio file into an event I set up specifically for this purpose (per BenB's suggestion).
    When I need it, I then insert the generator from the generators section and then attach the audio file below the primary story line for the audio track
    It isn't pretty but it works.

  • When I was setting up the language Setting, I pressed the play/pause button three times and now the voice that talks you through everything speaks extremely fast. How do I get her to speak slower?

    When I was setting up the language Setting, I pressed the play/pause button three times and now the voice that talks you through everything speaks extremely fast. How do I get her to speak slower?

    Hi Magsrobby,
    Welcome to the forum and thanks for posting. I'm really sorry to hear you've had so many problems. I can look into this for you if you wish. Drop me an email with the details. You'll find the "contact us" form in the about me section of my profile. Once I have the details we'll take it from there.
    Cheers
    David
    BTCare Community Mod
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry but we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)

  • Creating a Simple Flash Movie With Poster Frame and Play/Pause Buttons

    Hi, It's been over a year since I played with Flash last, and
    I have completely forgotten everything I learned.
    I have a .flv file which I want to play on my website. It
    should display a poster frame when the page load, and not autoplay
    the movie. It should have the play button I made in photoshop
    sitting on top of the poster frame. When pressed, the movie should
    start playing and the button should be shifted for the pause button
    I made in PS (it should work just like the play/pause button in
    iTunes). When the movie has finished playing, it should jump back
    to the poster frame.
    I have tried using the flvplayback component and also played
    around with just embedding the flv directly and inserting a play
    and pause button from the common library, but I can't seem to get
    it to work. With the flvplayback component I have managed most of
    it apart from using my own buttons and getting the poster frame to
    work (which apparently has to be done with Action script).
    Any help appreciated.

    Which version of Flash/actionscript are you using? Since you
    are just starting out, you should read one of Adobe's tutorials on
    the matter. Either use Flash Help to find examples on how to use
    Flash or go to their website. Here is a great tutorial for someone
    just starting out. Make sure you read all three tutorials in "Using
    Flash for the first time".
    http://www.adobe.com/devnet/flash/getting_started.html

  • My menu button is working like the play/pause button

    What should I do? Restoring it didn't work when I did it with iTunes and I can't restore it on it's own because the menu button doesn't work properly.

    Hello DatCanadianGuy,
    It sounds like you are unable to use your Menu button as expected because it acts as if it were a play/pause button. I would try restarting the device first by holding the actual play/pause button down to see if that turns it off.
    If it does not, and you have done the restore per this article:
    How to restore your iPod:
    1. Make sure you've reinstalled the latest version of iTunes.
    2. Open iTunes, and then connect your iPod to your computer.
    3. After a few moments, it will appear in the source list in iTunes. If the iPod's display doesn't show "Connected" or "Do not disconnect" you may need to put the iPod into disk mode to proceed.
    4. Select your iPod in the source list and you will see information about it appear in the Summary tab of the main iTunes windows.
    5. Click the Restore button. You will be prompted with one or more restore options that may prompt iTunes to automatically download of the latest iPod Software. The 4 possible restore options are:
    Restore Option 1: Restore - Restores with same iPod Software version already on iPod.
    Restore Option 2: Use Same Version - Restores with same iPod Software version already on iPod even though a newer version is available.
    Restore Option 3: Use Newest Version - Restores with the latest iPod Software on your computer.
    Restore Option 4: Restore and Update - Restores with the latest iPod Software on your computer.
    Note: For Mac users, A message will appear prompting you to enter an administrator's name and password.
    6. A progress bar will appear on the computer screen indicating that the first stage of the restore process has started. When this stage is completed, iTunes will instruct you to leave iPod connected to your computer to complete restore.
    7. During the stage 2 of the restore process, the iPod will show an Apple logo as well as a progress bar at the bottom of the display. It is critical that the iPod remains connected to the computer or iPod Power adapter during this stage. Note: The progress bar may be difficult to see since the backlight on the iPod display may be off.
    8. After stage 2 of the restore process is complete and the iPod is connected to the computer, the iTunes Setup Assistant window will appear asking you to name your iPod and choose your syncing preferences similar to when you connected your iPod for the first time.
    From: iPod classic Troubleshooting Assistant
              http://www.apple.com/support/ipod/five_rs/classic/#
    I would next seek service for the iPod:
    Service Answer Center - iPod
    http://support.apple.com/kb/index?page=servicefaq&geo=United_States&product=ipod
    Thank you for using Apple Support Communities.
    Regards,
    Sterling

  • Central Play/Pause button

    Is there a way to have one 'Central' Play/Pause button in Captivate?  I have inserted 4-5 video files into Captivate and either have "Autoplay" selected or leave the control to the end user in the skin.  However, when that user presses pause on the Captivate playbar the video file will keep playing if I select "Autoplay."  If I don't select "Autoplay" then there are two play/pause buttons (one controlling the video file and the other the whole captivate project)...is there a way to combine these two play/pause buttons into one central play/pause button?

    Sounds like your videos were inserted as Event videos.  Look into trying inserting them as Slide videos instead.  Then you lose the skin on the video but the playback bar for the entire module will pause the videos as well.

  • MediaController Play Pause button skin change?

    Iam using MediaController.MediaController.associateDisplay(MediaDisplay). when i click the ButtonXX, MediaController.click() method called threw. It is fine But MediaController Play Pause button skin does not change? it is allways show play symbol.  how can i change Play Pause button skin?

    Hi Chris,
    Most of the content I create is deployed through a LMS which
    has its own flash based controls used to navigate through the
    content.
    This means that i do not use any of the captivate toolbar
    controls, but rather build the navigation buttons into the
    captivate screen itself.
    This has elliminated the issues you are discussing and seems
    to result in a more polished end result . . . something to consider
    perhaps?
    Cheers,
    Matt.

  • Play/pause button problem on

    So sometimes the button just doesnt work. I finally figured out when and why. It only happens when I have my Belkin FM tunecast 2 transmitter plugged into it. Once I take that out and put the headphones back in, the play/button works just fine. Why that happens you ask? I have no idea!!!

    I also have a TuneCast II and have no issues with it. That is unless I unplug it. Then I get the same result as unplugging the headphones.
    Here is what I posted a couple days ago in a topic titled.
    [Micro] Back Button Only Works w/ Headphones Attached
    OK. Here is what I have noticed as of late regarding this issue.
    . If I turn on the Micro WITHOUT anything plugged into the headphone jack I get this. All buttons are NON responsi've for a couple of seconds. Then All but the Play/Pause button become responsi've but at a lesser level than my prefs are set for. The Play/Pause button WILL not do anything. It is not recognized.
    2. If I plug something into the headphone jack all buttons then become fully responsi've at the level I have set in the prefs. Play/Pause functions normally.
    3. If I then remove the cable from the headphone jack the Play/Pause button once again becomes NON responsi've and the other buttons return to a less responsi've state.
    4. Reinserting a cable results in full responsi'veness again.
    Is this intentional in the firmware? It seems to make sense that if nothing is connected to the headphone jack then there realy is NO reason for the Play/Pause button to function or any button for that matter. Is this possibly a measure to preserve battery life incase of accidental power on?
    Oh. I have done similar tests while connected to my PC via only USB and had similar results. It seems that the Micro is only fully responsi've when a cable of some sort is connected to it.
    Anyone have any ideas? I would especially like to hear from Jeremy or Cat.Message Edited by MicroZealot on 04-2-2005 :5 PMMessage Edited by MicroZealot on 04-2-2005 :53 PM

  • Play/Pause Button no longer working

    I updated to iTuned version 11.1 so I could update my phone to iOS 7.  Now the Play/Pause button on my mac no longer works.  Not only that, but the same button on my external keyboard doesn't work as well. Even if iTunes is the window I am currently on, nothing.  Wondering if anyone else is having this problem.

    Didn't know this but just tested on my Apple TV v3-rA and pressing and holding play/pause does put it into sleep mode.
    Thanks for sharing that, it's not 5 seconds mind you, it only took 2-3 for me.

  • Add a play/pause button on old Macbook

    I got pretty used to have a play/pause button on my new iMac. But as I still have an old Macbook Pro (the first Intel core duo 2006 model) Apple didn't make buttons on the keyboard to navigate through your media in iTunes or Spotify or whatever media program is active.
    I'd like to add a play/pause functionality to my F11 and a forward functionality to my F12 button. I've managed to do so in system preferences > Application Shortcuts. But the thing is that the buttons only work if the program (I'm mainly using Spotify at the moment) is active. I want to make these buttons in all other programs (just like the play/pause buttons on new Macs). How can I do that?
    PS: I don't mind using terminal for this.

    Does anyone know if it's impossible?

Maybe you are looking for

  • OS 3.1.2 Update didn't fix the "updating library, please wait a few minutes

    I was hoping that the software update would fix the "Updating library, please wait a few minutes" screen that comes up when I try to play a song on my ipod touch after syncing. Is this bizarre "updating library" delay going to be a permanent feature

  • Pattern Question

    Hi. I'm creating a laurel wreath in illustrator, such as this image (top left) http://www.istockphoto.com/file_thumbview_approve/4690114/2/istockphoto_4690114-laurel-wre ath.jpg However, on mine, the leaves gradually get smaller, from bottom to top.

  • Iphone 4 does not connect to itunes

    anyone knows solution, my iphone does not appear on the itunes, reloaded everything twice, nothing... help

  • Use of jdbc-class-ind-value

    Hi, I have 2 questions about jdbc-class-ind-value attribute. First it is not clear what are the allowed value types: number, single chars, full strings ? Second, as stated in chapter 7.8.2 of the manual, application should ensure that all the classes

  • Video Icon missing. How do I get it back?

    My Iphone 3g used to have the icon "videos". It is gone now. How do I get it back? I have sync'd and restored right back to factory to see if I can get it back. It is the icon at the bottom betweem the "music" and "photos" icon. Cheers