2 Replies Latest reply on Jul 21, 2006 9:44 AM by JenMQui

    one button, two loaders

    JenMQui


      Hello.

      I have two loaders on a page that were created with use of the loader component provided by Flash.

      In the first, I am loading one external swf file. In the second loader, I am loading a different external swf file. One button is being used to activate both loaders simultaneously and relplace any contents that were loaded by a previous button click.

      The problem: the swf of the first loader fills both loaders at the same time, or I was earlier loading the first swf into both loaders on the first click and the second swf into both loaders on the second click of the same button, or nothing loaded anywhere, and so on.

      I have deleted the problematic action script for now since its been altered a few times and list what works to avoid any confusion I might cause. Could someone advise me on how to get the second loader to work properly with use of the same button. (loadermain id the inst. name of the first loader...all of my loaders have different inst. names. I've verified this correct.)


      btninst1.onRelease = function() {
      loadingtext._visible = true;
      startLoading("jenq_contact.swf");
      };

      function startLoading(whichImage) {
      loadMovie(whichImage, "loadermain");
      _root.onEnterFrame = function() {
      infoLoaded =
      loadermain.getBytesLoaded();
      infoTotal =
      loadermain.getBytesTotal();
      percentage =
      Math.floor(infoLoaded/infoTotal*100);
      loadingtext.text = percentage+"%";
      if (percentage>=100) {
      delete this.onEnterFrame;
      loadingtext._visible = false;
      }
      };
      }
        • 1. Re: one button, two loaders
          Level 7
          Here's a sample I made that might help you:
          http://www.smithmediafusion.com/blog/?p=31


          --


          Dan Mode
          *THE online Radio* http://www.tornadostream.com
          *Must Read* http://www.smithmediafusion.com/blog
          *Flash Helps* http://www.smithmediafusion.com/blog/?cat=11

          "JenMQui" <webforumsuser@macromedia.com> wrote in message
          news:e9jbdb$6f7$1@forums.macromedia.com...
          >
          >
          > Hello.
          >
          > I have two loaders on a page that were created with use of the loader
          > component provided by Flash.
          >
          > In the first, I am loading one external swf file. In the second loader, I
          > am
          > loading a different external swf file. One button is being used to
          > activate
          > both loaders simultaneously and relplace any contents that were loaded by
          > a
          > previous button click.
          >
          > The problem: the swf of the first loader fills both loaders at the same
          > time,
          > or I was earlier loading the first swf into both loaders on the first
          > click and
          > the second swf into both loaders on the second click of the same button,
          > or
          > nothing loaded anywhere, and so on.
          >
          > I have deleted the problematic action script for now since its been
          > altered a
          > few times and list what works to avoid any confusion I might cause. Could
          > someone advise me on how to get the second loader to work properly with
          > use of
          > the same button. (loadermain id the inst. name of the first loader...all
          > of my
          > loaders have different inst. names. I've verified this correct.)
          >
          >
          > btninst1.onRelease = function() {
          > loadingtext._visible = true;
          > startLoading("jenq_contact.swf");
          > };
          >
          > function startLoading(whichImage) {
          > loadMovie(whichImage, "loadermain");
          > _root.onEnterFrame = function() {
          > infoLoaded =
          > loadermain.getBytesLoaded();
          > infoTotal =
          > loadermain.getBytesTotal();
          > percentage =
          > Math.floor(infoLoaded/infoTotal*100);
          > loadingtext.text = percentage+"%";
          > if (percentage>=100) {
          > delete this.onEnterFrame;
          > loadingtext._visible = false;
          > }
          > };
          > }
          >


          • 2. Re: one button, two loaders
            JenMQui Level 1
            thank you Dan ......
            I the file was a help. My main clash was the loaders were both taking external swf files, behaving different than two loaders both taking from two different directions (like the library and and external).Now resolved.....