Advanced Flash Components
Search!
Search!
Home >  Knowledge Base >  Scroll Panel (AS 3.0) >  Pointing to a frame
Pointing to a frame
Date: Nov 29, 2007   Views: 1058  
Question:
Can I set the frame where linked images point to?
Answer:

space crab (Admin)
Yes, you can do that. Please take a look at the following tutorial for detailed instructions: http://www.afcomponents.com/tutorials/scroll_panel_as3/70/. Instead of pointing to URL in the onScrollItemClick function you can navigate to a frame. Here is the sample code:

import flash.events.MouseEvent;
import com.afcomponents.scrollpanel.ScrollPanelEvent;

// Handle item click
function onScrollItemClick(event:MouseEvent) {
   //gotoAndStop
}

// Wait for items to load from XML and then add MouseEvent.CLICK to each item
function onScrollXMLLoaded(event:ScrollPanelEvent) {
   myScroll.addGenericItemEventListener(MouseEvent.CLICK, onScrollItemClick);
}
myScroll.addEventListener(ScrollPanelEvent.XML_LOAD_COMPLETE, onScrollXMLLoaded);