4 Replies Latest reply on Mar 28, 2008 12:45 PM by Mark60480

    Progress bar troubles

    Mark60480 Level 1
      I'm trying to include a progress bar for my swf, but it's not working.I'm trying to include a progress bar for my swf - but it's not working. Can someone tell me what I'm doing wrong? I dragged the "loader" component to the stage and gave it an instance name of mk_ldr. I then dragged the "ProgressBar" to the stage and gave it an instance of mk_pb. My swf , called MovieKings.swf is in the same folder as the fla. Here is the code I put in frame one of the root timeline:
      mk_ldr.contentPath = "MovieKings.swf";
      mk_pb.source = mk_ldr;

      Am I missing something?
        • 1. Re: Progress bar troubles
          RossRitchey Level 4
          swap those lines of code. Essentially, you want to assign mk_ldr as the source to the progress bar BEFORE you tell the loader to load something.

          Another way would be to do it in the parameters of mk_pb at design time. To do this, select the progress bar instance on the stage, go to the parameters tab of the properties panel and enter mk_ldr as its source.

          I believe Flash will also recognize when you drag a new instance from the library over something that can be the source and automatically set the source for you. I know that works for the UIScrollBar anyways.

          If setting the source before the contentPath doesn't work, then you may need to use mk_ldr.load("MovieKings.swf") to get the progress bar to work.
          • 2. Re: Progress bar troubles
            Mark60480 Level 1
            What I'm getting is a feedback loop of the first part of the swf. Perhaps I should have specified that the progress bar is inside the same swf that I'm referencing (MovieKings.swf). Is that my problem? Do I need to specify something inside the swf (such as the first movieclip that plays) to the loader? If so, how is that coded? I see this all the time on the web, so it shouldn't be difficult.

            BTW - thanks again for all your help.

            Mark
            • 3. Re: Progress bar troubles
              RossRitchey Level 4
              So, the progressbar (mk_pb) is inside of MovieKings.swf, correct? You will need the progress bar to be in the loading FLA in order to get it to work correctly. This is because, if the progressbar is inside of MovieKings.swf, then MovieKings.swf will need to be loaded into the Loader before the progress bar can watch it, thereby negating the purpose of having a progress bar.

              For other reference, the correct path to mk_pb if it is inside of MovieKings.swf would be "mk_ldr.content.mk_pb" which points to the Loader object's content before looking for mk_pb.
              • 4. Re: Progress bar troubles
                Mark60480 Level 1
                Sorry for my ignorance about this. What I hearing is that I need 2 swfs for this site. Or can I have it in the same swf if I use the "mk_ldr.content.mk_pb" code. If so, could you please give me the entire code. Thanks again!