0 Replies Latest reply on Oct 8, 2009 6:18 AM by daftbloke

    unloading FlashPaper Document from Flash Movie

    daftbloke Level 1

      I'm using the following script to play a FlashPaper movie clip:

      // function: loadFlashPaper
      // ------------------------
      // Parameters:
      //   path_s: path of SWF to load
      //  dest_mc: Movie clip to hold the imported SWF
      //  width_i: New size of the dest movie clip
      // height_i: New size of the dest movie clip
      // loaded_o: (optional) Object to be notified that loading is complete
      function loadFlashPaper(path_s, dest_mc, width_i, height_i, loaded_o) {
      var intervalID = 0;
      var loadFunc = function(){          
      dest_mc._visible = false;          
      var fp = dest_mc.getIFlashPaper();
      if (!fp) {
      } else if (fp.setSize(width_i, height_i) == false)     {
      } else {
      dest_mc._visible = true; // Now show the document
      intervalID = setInterval(loadFunc, 100);

      // Function called once the FlashPaper SWF is embedded:

      function onLoaded(fp) {
      // We can now call the FlashPaper API functions.
      // Remove the standard user interface features:
      fp.showUIElement("PrevNext", true);
      fp.showUIElement("Print", true);
      fp.showUIElement("Find", true);
      fp.showUIElement("Tool", true);
      fp.showUIElement("Pop", true);
      fp.showUIElement("Zoom", true);
      fp.showUIElement("Page", true);
      fp.showUIElement("Overflow", true);
      // Some additional API features (here commented out):
      // Go to page:
      // fp.setCurrentPage(8);
      // Change the magnification to 50%:
      // fp.setCurrentZoom(50);

      // Now we're ready to start

      // Create the destination movie clip to hold the SWF:
      var theDocMC_mc = this.createEmptyMovieClip("theDocMC",100);

      // Position it on the stage:
      theDocMC_mc._x = -220;
      theDocMC_mc._y = -150;
      // Load the FlashPaper SWF into the clip,
      //   size it, and trigger the onLoaded() function:
      loadFlashPaper("MarketingDoc.swf", theDocMC_mc, 500, 350, this);

      Everything works fine on all pages including the page with the FlashPaper movie. The problem is after I visit the page with the FlashPaper movie my file starts to play through all the pages and wont stop.

      I'm new to flash and this has been driving me mad. Any tips would be greatly apprciated.

      files attached for example of my problem: