2 Replies Latest reply on Jul 27, 2010 4:29 AM by rHemanth

    Tutorial on creating a scrolling thumbnail menu in AS 3.0

    sourceofdenial

      I've found several good tutorials in AS2.0 on creating a scrolling thumbnail menu bar for adding to a photo gallery, but nothing in AS3.0.  Anyone have a tutorial or code they'd like to share?

        • 2. Re: Tutorial on creating a scrolling thumbnail menu in AS 3.0
          rHemanth Level 2

          A solution using tilelist component

           

          import fl.controls.TileList;

              import fl.controls.listClasses.ImageCell;

              import fl.data.DataProvider;

              import fl.events.ListEvent;

              import flash.display.Sprite;

              import flash.events.Event;

              import flash.display.Loader;

              import flash.net.URLRequest;

           

          var loader:Loader;

          var dp:DataProvider = new DataProvider();

          dp.addItem({label:"IMAGE 1",source:"images/image1.jpg"});

          dp.addItem({label:"IMAGE 2",source:"images/image2.jpg"});

          dp.addItem({label:"IMAGE 3",source:"images/image3.jpg"});

          dp.addItem({label:"IMAGE 4",source:"images/image4.jpg"});

          dp.addItem({label:"IMAGE 1",source:"images/image1.jpg"});

          dp.addItem({label:"IMAGE 2",source:"images/image2.jpg"});

          dp.addItem({label:"IMAGE 3",source:"images/image3.jpg"});

          dp.addItem({label:"IMAGE 4",source:"images/image4.jpg"});

          dp.addItem({label:"IMAGE 1",source:"images/image1.jpg"});

          dp.addItem({label:"IMAGE 2",source:"images/image2.jpg"});

          dp.addItem({label:"IMAGE 3",source:"images/image3.jpg"});

          dp.addItem({label:"IMAGE 4",source:"images/image4.jpg"});

           

          tilewindow.width=500;

          tilewindow.height=100;

          tilewindow.dataProvider = dp;

          tilewindow.rowCount=1;

          tilewindow.addEventListener(ListEvent.ITEM_CLICK,loadImage);

           

          function loadImage(event):void{

          loader = new Loader();

          loader.contentLoaderInfo.addEventListener(Event.COMPLETE,oncom);

          loader.addEventListener(IOErrorEvent.IO_ERROR,onerr);

          loader.load(new URLRequest(event.item.source));

          }

           

          function oncom(event):void{

          container.addChild(loader.content);

          loader.content.width=500;

          loader.content.height=250;

          }

           

          function onerr(event):void{

          trace(event);

          }

           

          complete source can be found here  http://www.4shared.com/file/zeOd0Dey/tileListcomponent.html