1 Reply Latest reply on May 24, 2006 6:35 AM by Nickels55

    need button to fade-out page (.swf) when pressed, open URL

    Level 7
      Hi-ya

      3 days going on 4 and i still haven't figured out how or what i need to do that would enable a button placed on a SWF (webpage), when clicked, will fade that .swf to blak,thereafter a URL opens (my homepage). does anyone know what i need to do in this case. my actionscript skills is graded at c or c -, so any help there would be appreciated.

      thanx,
      IfOnlyiNu

      From http://www.developmentnow.com/g/68_2004_9_0_15_0/macromedia-flash.htm

      Posted via DevelopmentNow.com Groups
      http://www.developmentnow.com
        • 1. need button to fade-out page (.swf) when pressed, open URL
          Nickels55 Level 2
          Here is the theory - you should be able to figure it out from there:

          1. In your main movie create a new movieclip call it "Fade", make the first frame blank and put a stop(); action on it.
          2. On the second frame create a new graphic symbol bigger then the full screen and make it a full black square.
          3. Go a few frames ahead, the farther the longer the fade will take. Insert a keyframe.
          4. Go back to frame 2, select the black box graphic and make its alpha = 0%
          5. Create a tween on frame 2, this will make the box go from invisible to visible on the last keyframe.
          6. On the last frame where the box is totally black add the getURL("url") actionscript.

          7. Go back to the main scene of the movie and place the "fade" movieclip on the top layer. Since it is stopped on the first blank frame it will not be visible until something makes it play.

          8. Add an actionscript to the button that will start the fade, it will look like
          *buttoninstancename*.onRelease = function () {
          _root.Fade.gotoAndPlay(2);
          //this tells the movie fade to go to the second frame and play
          }

          replace *buttoninstancename* with the instance name of the button on the stage that conrtols the fade.
          That will make the "Fade" movie play, which is a tween that turns the full screen to black, and then redirects to a new url at the end.

          Hope that helps.