Scrolling Thumbnail Panel - How to access the thumbnail???

  • FlyHigh5
  • Newbie
  • Newbie
  • User avatar
  • Posts: 14

Post 3+ Months Ago

Hi,

I have used this tutorial to create a scrolling thumbnail panel, and it works fine. But now I need to display the image for the thumbnail being clicked. I thought by naming the instance of my thumbnail button on my panel, I could determine which thumbnail is clicked and display its corresponding image.

I am getting the following error:
1120: Access of undefined property thumb1Btn.

I am new using AS3, and most likely am not doing the right thing.
Could you please help?

Thanks

Here's the code:

ACTIONSCRIPT Code: [ Select ]
panel.addEventListener(MouseEvent.MOUSE_OVER, panelOver);
 
function panelOver(event:MouseEvent):void {
    panel.removeEventListener(MouseEvent.MOUSE_OVER, panelOver);
    panel.addEventListener(Event.ENTER_FRAME, scrollPanel);
   
}
 
var b:Rectangle = stroke.getBounds(this);
 
function scrollPanel(event:Event):void {
    if(mouseX < b.left || mouseX > b.right || mouseY < b.top || mouseY > b.bottom) {
        panel.removeEventListener(Event.ENTER_FRAME, scrollPanel);
        panel.addEventListener(MouseEvent.MOUSE_OVER, panelOver);
    }
       
    if(panel.x > 25.1) {
        panel.x = 25.1;
    }
    if(panel.x < -2181) {
        panel.x = -2181;
    }
    var xdist = mouseX - stage.stageWidth / 2;
    panel.x += -(xdist / 10);
}
 
import flash.events.MouseEvent;
// onRelease
thumb1Btn.addEventListener(MouseEvent.CLICK,onReleaseMyButton);
function onReleaseMyButton(event:MouseEvent):void {
    var loader:Loader = new Loader();
    loader.load(new URLRequest("image1.swf"));  
}
  1. panel.addEventListener(MouseEvent.MOUSE_OVER, panelOver);
  2.  
  3. function panelOver(event:MouseEvent):void {
  4.     panel.removeEventListener(MouseEvent.MOUSE_OVER, panelOver);
  5.     panel.addEventListener(Event.ENTER_FRAME, scrollPanel);
  6.    
  7. }
  8.  
  9. var b:Rectangle = stroke.getBounds(this);
  10.  
  11. function scrollPanel(event:Event):void {
  12.     if(mouseX < b.left || mouseX > b.right || mouseY < b.top || mouseY > b.bottom) {
  13.         panel.removeEventListener(Event.ENTER_FRAME, scrollPanel);
  14.         panel.addEventListener(MouseEvent.MOUSE_OVER, panelOver);
  15.     }
  16.        
  17.     if(panel.x > 25.1) {
  18.         panel.x = 25.1;
  19.     }
  20.     if(panel.x < -2181) {
  21.         panel.x = -2181;
  22.     }
  23.     var xdist = mouseX - stage.stageWidth / 2;
  24.     panel.x += -(xdist / 10);
  25. }
  26.  
  27. import flash.events.MouseEvent;
  28. // onRelease
  29. thumb1Btn.addEventListener(MouseEvent.CLICK,onReleaseMyButton);
  30. function onReleaseMyButton(event:MouseEvent):void {
  31.     var loader:Loader = new Loader();
  32.     loader.load(new URLRequest("image1.swf"));  
  33. }
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • FlyHigh5
  • Newbie
  • Newbie
  • User avatar
  • Posts: 14

Post 3+ Months Ago

Don't worry, I found a different way!

Thanks

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 22 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.