1 Reply Latest reply: Jun 25, 2010 2:10 AM by Smitch1581 RSS

    ScrollPane issue

    Smitch1581 MeganK

      Hi all,

       

      i was hoping someone out there could help me with a scrollpane issue in CS5.

       

      The code below adds in a thumbnail at the bottom and once you click it a bigger image appears via the UILoader at the top. This works fine, i then added a scrollPane from the Components, and gave it an instance name of myScrollPane. I added 'myScrollPane.source = allThumbnails;' at the top of my code, and also 'myScrollPane.update();' within the code where i was advised from a training video.

       

      It seems to be updating the ScrollPane OK but there is NO scroll at the bottom to scroll through the thumbnails! If i squash the height of the ScrollPane, the verticle scroll works but if i reduced the width nothing happens, am i missing a trick! The ScrollPane verticle and horizontal scroll is set to auto and i haven't touched any of the settings.

       

      Is there any extra code i need to add?

       

       

       

       

       

      This is some of my code. I have 10 images in total and the rest of the code is just duplicating the below:

      myScrollPane.source = allThumbnails;
      var thumbloader:Loader = new Loader();
      thumbloader.load(new URLRequest ("Small/Photo1S.jpg"));
      thumbloader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoader);
      function thumbLoader(event:Event):void{
      //addThumnails
      allThumbnails.addChild(thumbloader);
      myScrollPane.update();
      allThumbnails.buttonMode = true;
      thumbloader.addEventListener(MouseEvent.CLICK, LoadMain1);
      function LoadMain1 (event:MouseEvent):void {
      LargeUILoader.source = "Large/Photo1L.jpg";
      }
      }
      var thumbloader2:Loader = new Loader();
      thumbloader2.load(new URLRequest ("Small/Photo2S.jpg"));
      thumbloader2.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoader2);
      function thumbLoader2(event:Event):void{
      //addThumnails
      allThumbnails.addChild(thumbloader2);
      thumbloader2.x=120;
      myScrollPane.update();
      allThumbnails.buttonMode = true;
      thumbloader2.addEventListener(MouseEvent.CLICK, LoadMain2);
      function LoadMain2 (event:MouseEvent):void {
      LargeUILoader.source = "Large/Photo2L.jpg";
      }
      }