4 Replies Latest reply on May 1, 2006 11:19 AM by pow_haaweeese

    help w/behaivior button error _ presentation doc

    pow_haaweeese
      Hi I'm learning action script but new to trouble-shooting.

      set up a button on main presentation page of my flash 8 pro presentation file.
      used the behaivior:

      >screen
      >go to slide
      then chose slide numbers. (works fine in a plain, new doc) but on all of my ten buttons I get the following errors:

      **Error** Screen=presentation, layer=buttons, frame=1:Line 4: ')' expected
      if((this.01 != undefined) && (this.01 != null))

      So trying to decifer this....went back and "named" each botton thinking it was instance related. but still won't nav from the ten individual buttons I've made to the ten different "slide" pages.

      any help you may be able to translat this to give me a place to start to solve this....my file complete...looks good..and will nav thru the two arrow buttons I've made "go to previous" and "go to next" ....but the buttons that are supposted to allow a use to go to any of the ten pages does nothing.

      Thanks for your help

        • 1. Re: help w/behaivior button error _ presentation doc
          Bishop[Neo]
          Kinda hard to help with that little bit of information. Is it possible to cut-n-paste at least the 5-6 lines before the one listed in the error? I'm guessing it's not actually the line you pasted but is actually something above that one (possible even below but more unlikely) that is missing something and causing Flash to burp.
          • 2. Re: help w/behaivior button error _ presentation doc
            pow_haaweeese Level 1
            Hi Neo,
            Having taken a 3-day, all-day actionscript class, I realize how indepth this prgm is, and I know this is a simple thing, and totally operator error.

            heres the whole error window:

            **Error** Screen=presentation, layer=buttons, frame=1:Line 4: ')' expected
            if((this.01 != undefined) && (this.01 != null))

            **Error** Screen=presentation, layer=buttons, frame=1:Line 4: ')' expected
            if((this.03 != undefined) && (this.03 != null))

            **Error** Screen=presentation, layer=buttons, frame=1:Line 4: ')' expected
            if((this.02 != undefined) && (this.02 != null))

            Total ActionScript Errors: 3 Reported Errors: 3

            _______


            I've only assigned behaiviors to the first three buttons. The individual "slides" in the flash 8 pro presentation are named simply: 01, (for first slide) 02 (for second) 03, etc...I can see them in the code. The instance names when I click on each "slide" are also 01 (for first slide) 02 (for second) etc... The wierd thing is the arrow keys. They are duplicates of the same buttons that the numbers are, and they work with the "next" and "previous" behaiviiors. but....also weird, I made a new (simple, clean, no rollover) button on the "master" presentation page, and used the >screen >go to slide feature....and it still did not work. I thought it the buttons...but...now not sure...

            any thoughts?
            • 3. Re: help w/behaivior button error _ presentation doc
              Bishop[Neo] Level 1
              Sorry pow, I actually meant that you should post the actual AS code. Better would be a copy of the .fla but the forums don't let you.

              Toss up the AS and I'll take a look.
              • 4. Re: help w/behaivior button error _ presentation doc
                pow_haaweeese Level 1
                Opps.>smile_so here's a non-working button itself (02) :


                on (release) {
                // GoTo Screen behavior
                if((this.02 != undefined) && (this.02 != null))
                {
                var screen = null;
                var target = this;
                while((screen == null) && (target != undefined) && (target != null))
                {
                if(target instanceof mx.screens.Screen)
                {
                screen = target;
                }
                else
                {
                target = target._parent;
                }
                }
                if(screen instanceof mx.screens.Slide)
                {
                screen.gotoSlide(this.02);
                }
                }
                // End GoTo Screen behavior

                }


                Here's an "arrow" button, made from theh same artwork, on the same page that DOES work....if that helps.



                on (release) {
                // GoTo Previous Screen behavior
                var screen = null;
                var target = this;
                while((screen == null) && (target != undefined) && (target != null))
                {
                if(target instanceof mx.screens.Screen)
                {
                screen = target;
                }
                else
                {
                target = target._parent;
                }
                }
                if(screen instanceof mx.screens.Slide)
                {
                screen.rootSlide.currentSlide.gotoPreviousSlide();
                }
                // End GoTo Previous Screen behavior

                }


                thank you for whatever you can do...