10 Replies Latest reply on Aug 3, 2006 9:12 PM by

    shared library problem

      Hi,
      I have a swf (intro.swf) which shares few Bgs from a shared library(sharLib.swf) and all the contents are placed in the 2nd key frame of intro.swf.

      I'm loading intro.swf in the main stub. onLoadInit, I'm moving the playhead to the 2nd key frame by gotoAndStop(2).

      Here is the problem, when I check for the '_currentframe' of the intro.swf by a enterframe function , it shows _currentframe is '0' and nothing I can view when publish the stub or by ctrl+enter.

      But when I run the stub.swf by double click, its works fine.

      Whats the problem? why the _currentframe shows ''0''? and why Its not working when I ctrl+enter?

      This will be a great help if anyone make it clear.

      Thanks in advance.
        • 1. Re: shared library problem
          kglad Adobe Community Professional & MVP
          are you checking for _currentframe by using the trace() function and are you publishing for flash 6 or earlier?
          • 2. Re: shared library problem
            Thanks for the reply kglad. And yes I'm checking the _currentframe using a trace() function inside onLoadInit function. I'm not publishing it for flash 6 or earlier but for flash 7.

            Actually, the onLoadInit function will be triggered when the loaded swf reached its 1st frame right?
            But here the onLoadInit function being called before it reached the 1st frame of the loaded swf.(In this onLoadInit I have the action gotoAndStop(2) and its not performing)

            Looking for ur reply.
            • 3. Re: shared library problem
              kglad Adobe Community Professional & MVP
              onLoadInit() executes when downloading completes (ie, all frames etc) and your loaded swf is instanced. so, if your code were correct you could access frame two of the loaded swf.

              and i can't envision any circumstance where anyMC._currentframe would trace 0. it would be greater than or equal to 1 or undefined. show your onLoadInit() code.
              1 person found this helpful
              • 4. Re: shared library problem
                Hi Kglad,

                I've a stub file which has 2 mcs to load external swfs.
                The stub file has the following code in the 1st frame.
                //----------------------------------------------------
                sharLib_mcl = new MovieClipLoader ();
                sharLib_lis = new Object ();
                sharLib_lis.onLoadInit = function ()
                {
                loadSwf_fn ();
                };
                // load the shared library at first
                sharLib_mcl.loadClip ("sharLib.swf", sharLib_mc);//loads shared library
                sharLib_mcl.addListener (sharLib_lis);

                function loadSwf_fn ()
                {
                swfLoader_mcl = new MovieClipLoader ();
                swfLoader_lis = new Object ();
                swfLoader_lis.onLoadInit = function (tar:MovieClip)
                {
                tar.gotoAndStop (2);
                trace("frame:" + tar._currentframe)//this trace shows _currentframe is 0 and tar not moving to 2nd frame.
                };
                swfLoader_mcl.loadClip ("actFile.swf", swfLoader_mc);
                swfLoader_mcl.addListener (swfLoader_lis);
                }
                //----------------------------------------------------end of code-------------------------------

                The actFile.swf have a bg in the 1st frame that is shared from sharLib.swf.

                looking for ur reply.

                • 5. Re: shared library problem
                  kglad Adobe Community Professional & MVP
                  you see frame:0 in the output window and there's no other trace() statement in your fla that could be causing that? if true, post a link to your fla.

                  btw, do you try and use any library movieclips from sharLib.swf because that's not the way to use a shared library?
                  1 person found this helpful
                  • 6. Re: shared library problem
                    Hi Kglad,

                    I've given my flas in the following path and looking for ur idea.
                    I'm using this for an online purpose.

                    Source: http://www.flashofscarlet.com/Downloads/Source.zip

                    Thanks.
                    • 7. Re: shared library problem
                      kglad Adobe Community Professional & MVP
                      the problem is the bitmap test in act.swf. you have it set to import something from sharLib.swf.
                      • 8. Re: shared library problem
                        Hi Kglad,

                        I'm not clear with ur answer. Can u please explain in detail to overcome the problem?

                        Thanks
                        • 9. Re: shared library problem
                          kglad Adobe Community Professional & MVP
                          to remedy, untick import for runtime sharing.
                          1 person found this helpful
                          • 10. Re: shared library problem
                            Then, I'll no more share the image from the sharLib.swf. I'm using this for an online activity and I need to use shared library in order to reduce the file size.