4 Replies Latest reply on Jan 13, 2009 7:26 AM by clbeech

    Movie won't stop once I try to create links

      Hi everyone - this has got to be the dumbest question ever, but I have been watching tutorials all day and I can's figure this out:

      I created this simple flash animation at the top of this page: http://epitomegirl.com/MWS/olarrysirishpub.com/index.html

      My goal is to have it stop (like it does now) and once it stops, have 3 of the bottles clickable so you can go to a URL when you click on them. These have already been converted into buttons with instance names.

      My problems:

      (1) I have a stop command at the end of this animation, but as soon as I add any other actions anywhere in the timeline the movie starts looking uncontrollably

      (2) I am using Flash CS3 and I can't for the life of me navigate the overwhelming actionscript options for just making a &^%$ing button clickable.

      Could someone who is a kind soul take a moment to help me out with this? I'm guessing this should take 3 minutes but I've spent 4.5 hours trying to figure it out and I am losing my mind.

      Thanks in advance for your help! :)

        • 1. Re: Movie won't stop once I try to create links
          epitomegirl13 Level 1
          oops I meant to say LOOPING uncontrollably under number 1.
          • 2. Re: Movie won't stop once I try to create links
            clbeech Level 3
            lol - ok the syntax you use will depend on the version of AS your file is set up to use - AS2 or AS3 (?)

            so on the 'last frame' of the animation where you have the 'stop()' method is a good place to add the script for the buttons. if you are using AS2 the script will look something like this:

            button1.onPress = function() {
            getURL(' http://www.thesite.com/thepage.html', '_self');

            with 'button1' being replaced with the instance name of the button you're targeting. do the same for each button instance.

            however in AS3 the code will look something like this:

            function navTo1(e:MouseEvent) {
            navigateToURL(new URLRequest(' http://.www.thesite.com/thepage.html'), '_self');
            button1.addEventListener(MouseEvent.CLICK, navTo1);

            although AS3 is a bit 'more' complex, the result is the same. repeat this for each button instance with differing method and instance names.
            • 3. Re: Movie won't stop once I try to create links
              epitomegirl13 Level 1
              Thank you so much for the fast response. I figured everyone would just laugh and ignore my question :)

              So I am using AS3 but I would be happy to use AS2 either way.

              My question is this: if i put this in the last frame of the action layer:

              stop () ;
              olarryButton.onPress = function() {
              getURL(' http://www.yahoo.com', '_self');

              and export the movie it just keeps looping. No links, nothing. If I take out everything except the stop command then it at least stops, but I'm back to my problem of not having a link.

              Should the code you have me go directly below the stop command in the actions panel or should I create a new keyframe after the one with the stop command and then paste this code?

              I was a web designer at BellSouth for 6 years and I am so mad at myself for not knowing this. thanks again for your help! :) i hope you know it is truly appreciated.

              • 4. Re: Movie won't stop once I try to create links
                clbeech Level 3
                hmmm.... ok two things here. first the stop method above should not have the spaces (although it's likely that this is just 'here' and not in your file) so it should be: stop(); (also it should still work, but for posterity... lol)

                secondly, adding the handler shouldn't cause the movie to continue looping, so that's pretty odd, there may be something else going on. however, the above code 'is' AS2 - but if your file is set up for 3 this may be the cause of the issues. either, try using the AS3 code as above, or change the file to AS2 in the Publish settings>Flash tab>Actionscript version drop down and use the code as you have there.

                btw - don't worry about it, everyone needs to start somewhere, and Actionscript is it's own animal, it takes time to get a handle on it :)