3 Replies Latest reply on Sep 1, 2009 8:57 AM by kglad

    Adding alert boxes to movie items with clickable links?

    The Code Cage
      Hi all, i currently have a movie (i'm no programmer and it was all "poke and hope" creating it) where i have an icon (image) and a block of text as a clickable button (locked together) the button takes you to a specific url
      ActionScript Code:
      on(release){     geturl("http://www.thecodecage.com/forumz/excel-forum/"); }
      what i need to do is replace the geturl with some script that will add an alert box with 2 options (the reason is i've added more forums i.e Members-excel-forum and Newsgroup-excel-forum....there are many more like this), i would like the box to have a title something like "Where would you like to go from here?" then two text links "Members Excel" (which will take them to http://www.thecodecage.com/forumz/members-excel-forum) and "Newsgroup Excel" (which will take them to http://www.thecodecage.com/forumz/newsgroup-excel-forum), like i said i have many more to add but once i have the code and a "How to" i should be able to adapt it.

       

      I will have to do this for each of the items (i'll have to unlock them first) there are 24 items in my movie (it looks like 12 as there is an icon and text locked together for each category) so i need to do this for 16 of them, if anyone knows a quicker way i'm all ears!

       

      I say Alert box as this won't be bothered by a pop up blocker.

       

      Regards,
      The Code Cage
        • 1. Re: Adding alert boxes to movie items with clickable links?
          kglad Adobe Community Professional & MVP

          you should create an "alert" box movieclip in flash that contains two button links.  those links can use variables that are defined by your button so one "alert" movieclip can be used by all your buttons.  attach that movieclip when your button is clicked.

           

          if you want to create a modal alert box, add a background to your alert box that covers the stage and add a null mouse handler.  you can disable the mouse cursor.

          1 person found this helpful
          • 2. Re: Adding alert boxes to movie items with clickable links?
            The Code Cage Level 1

            Kglad, thanks for the reply........thats easy for you to say, could you explain how please?, like i said it took lots fiddling with things i have no clue on how to use to get as far as i did originally, now the movie is set i don't know how to change that.

             

            A smarter way would be if the box that appears that has the two buttons could be generic but takes the url from the geturl, so for the example

            ActionScript Code:
            on(release){     geturl("http://www.thecodecage.com/forumz/excel-forum/"); }

            if the Members button could take that url and add "members-" after "forumz/" and likewise for the Newsgroup it could add "newsgroup-" after "forumz" then the one "options" box would suffice for all of the categories i need, one other thing with that thought would be how do i get it to only show with the categories i want rather than all of them?

             

            I can supply the .fla if you wish.

             

            Regards,

            Simon

            • 3. Re: Adding alert boxes to movie items with clickable links?
              kglad Adobe Community Professional & MVP

              you should create an "alert" box movieclip in flash that contains two button links.

               

              click insert, new symbol, movieclip.  on that timeline add two buttons.  in the properties panel assign instance names: say btn1 and btn 2.

               

              find this movieclip in the library and assign it a linkage id:  say alertID

               

              instead of attaching code to your original button with the getURL (ie, remove the code your showed), assign an instance name to that button:  say btn.  you can then use:

               

              var tl:MovieClip=this;

               

              btn.onRelease=function(){

              if(!tl.alertMC){

              tl.attachMovie("alertID","alertMC",tl.getNextHighestDepth());

              tl.alertMC.btn1.onRelease=function(){

              getURL("http://url1.html");

              }

              tl.alertMC.btn2.onRelease=function(){

              getURL("http://url2.html");

              }

              }

              }

              1 person found this helpful