Adding scroll function to PhotoFLIP CS (AS3)

Author: Digicrafts Last Update: 08/04/2008

Adding Scroll Bar



  1. Create the scroller

Create a UIScroller or Slider in the flash document (for UIScroller, you have to rotate the component to correct direction). Type the movie name. In this sample, we use 'scroll'.

 

 

2. Link to PhotoFLIP CS

 

Select the PhotoFLIP CS movie and choose the interactive tab.


 

In Scrollbar, type the movie name of the UIScroller/Slider we used before.



 

 

3. Test the movie.

Press Ctrl+Enter or menu "Control > Test Movie" to start testing the menu.

 

Adding Scroll Button



1. Create the scroll button

Create a button in the flash document by drag and drop from component panel. Or draw your own button and convert it to a button symbol. Fill in the instance name. In this sample, we use 'prevButton' and "nextButton.

 

Image:fototilecs_scroll_3.jpg

 

 


Image:fototilecs_scroll_4.jpg

 

2. Link to PhotoFLIP CS

Select the frame which hold the PhotoFLIP CS.
Open the ActionScript Panel (F9) . Fill in the following script. 
//add click action to the button
nextButton.addEventListener(MouseEvent.CLICK, buttonHandle);
prevButton.addEventListener(MouseEvent.CLICK, buttonHandle);

function buttonHandle(event:MouseEvent){
switch(event.target){
//call the nextItem when nextButton Click
case nextButton:
photoflip.nextItem();
break;
//call the prevItem when prevButton Click
case prevButton:
photoflip.prevItem();
break;
default:
break;
}
}