1 2 Previous Next 57 Replies Latest reply on Nov 21, 2007 6:27 PM by kglad Go to original post
      • 40. Re: Why error message?
        Buntu Level 1
        Hi eddiwil9

        Put a trace statement like this

        That way you will know that the button is being fired when you click it. If it's not fired then the instance name of the button is not right. Let me know if this works out for you. :)

        Buntu.
        • 41. Re: Why error message?
          EddieWilliams Level 1
          Buntu,

          I removed all other as from the file and cut and pasted yours in.

          This is the resulting error:

          1021: Duplicate function definition.
          • 42. Re: Why error message?
            kglad Adobe Community Professional & MVP
            you already had a funciton named onMentalClick. now, you have more than one.

            read my previous message.
            • 43. Re: Why error message?
              EddieWilliams Level 1
              kglad,
              mental button is the instance name of a button. I have set it up the same way as the other two that work.

              Note that the files also breaks when I try another additional button (also set up like the first 2), not just on mentalbut. Regardless of whichever 3rd button I am working with, I get the same result.
              • 44. Re: Why error message?
                kglad Adobe Community Professional & MVP
                remove your 3rd button and return to a working fla that has no compiler errors.

                now, copy your 2nd button. paste it on-stage. give it a different (from your 2nd button) instance name. apply a listener to it. retest.
                • 45. Re: Why error message?
                  EddieWilliams Level 1
                  kglad,

                  that worked perfectly. gave it a new name (newbut) and inserted it where I have been inserting the others all along. Somehow, I find it even MORE odd that it workes this time!

                  I can't figure out why my others don't work...the names appear to be correct...

                  Maybe I will just rebuild a few bits and see if that solves it. Can't wait for my classes!

                  Thanks!
                  • 46. Re: Why error message?
                    EddieWilliams Level 1
                    Here's what I discovered. As each of the 5 buttons "comes in" they have a tween where they fade in. If I cut off all the frames at the final key-frame of the fade up and then place a new instance of that button (with no tween, as it's already now at 100%), and then use that as the instance, they all work perfectly.

                    of course, the #2 button is still working "the old way" and I don't understand why, but I am not gonna question it too much since it appears to be working!
                    • 47. Re: Why error message?
                      dobe2222 Level 1
                      I'm getting the error message 1120: Access of undefined property intro.

                      I created a new layer and called it Actions, selected the first and last frame and added a stop function using script assist, this is what it looks like;
                      import flash.display.MovieClip;
                      intro.fla.stop();

                      Can anyone help?
                      • 48. Re: Why error message?
                        dobe2222 Level 1
                        I resolved my problem, I had to put in (stop); instead of what I put before!.

                        Can anyone tell me how to put this in a code?: if user hits on button it goes to the next scene?
                        • 49. Re: Why error message?
                          kglad Adobe Community Professional & MVP
                          congrats ew!!

                          dobe, add a listener to your button that calls function that then executes your goto function.
                          • 50. Re: Why error message?
                            dobe2222 Level 1
                            kglad, thanks so much for your help....

                            i'm designing an all flash website, what is the best way to do it? should I have scenes and buttons that jump scenes OR should i have 4 layers, content button background and actions and convert each scene in a movieclip and put them all on individual frames on the content layer and use the action layer to "make it work"?? i'm going to have an intro, about 5 dropdown menus, and lots of pictures, it's a jewelery company's website... what is the best way to go with this?
                            thanks so much
                            • 51. Re: Why error message?
                              dobe2222 Level 1
                              Ok, I decided to go with layers on a single timeline...

                              However, I encountered a problem..

                              On frame 1 of my content layer is my movieclip: IntroL, at the end of IntroL movieclip the button english fades in and the movie clip stops.

                              I would like when the button english is pressed for the movie to go to frame 2 in my content layer and start playing the movieclip: Menu.

                              I put in this code on the actionscript layer I have on my main timeline on frame 1:

                              IntroL.play();
                              import flash.display.MovieClip;
                              import flash.events.IEventDispatcher;
                              English.addEventListener(MouseEvent.MOUSE_DOWN,sta rtMenu);
                              function startMenu(e:MouseEvent):void {
                              }
                              IntroL.stop();
                              Menu.play();

                              ..... However, when I test the movie, All you see is IntroL's first frame looping itself... with the messages:
                              1120: Access of undefined property English.
                              and
                              English.addEventListener(MouseEvent.MOUSE_DOWN,sta rtMenu);......

                              I was also wondering if a part of this problem is that I didn't create a Button layer on the main timeline and inserted button: English there because I would like it to fade in when it's time has come..

                              can anyone help me debug??
                              • 52. Re: Why error message?
                                kglad Adobe Community Professional & MVP
                                if English doesn't exist when that frame executes, you'll have a problem. your code that references english should execute after English is instantiated.
                                • 53. Re: Why error message?
                                  dobe2222 Level 1
                                  so basically, I should create a button layer on my main timeline and add the English button there and make it invisible? if so, can you please tell me where I could find the code to make it invisible? :)
                                  • 54. Re: Why error message?
                                    kglad Adobe Community Professional & MVP
                                    that would be one solution.

                                    you can use the visible property of display objects to disable and enable your English button.
                                    • 55. Re: Why error message?
                                      dobe2222 Level 1
                                      and I'll be able to do as you said by:
                                      lowering the alpha on the english button that I just inserted on the same frame as the MC starts?
                                      • 56. Re: Why error message?
                                        dobe2222 Level 1
                                        i did what i just explained and it gave me the same 1120 error.. =/
                                        • 57. Re: Why error message?
                                          kglad Adobe Community Professional & MVP
                                          show the code you used using the attach code option.
                                          1 2 Previous Next