New to Flash - please help

I am trying to create a simple slideshow. Each time a new
photo comes up, I need the viewer to be able to click and go to a
separate html page for each photo. I know this is very simple, but
I keep getting code errors. The first photo works, but after that,
I get duplication errors. Any help would be greatly appreciated.
This is what the original code looks like. I thought all I
needed to do was copy and paste it with each keyframe and then just
change the html redirect page.
inv_btn.addEventListener(MouseEvent.CLICK,
buttonClickHandler);
function buttonClickHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("
http://www.golfozarks.com/little_league/bk-auto/john-botson.htm"));
trace("");
The Flash is playing right now at
http://www.golfozarks.com/little_league/bk-auto/roster.htm

Without seeing what the errors are saying I am only guessing
that the duplication may be regarding the addEventListener
attachments. You may be able to get away with using:
inv_btn.removeEventListener(MouseEvent.CLICK,
buttonClickHandler);
ahead of each secondary (after the first frame) assignment of
adding the listener.
Another more efficient approach would be to have the
buttonClickHandler and event listener remain constant, but pull the
urlRequest out as a separate variable and only change its value for
each player's frame.
So you'd have a layer that spans all other layers that
contains the url variable declaration, event listener assignment,
and the buttonClickHandler function, and only in the first frame.
var url:URLRequest = new URLRequest();
inv_btn.addEventListener(MouseEvent.CLICK,
buttonClickHandler);
function buttonClickHandler(event:MouseEvent):void {
navigateToURL(url);
Where only the url value changes with each player frame:
url = "
http://www.golfozarks.com/little_league/bk-auto/...etc"

Similar Messages

Maybe you are looking for

  • Problem with slow execution on a cFP-2120

    I have an application that runs on a cFP-2120, using web interface for the user to interact with the program. I have noticed that in order to get the web interface to get updated I have to use property nodes and write to the value property, see this

  • Need a driver that will work for HP Color Jet Laser Printer with OS 10.7

    How can I download a drive, and fom where, that will allow me to print from a Mac Book Air with OS 10.7 from an HP 1600 LASER COLOR JET. Thank you

  • Comparison between split Adapter in Seeburger and EDI Separator

    Hello All, Currently we are designing EDI interfaces using B2B Add-On. I am trying to compare the split Adapter of Seeburger and EDI Separator of B2B Add-on. In Seeburger Splitter configuration: The additional split configuration helps to map the Sen

  • How do I get water marks off of my phone case screen?

    I recently bought an iPhone 5 case from t mobile and I tried wiping the screen down with some water and drying it off because is was dirty. When it dried and I put it on my phone, there were there little purple shiny marks on the case screen so I tho

  • Safari 5.1 quits immediately on one user account

    After updating this morning (still on Snow Leapord - latest updates installed) Safari 5.1 quits immediately upon opening in my main user account. The "testuser" account works fine. Can't cut and paste the log details between accounts. Sorry