24 Replies Latest reply on Nov 9, 2006 8:06 PM by kglad

    How to Delete and reset button Events

    Goshine Level 1
      according to the idea . i am working on ...at one point i will need to delete an event ... but further down in the script i am going to need this event once more how can .i get back an event after deleting it please look at my eg.
        • 1. Re: How to Delete and reset button Events
          kglad Adobe Community Professional & MVP
          create a function that defines the actions you want the event to trigger. when you want to enable the event, have it point to the function. when you want to disable the event have it point to null.
          • 2. Re: How to Delete and reset button Events
            Goshine Level 1
            mister Kglad... could xplain with and example sir ?.. this the exact case (true)
            i have a map with 14 parishes and each one of this parish is a movieClip; and i am using each one of them as button to load different slideshow s in a movieClipLoader();..... each of the parishes ( when i rollOver they change colour and when i rollOut is go back to the orinal look .... but onRelease i want delete the
            ... onRollOut ... so the button does not go back to the original look.. because i had click it .................but on the map when i click other sections of the map it resets[onRollOut] . the other movieClip_btn back to there original look .. and i should be able to do it all over again.....
            • 3. Re: How to Delete and reset button Events
              Goshine Level 1
              //
              //kingston buttons
              mcKing.onRollOver = function():Void {
              this.gotoAndPlay(2);
              };
              mcKing.onRollOut = function():Void {
              };
              /**/
              mcKing.onRelease = function():Void {
              delete this.onRollOut;
              this.onRollOut;
              loadMovieNum("kings_shell.swf", 2);
              clearInterval(_level2.mcYellowLoader.nInterval);
              //mcKing.gotoAndStop(1);
              mcKing.onRollOut;
              mcCath.gotoAndStop(1);
              mcCath.onRollOut;
              mcClaren.gotoAndStop(1);
              mcClaren.onRollOut;
              mcManc.gotoAndStop(1);
              mcManc.onRollOut;
              mcEliz.gotoAndStop(1);
              mcEliz.onRollOut;
              mcWest.gotoAndStop(1);
              mcWest.onRollOut;
              mcHano.gotoAndStop(1);
              mcHano.onRollOut;
              mcJames.gotoAndStop(1);
              mcJames.onRollOut;
              mcTrel.gotoAndStop(1);
              mcTrel.onRollOut;
              mcAnn.gotoAndStop(1);
              mcAnn.onRollOut;
              mcMary.gotoAndStop(1);
              mcMary.onRollOut;
              mcThom.gotoAndStop(1);
              mcThom.onRollOut;
              mcPort.gotoAndStop(1);
              mcPort.onRollOut;
              };
              //
              //st. catherine button
              mcCath.onRollOver = function():Void {
              this.gotoAndPlay(2);
              };
              mcCath.onRollOut = function():Void {
              this.gotoAndPlay(1);
              };
              mcCath.onRelease = function():Void {
              delete this.onRollOut;
              loadMovieNum("stcath_shell.swf", 2);
              clearInterval(_level2.mcYellowLoader.nInterval);
              };
              //
              //Clarendon buttons
              mcClaren.onRollOver = function():Void {
              this.gotoAndPlay(2);
              };
              mcClaren.onRollOut = function():Void {
              this.gotoAndPlay(1);
              };
              mcClaren.onRelease = function():Void {
              delete this.onRollOut;
              loadMovieNum("clarendon_shell.swf", 2);
              clearInterval(_level2.mcYellowLoader.nInterval);
              };
              //
              // manchester button
              mcManc.onRollOver = function():Void {
              this.gotoAndPlay(2);
              };
              mcManc.onRollOut = function():Void {
              this.gotoAndPlay(1);
              };
              mcManc.onRelease = function():Void {
              delete this.onRollOut;
              loadMovieNum("manc_shell.swf", 2);
              clearInterval(_level2.mcYellowLoader.nInterval);
              };
              //
              // st.Elizibeth buttons
              mcEliz.onRollOver = function():Void {
              this.gotoAndPlay(2);
              };
              mcEliz.onRollOut = function():Void {
              this.gotoAndPlay(1);
              };
              mcEliz.onRelease = function():Void {
              delete this.onRollOut;
              loadMovieNum("steliz_shell.swf", 2);
              clearInterval(_level2.mcYellowLoader.nInterval);
              };
              //
              // westmoreland button
              mcWest.onRollOver = function():Void {
              this.gotoAndPlay(2);
              };
              mcWest.onRollOut = function():Void {
              this.gotoAndPlay(1);
              };
              mcWest.onRelease = function():Void {
              delete this.onRollOut;
              loadMovieNum("west_shell.swf", 2);
              clearInterval(_level2.mcYellowLoader.nInterval);
              };
              //
              // hanova buttons
              mcHano.onRollOver = function():Void {
              this.gotoAndPlay(2);
              };
              mcHano.onRollOut = function():Void {
              this.gotoAndPlay(1);
              };
              mcHano.onRelease = function():Void {
              delete this.onRollOut;
              loadMovieNum("hano_shell.swf", 2);
              clearInterval(_level2.mcYellowLoader.nInterval);
              };
              //
              //st. James buttons
              mcJames.onRollOver = function():Void {
              this.gotoAndPlay(2);
              };
              mcJames.onRollOut = function():Void {
              this.gotoAndPlay(1);
              };
              mcJames.onRelease = function():Void {
              delete this.onRollOut;
              loadMovieNum("stjames_shell.swf", 2);
              clearInterval(_level2.mcYellowLoader.nInterval);
              };
              //
              // Trelawny buttons
              mcTrel.onRollOver = function():Void {
              this.gotoAndPlay(2);
              };
              mcTrel.onRollOut = function():Void {
              this.gotoAndPlay(1);
              };
              mcTrel.onRelease = function():Void {
              delete this.onRollOut;
              loadMovieNum("trelaw_shell.swf", 2);
              clearInterval(_level2.mcYellowLoader.nInterval);
              };
              //
              // st. Anns button
              mcAnn.onRollOver = function():Void {
              this.gotoAndPlay(2);
              };
              mcAnn.onRollOut = function():Void {
              this.gotoAndPlay(1);
              };
              mcAnn.onRelease = function():Void {
              delete this.onRollOut;
              loadMovieNum("stann_shell.swf", 2);
              clearInterval(_level2.mcYellowLoader.nInterval);
              };
              //
              //st mary button
              mcMary.onRollOver = function():Void {
              this.gotoAndPlay(2);
              };
              mcMary.onRollOut = function():Void {
              this.gotoAndPlay(1);
              };
              mcMary.onRelease = function():Void {
              delete this.onRollOut;
              loadMovieNum("stmary_shell.swf", 2);
              clearInterval(_level2.mcYellowLoader.nInterval);
              };
              //
              // st. thomas button
              mcThom.onRollOver = function():Void {
              this.gotoAndPlay(2);
              };
              mcThom.onRollOut = function():Void {
              this.gotoAndPlay(1);
              };
              mcThom.onRelease = function():Void {
              delete this.onRollOut;
              loadMovieNum("stthom_shell.swf", 2);
              clearInterval(_level2.mcYellowLoader.nInterval);
              };
              //
              // portland buttons
              mcPort.onRollOver = function():Void {
              this.gotoAndPlay(2);
              };
              mcPort.onRollOut = function():Void {
              this.gotoAndPlay(1);
              };
              mcPort.onRelease = function():Void {
              delete this.onRollOut;
              loadMovieNum("portland_shell.swf", 2);
              clearInterval(_level2.mcYellowLoader.nInterval);
              };
              • 5. Re: How to Delete and reset button Events
                Goshine Level 1
                Kglad.onReply ==![....that work just like waht i had before .... it still did not give back the button the event that i delete.... Which is ..onRollOut...is ther a way to give back a button the abuildlity get the ,,events if you delete them]...thanks
                • 6. Re: How to Delete and reset button Events
                  kglad Adobe Community Professional & MVP
                  yes, it does. you just need to apply that code to each of your movieclip buttons.
                  • 7. Re: How to Delete and reset button Events
                    Goshine Level 1
                    is there a way that i can send you Fla. file ..so you could take a broader look a the objects .. it has gotten even worst .. let mi know if it is posible
                    thanks
                    • 8. Re: How to Delete and reset button Events
                      kglad Adobe Community Professional & MVP
                      post a link to your fla.
                      • 9. Re: How to Delete and reset button Events
                        Goshine Level 1
                        http://www.whatsinjamaica.com/eg/whatshell.fla this should a visual prospective on the map
                        • 10. Re: How to Delete and reset button Events
                          kglad Adobe Community Professional & MVP
                          i need a link to the movieclip that contains that code.
                          • 11. Re: How to Delete and reset button Events
                            Goshine Level 1
                            sorry that was the wrong one
                            yes ... Kglad all the codes are there in the Action layer (1)
                            the correct one is htt://www.whatsinjamaica.com/eg/whatMap.fla
                            • 12. Re: How to Delete and reset button Events
                              Goshine Level 1
                              i know that you would have figured out the error but this for other forum whatcher http://www.whatsinjamaica.com/eg/whatMap.fla
                              • 13. Re: How to Delete and reset button Events
                                kglad Adobe Community Professional & MVP
                                so, the problem is solved?
                                • 14. Re: How to Delete and reset button Events
                                  Goshine Level 1
                                  no kglad it was not a problem ... it was addition i was trying to add on to the Script
                                  which i am still trying to do do to make it a little more interesting .................. right now if you look at the map as it is ... when you ... rollover the parishes they get a bite darker...... and wen you rollOut
                                  they go back to their original color ..... the problem is that ....i want the parish to stay in the darker color if you click on it until you click a different parish .. then that parish would stay in the darker color...... and all the the others would go back to the original color
                                  • 15. Re: How to Delete and reset button Events
                                    kglad Adobe Community Professional & MVP
                                    here's your corrected file:

                                    www.gladstien.com/new/whatMap.fla
                                    • 16. Re: How to Delete and reset button Events
                                      Goshine Level 1
                                      that .. was extremely good ... looks like i need to learn how to use Arrays: new Array();
                                      as it is now it looks finish to me .... but i was suppose to add one more line of code to load in the text .. the empty space under the Map i am going to .. DRAW a dynamic text field and load some Text in to it for each parish ....once you RollOver the parish the text that is associated with that parish will be load into the the text field but from what you have done .... with your super smart coding everything seem to be tied into to Arrays .... and mixed into one block of code .. i am not so sure how sigle out {parish.onRollOver = function ():Void{map.text = (text for that parish)}
                                      • 17. Re: How to Delete and reset button Events
                                        kglad Adobe Community Professional & MVP
                                        it's updated to include rollOver text:

                                        www.gladstien.com/new/whatMap.fla
                                        • 18. Re: How to Delete and reset button Events
                                          Goshine Level 1
                                          yes sir thank a lot .... what i would difinetly like is for you to send me a commented version of the code .... because i thing it is a little advance to follow was tyrin to learn it and it was not so easy ..is it posible to send me a little //coment ..../**/...... bacause eventully .. i am going to udate the rollOver Text .. and i am going to try to Load the text dynamicly from external Html files that i can add a style sheet .. that way i should be able to stlye the the text consistenly .... so that when i am updating the text ;all i have to do is udate the the html file .. you think that is good plan ?
                                          • 19. Re: How to Delete and reset button Events
                                            kglad Adobe Community Professional & MVP
                                            ok, a commented version is at:

                                            www.gladstien.com/new/whatMap.fla
                                            • 20. Re: How to Delete and reset button Events
                                              kglad Adobe Community Professional & MVP
                                              you can load a style sheet into flash. and you can load text into flash. but you can't load a html file into flash.
                                              • 21. Re: How to Delete and reset button Events
                                                Goshine Level 1
                                                yes!!!!!!!!!!!!! Kglad we are in .. with whatsinjamaica.com .... i am going to work on that .. and i will and will ask for more help if i get in trouble thanks lata
                                                • 22. Re: How to Delete and reset button Events
                                                  kglad Adobe Community Professional & MVP
                                                  you're welcome.
                                                  • 23. Re: How to Delete and reset button Events
                                                    Goshine Level 1
                                                    kGlad thanx a lot i will keep you up to date with the progress