3 Replies Latest reply on May 4, 2009 1:41 PM by Ned Murphy

    What am I doing wrong?!?

    jarredandkat

      Hi Everyone!!!

      I am VERY new to Flash, I'm learning as I go... I have worked on this site for about a week now... whenever I do the code, the buttons don't work unless I change other code.  but when I change the other code, than my home page doesn't show up... Please Help?  Oh, might I add, you have to click on the home button twice for it to load, but it comes up with a blank page as the main load page... i'm not sure what i'm doing wrong... and like i said, i can get it to load the home page, but than the buttons don't work... here is the code i have written so far...

       

      function mcOff(){
      home_mc._visible = false; - If I change this to true, than the buttons don't work!!!
      photography_mc._visible=false;
      video_mc._visible=false;
      graphics_mc._visible=false;
      bio_mc._visible=false;
      contact_mc._visible=false;
      }

      mcOff();

       

      this.navbar_mc.photography_btn.onRelease=function(){
          gotoAndStop("photography");
          mcOff();
          photography_mc._visible=true;
      }
      this.navbar_mc.video_btn.onRelease=function(){
          gotoAndStop("video");
          mcOff();
          video_mc._visible=true;
      }
      this.navbar_mc.graphics_btn.onRelease=function(){
          gotoAndStop("graphics");
          mcOff();
          graphics_mc._visible=true;
      }
      this.navbar_mc.bio_btn.onRelease=function(){
          gotoAndStop("bio");
          mcOff();
          bio_mc._visible=true;
      }
      this.navbar_mc.contact_btn.onRelease=function(){
          gotoAndStop("contact");
          mcOff();
          contact_mc._visible=true;
      }
      this.navbar_mc.home_btn.onRelease=function(){
          gotoAndStop("home");
          mcOff();
          home_mc._visible=true;

       

      THANKS IN ADVANCE FOR ANY HELP YOU CAN GIVE!!!

       

      -Jarred

        • 1. Re: What am I doing wrong?!?
          Ned Murphy Adobe Community Professional & MVP

          There's nothing wrong with your code that I can readily see, so your problem is likely in how you have things set up on your timeline.  Is your navbar_mc always present and uniterupted on its timeline layer?  Are all of the buttons assigned instance names?  Are all of your frame labels correct and in place?  IS all that code on a layer of its own and does it extend the length of the timeline?  There's probably more to ask, but those are some of the basic things you oughta check.

           

          I am a little curious as to why you are both going to frames and managing visibilities for the sections.  I would normally being doing one or the other but not necessarily both.

          • 2. Re: What am I doing wrong?!?
            jarredandkat Level 1

            Actually I'm following a really good tutorial I found online, umm... What it is, is that I designed the site in photoshop, with layers,and more layers, and so in flash we have to use functions to make all the other layers be hidden, and to be shown from clicking on a button...

            • 3. Re: What am I doing wrong?!?
              Ned Murphy Adobe Community Professional & MVP

              If you're controlling the visibility of the sections, which is what I see your code doing, then you don't need to be moving anywhere along the timeline, so all of the goto commands don't really buy you anything (nominally).  There are commonly two approaches to having sites with sections in Flash, control visibility of sections or goto frames that hold individual sections, and you seem to be using both, where only one is really necessary.

               

              I can neither praise nor condemn the tutorial you mention since I don't know what it teaches, and what you may have done to alter it, but if it's doing what you're doing I have to wonder about it.  If you're following it correctly to the letter and it isn't working, it's goodness is questionable.  There are plenty of tutorials around and the quality of them span the possible extremes of 'goodness', from poor to excellent... some of them are easy to follow but have wrong information, some are hard to follow making them error prone in deciphering.