2 Replies Latest reply on Jun 25, 2010 8:22 AM by Jens Peermann

    Frame Labels don't work

    Jens Peermann Level 2

      I use frame labels with the "gotoAndStop" function. When I use a frame's number the function is executed properly. When I use the label.s name I get a dialog saying "1120: Access of undefined property (label name)".

       

      Never had that problem before and I can't think of anything I did different this time.

       

      Any help appreciated. Thanks

        • 1. Re: Frame Labels don't work
          Ned Murphy Adobe Community Professional & MVP

          Show the code that is causing the problem.

          • 2. Re: Frame Labels don't work
            Jens Peermann Level 2

            Here is the code for the whole document:

             

             

            //The main timeline has the "preloader" movie clip on frame 1, the "logo" movie clip on frame 2 and the "about" movie clip on frame 4. Frame 3 is for spacing only.

             

            ON MAIN TIMELINE FRAME 1:

             

            stop();

             

            this.addEventListener(Event.ENTER_FRAME, loading);

             

            function loading (event:Event):void

            {

            var total:Number = this.loaderInfo.bytesTotal;

            var loaded:Number = this.loaderInfo.bytesLoaded;

             

            if (loaded == total)

            {

            this.removeEventListener(Event.ENTER_FRAME, loading);

             

            gotoAndStop(2);

            //This is the version that works. If I replace the "frame number with a name that is identical to the frame's label name it will not work.

            }

             

            }

             

             

            ON MAIN TIMELINE FRAME 2:

             

            stop();

             

            function about(e:MouseEvent):void

            {

            gotoAndStop(4);

            //This is the version that works. If I replace the "frame number with a name that is identical to the frame's label name it will not work.

            }

             

            function logoreturn(e:MouseEvent):void

            {

            gotoAndStop(2);

            //This is the version that works. If I replace the "frame number with a name that is identical to the frame's label name it will not work.

            }

             

             

            ON "LOGO" MOVIE CLIP:

             

            //The "logo" movie clip has a slideshow and the "aboutlogo" button which moves the main timeline to frame 4 where the "about" movie clip sits.

             

             

            stop();

             

            function goBack(event:MouseEvent):void

            {

            if(currentFrame == 1)

            {

            gotoAndStop(totalFrames);

            }

            else

            {

            prevFrame();

            }

            }

             

            function goForward(event:MouseEvent):void

            {

            if(currentFrame == totalFrames)

            {

            gotoAndStop(1);

            }

            else

            {

            nextFrame();

            }

            }

             

            back_btn.addEventListener(MouseEvent.CLICK, goBack);

            next_btn.addEventListener(MouseEvent.CLICK, goForward);

             

            aboutlogo_btn.addEventListener(MouseEvent.MOUSE_UP, MovieClip(this.parent).about);

             

             

             

             

            ON "ABOUT" MOVIE CLIP:

             

            //The "about" movie clip has the "whatislogo" movie clip on frame 1, the "branding" movie clip on frame 5 (frame 2-4 for spacing only), and the "logoreturn"button which moves the main timeline to frame 2 where the "logo" movie clip sits.

             

             

            stop();

             

            logoreturn_btn.addEventListener(MouseEvent.MOUSE_UP, MovieClip(this.parent).logoreturn);

             

             

            function branding(e:MouseEvent):void

            {

            gotoAndStop(5);

            //This is the version that works. If I replace the "frame number with a name that is identical to the frame's label name it will not work.

            }

             

            function whatislogo(e:MouseEvent):void

            {

            gotoAndStop(1);

            //This is the version that works. If I replace the "frame number with a name that is identical to the frame's label name it will not work.

            }

             

             

             

             

            ON "WHATISLOGO" MOVIE CLIP:

             

            //The "whatislogo" movie clip has the "brand" button which moves the "about" movie clip's timeline to frame 5 where the "branding" movie clip sits.

             

             

            brand_btn.addEventListener(MouseEvent.MOUSE_UP, MovieClip(this.parent).branding);

             

             

             

             

            ON "BRANDING" MOVIE CLIP:

             

            //The "branding" movie clip has the "whatislogo" button which moves the "about" movie clip's timeline to frame 1 where the "whatislogo" movie clip sits.

             

             

            whatislogo_btn.addEventListener(MouseEvent.MOUSE_UP, MovieClip(this.parent).whatislogo);

             

             

            I have used several different names for the frame labels and corresponding event listener to make sure the same word doesn't exist somewhere else in the code and cause the conflict. That didn't solve the problem though.