3 Replies Latest reply on May 25, 2007 1:02 PM by Inactionscript

    I need to create a button that links to another swf file...

    janemig Level 1
      i'm creating my first website, and, for each menu item, i am creating a new flash document... is this the correct way to create a multi-page website?

      plus: how to create a button that links to a jpg, thanks!

      jane
        • 1. Re: I need to create a button that links to another swf file...
          cpgenius
          Creating separate swf's these days as far as I know is considered to be a better practice than using the "scenes" that are in Flash. The reason is you can load various sections of your entire Flash entity rather than the user downloading everything at once.

          But, it also depends on the complexity of where your menu items are leading. If they are simple enough, then there may be no need to create new documents.

          To create a button that links to a jpeg, try this.

          Whatever graphic you're using for the button, select it and hit F8 to convert it to a movie clip. Once it's in your library, click on your new movie clip on the stage and give it an instance name in the properties window.

          Click the first frame in your timeline (preferably on a layer named "actions") and put this example in for the actionscript:

          //buttonName is the instance name you gave it
          //.onPress tells Flash when buttonName is pressed then do what's
          //inside the brackets of the function
          buttonName.onPress = function (){
          //getURL is the Flash function that will load your picture.jpg
          //_blank is the target. e.g. _blank, _self etc.
          getURL("picture.jpg", "_blank");
          }
          • 2. Re: I need to create a button that links to another swf file...
            janemig Level 1
            wow, that sounds very clear, i'll give it a try, thanks!!!

            -jane
            • 3. Re: I need to create a button that links to another swf file...
              Inactionscript
              I agree on the loadMovie concept instead of scenes. Over the years, I've had great fun creating Flash sites.

              One thing you may want to try using is the loadMovie inside a movieclip instance. For example, if your navigation stays the same, but the content area changes, you may want to load your pages into that area only. If so, just create a movieclip the size of your content area, and add this code to your menu links:

              on (press) {
              _root.yourMovieClip.loadMovie("FILENAME.swf", 1);
              }

              // yourMovieClip is the name of the movieclip instance you're loading into.

              Hope that sparks some creativity.