Questions
Answer
How to use events
First, make sure the product you want to use dispatches events. You'll find this specified in the install instructions for Flash from the product's page.
Open your existing Flash project and drag the desired component on your stage.
Make sure the component is selected and give it an instance name, e.g. component. Keep in mind that you have to use the same instance name in the actions panel as well.
Open the actions panel and paste the following code:
component.addEventListener("itemRollOver", itemRollOverHandler);
component.addEventListener("itemRollOut", itemRollOutHandler);
component.addEventListener("itemClick", itemClickHandler);
function itemRollOverHandler(e:Event):void {
trace("you rolled over item" + e.currentTarget.focusedItem);
}
function itemRollOutHandler(e:Event):void {
trace("you rolled out from item" + e.currentTarget.focusedItem);
}
function itemClickHandler(e:Event):void {
trace("you clicked on item" + e.currentTarget.focusedItem);
}
Replace the code within the functions that are defined above to add the functionality that you desire.
Note: Don't forget to remove the value of url attributes in the assets file (images.xml, menu.xml) to have the click function working.
Comments
Do you have a question?
you will get an answer in 24 hours, tops.





Mike Mezzacappa
Posted 2 months agoi am receiving this error when i click on an item in the carousel
TypeError: Error #1009: Cannot access a property or method of a null object reference. at classes::Carousel/navigateToLink()
I dont want the component to open and external link
Hi,
Please send us the link to your website and we will check where the problem is.
os
Posted 3 months agoHi, I have a quick question about Banner Rotator FX.
I want left/right arrow keys to control the images. When you hit the right arrow key, the next image comes up, for example. Is there any way to make it in Actionscript 2?
Thank you!
os
Hi,
No sorry.
john
Posted 3 months agoHI again,
I’m working on the text-menu component and it works fine with the method mentioned in the Q&A
about using events , but is there a way that i can determine which item i clicked so that i can
have a specific action for different items?
ex: when i clicked the “Home” button, i want to dispatch event A, when i clicked the “product” button, i want to dispatch event B…etc
e.currentTarget.focusedItem is the value of the button. for example if e.currentTarget.focusedItem is equal to 0, you have press the first button, and so on.
Chris
Posted 6 months agoRegarding the Accordion component, if I want to trigger an event from clicking on one item, how would I target that? Below targets the entire component.
MainMenu.addEventListener(“itemRollOver”, itemRollOverHandler);
function itemRollOverHandler(e:Event):void {
trace(“you rolled over item” + e.currentTarget.focusedItem);
}
This doesn’t work:
MainMenu0.addEventListener(“itemRollOver”, itemRollOverHandler);
function itemRollOverHandler(e:Event):void {
trace(“you rolled over item” + e.currentTarget.focusedItem);
}
cmaaga
Posted 8 months agoHi,
It is possible to put voting system (something like here: http://www.hypermodernism.info/work/coverflow/redcarpet.html) into 3d carousel AS2? Or how put the button into photo (only when mouse hover).
What you want would require some changes to our product but unfortunately we don’t have anyone available for custom work anymore.