6 Replies Latest reply on Jun 27, 2007 8:16 PM by

    What is AS for button function

      Hello folks,
      I just used a www.gotoandlearn.com tutorial to create these cool animated buttons. Buttons are movie clips and they changing on roll over and roll out states. Everything works great, but since this is not a regular button, i do not know, how to assign a button function, so on release, viewer would be taken to another page.
      this is AS I did for that animated button 1 :

      b1.onRollOver = over;
      b1.onRollOut = out;
      b1.buttText.buttonText.text = "HOME";
      function over() {
      this.gotoAndPlay(2);
      }

      function out() {
      this.gotoAndPlay(11);
      }

      that is AS for button acually being animated and it works great.

      But when I try to to assign a regular
      on(release){
      _root.gotoAndPlay(2);
      }
      it says that button insance is allowed only on buttons. But this is a movie clip. So how coud I do this?
      Do I have to assign another function, something like b1.onRelease = something?;
      Thank you so much and please, keep in mind that I am a beginner. Thank you so much for your help.
      Janek
        • 1. Re: What is AS for button function
          SmpleJohn Level 1
          _root.b1.onRelease=function(){
          _root.gotoAndPlay(2);
          }

          I think this is what you're looking for... there are a ton of different ways to do this though. Glad to hear you're going through tutorials. They always help.
          • 2. Re: What is AS for button function
            Hello John,
            thank you so much for your response. I used that script you sent me, but it still does not work, for some reason. It says that script has no errors, but when I check the movie, those "buttons" do not react. It does not take me to another page.Is it that maybe I have assigned that script to wrong place? I basically put that script on the same spot with that animating script. I just wrote it underneath. So the whole script looks like this:

            b1.onRollOver = over;
            b1.onRollOut = out;
            b1.buttText.buttonText.text = "ABOUT";
            _root.b2.onRelease=function(){
            _root.gotoAndPlay(3);
            }


            b2.onRollOver = over;
            b2.onRollOut = out;
            b2.buttText.buttonText.text = "ABOUT";
            _root.b2.onRelease=function(){
            _root.gotoAndPlay(4);
            }

            b3.onRollOver = over;
            b3.onRollOut = out;
            b3.buttText.buttonText.text = "ABOUT";
            _root.b2.onRelease=function(){
            _root.gotoAndPlay(5);
            }

            function over() {
            this.gotoAndPlay(2);
            }

            function out() {
            this.gotoAndPlay(11);
            }

            First 2 frames on main timeline is a Preloader, so page1 is on frame 3, page2 on frame 4, and page3 on frame5.
            John, thank you so much for your help, and for your patience.
            Thanks Janek
            • 3. Re: What is AS for button function
              SmpleJohn Level 1
              Make sure that the "_root.b2" segment is pointing to the instance name of the button on your timeline. It should be different for each button, and without looking at your timeline I can't tell you exactly where it needs to go. If you want to post the file somewhere so I can download it I would be more than happy to take a look at it. I'm just working right now, nothing important:)

              Patients is definitely a virtue with this stuff. I remember how insane it was learning flash. Keep up with the tutorials. They're a lifesaver.
              1 person found this helpful
              • 4. Re: What is AS for button function
                Hi John,
                First of all, I can't thank you enough for helping me with this. Secondly, your portfilio on your website is very nice. (something I can only dream about) Yes you are right, learning Flash slowly drives me insane.
                I had tried to mail you that .fla file, but it is probably too big so I don't think it went through. So I will do just basic, primitive, temporary website, which will only have rectangles,etc, but it wil have the same structure like that original. So that way, it will not take so much space, and I will mail it to: john@smple.com
                John, thank you
                Janek
                • 5. Re: What is AS for button function
                  SmpleJohn Level 1
                  Check your e-mail. Sent it back:)
                  1 person found this helpful
                  • 6. What is AS for button function
                    Hi John,
                    first of all, I appologize for not responding right away. I had to go away for few days. I don't know what happened, but I did not get that second mail,yet. It probably failed to be delivered somehow. But what happend since I wrote you last time is, that I finally figured that out. (it only took few weeks...) It works ok now. the website address is http://icebergfilms.com/, so you can check it out, if you have some time to kill. But please, don't laugh, it's a joke compare to yours.
                    John, I would also like to ask you for two things. Firstly, how can I acomplish, that after viewer clicks on my e-mail address posted on my CONTACT web page, that little mail sender pops up, so that viewer can send me an e-mail directly from my website.
                    And secondly. What if I want to have a thumbnail on my webpage, which (on click) opens independently flowing window
                    with a video clip embeded on it. That window would be smaller than regular page and I would like to be able to set whatever dimensions to it and to create whatever neat background.
                    John, thank you again for all your advises and your patience with me,
                    Cheers
                    Paul