Skip to main content
September 2, 2009
Question

Play - Pause button for external .swf?

  • September 2, 2009
  • 1 reply
  • 2021 views

I'm trying to create buttons so a viewer can pause and then play an externally loaded swf. My project can be accessed at the linke below. This is how I want the project to function

     -Click a room on the building (choose Accounting for this discussion)

     -Click one of the demo options (choose Ending a Period for this discussion)

     - Now that the demo plays, I want the user to be able to play and pause the demo swf.

The demo .swfs were created in Captivate so I don't have access to their timeline. They are loaded into an empty Loader component using the MovieClipLoader Class. Can anyone post some possible solutions to this problem? Thanks!

http://distribution.activant.com/demos/prophet21-on-demand/

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
September 2, 2009

you can reference the main timeline of the loaded swf by using the load target movieclip of your loadClip() method.

September 2, 2009

What would that look like? Right now they're loading using the following code:

btnCashCollect_btn.onRelease = function () {
      mcLoader.loadClip("CashCollections.swf",myLoader);
      btnEndPeriod_btn.enabled = false;
      btnCashCollect_btn.enabled = false;
      btnFinancialMGMT_btn.enabled = false;
      _root.btnHome_mc._visible = false;
}

So would I use something like:

btnPause.onRelease = function() {

     myLoader.content.pause();

}

Actually I just tried that and it didn't work...I need the buttons to work for multiple external swfs that will be loaded into myLoader

kglad
Community Expert
Community Expert
September 2, 2009

btnCashCollect_btn.onRelease = function () {
      mcLoader.loadClip("CashCollections.swf",myLoader);
      btnEndPeriod_btn.enabled = false;
      btnCashCollect_btn.enabled = false;
      btnFinancialMGMT_btn.enabled = false;
      _root.btnHome_mc._visible = false;
}

So would I use something like:

btnPause.onRelease = function() {

    myLoader.stop();

}