5 Replies Latest reply on May 25, 2007 1:59 AM by purple_am

    Guide to infinite menu

    purple_am
      Hey

      I need some help to develop an infinite menu example, for an image gallery.
      Well i need the menu to be dynamic since images will be uploaded from a backffice at anytime.

      Can anyone help. Some guidelines about how to develop the actionscript.

      Thanks in advance.
        • 1. Re: Guide to infinite menu
          Gorka Ludlow Level 1
          Hello,
          this is what i would do:
          1.- read the data for the gallery (we know it is not infinite, though we don`t know the length until we receive all the data) with your favorite method (loadVars or XML)
          2.- Loop through the data and add images to the gallery dynamically with attachMovie. attachMovie should be attaching a MovieClip in your library which should be exported for actionscript. Everytime you attach a movie you can position it and send some initial values for it to work differently than any other.
          3.-- In the MoviClip you'll be loading dynamically you should have a place to put the thumbnail, or image (loader, scroolpane, another movieclip, etc), and make sure you send the file name to the movieclip so that it knows what to load.

          If you need some extra pointers feel free to ask
          Cheers
          Gorka
          • 2. Re: Guide to infinite menu
            purple_am Level 1
            well i understood steps 1 and 2 ... but am confused with these ...
            "Everytime you attach a movie you can position it and send some initial values for it to work differently than any other.
            3.-- In the MoviClip you'll be loading dynamically you should have a place to put the thumbnail, or image (loader, scroolpane, another movieclip, etc), and make sure you send the file name to the movieclip so that it knows what to load."

            Can i have some more precesions please.

            Good day
            am
            • 4. Re: Guide to infinite menu
              Gorka Ludlow Level 1
              attachmovie works this way:

              attachmovie(movie_clip_identifier, new_instance_name, depth [, initObject]);

              you could use this:

              attachmovie(picture, 'picture'+i, this.getNextHighestDepth(), {_x:i* picture_width + offset, _y:i*picture_height+offset, File:var_file}]);
              i++;

              **assuming picture is the identifier for the movieclip you'll attach
              'picture'+i - assigns a different name for every mc you attach
              _x and _y - are used to place the images in the moviclip that is going to hold them
              File - will be a variable inside the picture instance created that you can use to tell a loader or scrollpane what content to load (more code ahead)

              inside picture mc:

              // you'll need a loader component named loader in the stage
              var File:String;
              function init():Void{
              loader.contentPath = File;
              loader.load();
              }
              init();

              That's what I meant, let me know how you do
              Cheers
              Gorka
              • 5. Re: Guide to infinite menu
                purple_am Level 1
                thanks guys, am onto it.