6 Replies Latest reply on Jun 30, 2011 3:36 PM by robitee

    Struggling with youtube tutorials

    robitee

      So i have been trying to make a photo gallery for the website of a client so i searched for a tutorial to help create something special, i found this Action script 2.0 one and it did not dissapoint

      http://www.youtube.com/watch?v=2TrIQqu2MkU&feature=related

      I carried it out to the letter and now the animation works very well but i wanted to use this to show pictures in my gallery and this method did not explain how to do that, so I found another tutorial also on Youtube and decided to combine the two.

      http://www.youtube.com/watch?v=7mdJeGt_v0Y

       

      I got the AS 2 from the maker's website and combined it with my original code from the previous tutorial and now the images aren't displaying when i click on a button, it seems the buttons don't work, their rollover images show up when you hover over them though.

      Here is my code...

      stop();

       

      imgBar.btn1.onRelease = function(){

      gotoAndStop ("img1");

      }

       

      imgBar.btn2.onRelease = function(){

      gotoAndStop ("img2");

      }

       

      imgBar.btn3.onRelease = function(){

      gotoAndStop ("img3");

      }

       

      imgBar.btn4.onPress = function(){

      gotoAndStop ("img4");

      }

       

      imgBar.btn5.onRelease = function(){

      gotoAndStop ("Keyframe5");

      }

       

      imgBar.btn6.onRelease = function(){

      gotoAndStop ("img6");

      }

       

      imgBar.btn7.onRelease = function(){

      gotoAndStop ("img7");

      }

       

      imgBar.btn8.onRelease = function(){

      gotoAndStop ("img8");

      }

       

      imgBar.btn9.onRelease = function(){

      gotoAndStop ("img9");

      }

       

      imgBar.btn10.onRelease = function(){

      gotoAndStop ("img10");

      }

       

      imgBar.btn11.onRelease = function(){

      gotoAndStop ("img11");

      }

       

      imgBar.btn12.onRelease = function(){

      gotoAndStop ("img12");

      }

       

      imgBar.btn13.onRelease = function(){

      gotoAndStop ("img13");

      }

       

      imgBar.btn14.onRelease = function(){

      gotoAndStop ("img14");

      }

       

      imgBar.btn15.onRelease = function(){

      gotoAndStop ("img15");

      }

      _root.onEnterFrame = function(){

      if(_root._ymouse<301){

      myvar=false;

      }

      if(_root._ymouse>300){

      myvar=true;

      }

      if(_root._xmouse<50 and myvar==true){

      imgBar.prevFrame();

      imgBar.prevFrame();

      imgBar.prevFrame();

      } else{

      imgBar.play();

      }

      if(_root._xmouse>550 and myvar==true){

      imgBar.nextFrame();

      imgBar.nextFrame();

      }

      else{

      imgBar.play();

      }

      if(_root._xmouse>50 && _root._xmouse<550 && myvar==true){

      imgBar.stop();

      }

       

      }

       

      I though it had something to do with the fact that the buttons are placed in a movie clip, i have tried

      imgBar.btn2.onRelease = function(){

      _parent.gotoAndStop ("img2");

      }

      imgBar is the instance name i have given to my movie clip.

       

      Any help would be greatly appreciated as it has been a few days and i am running behind schedule.

      Thanking you in advance

        • 1. Re: Struggling with youtube tutorials
          Ned Murphy Adobe Community Professional & MVP

          If the following code is in the timeline that you intend to be moving along (meaning it has a frame labeled "img1"), and that timeline contains the imgBar object, and the imgBar object contains a button with the instance name btn1, then there is nothing wrong with the code as is...

           

          imgBar.btn1.onRelease = function(){

              gotoAndStop ("img1");

          }

           

          What I do not understand is all the code you have that seems to be moving around the imgBar timeline.  That might be the source of your problem if you are changing frames in the imgBar movieclip... you might be leaving the buttons that have the code assigned to them behind when you change frames inside the imgBar.  In any case, there should be no need to have multiple prevFrame/nextFrame calls in a row.

          • 2. Re: Struggling with youtube tutorials
            robitee Level 1

            Ok, thank you for your fast reply, i now understand that as the imgBar timeline is played, the action script commands for the buttons are left behind, is there anything i can do to make the action script keep up with the imgBar?

             

            And the purpose prevFrame/nextFrame calls is to allow more speed when you hover the cursor over each end of the animation

            • 3. Re: Struggling with youtube tutorials
              Ned Murphy Adobe Community Professional & MVP

              Have your buttons on a layer that extends the full length of the imgBar timeline without using multiple keyframes.

               

              If you want to skip several frames, putting a series of next/prevFrame calls is not the way to do it.  Use imgBar.gotoAndStop(imgBar._currentframe+3), etc.

              1 person found this helpful
              • 4. Re: Struggling with youtube tutorials
                robitee Level 1

                Still doesn't seem to work but i do believe we are getting somewhere, Untitled-2.jpg

                This is what my timeline looks like. The imgBar animation is in the Buttons layer, the Images layer are what i want to have show up when you click on a button (All frames are named img2,img4,img15etc) and the action script i showed you before hand i have devided into two layers.

                 

                Do i put the button as commands into the imgBar movie clip timeline?

                • 5. Re: Struggling with youtube tutorials
                  Ned Murphy Adobe Community Professional & MVP

                  I don't know what you mean.  I would be more curious to see the timeline of your imgBar movieclip than the one you showed.  That is where the problem will be if our discussion so far stands.

                  • 6. Re: Struggling with youtube tutorials
                    robitee Level 1

                    So I found out what I was doing wrong, everything, that's what i was doing wrong.

                     

                    I loaded up an earlier save i made and tried again in a completely new direction and i have got it working as i wanted it, so the problem is solved now, thanks a lot for offering me help though