I have an animation that loops and has different images come up with certain elements on the screen that remain the same throughout the movie. Depending on the image that is being displayed, the url of the link assigned to one of the constant elements changes with the code that I posted below.
The problem occurs when the movie loops because the URL of the constant is supposed to go back to the first link (just like everything else loops and starts at the beginning) but it remains as the last url that was declared.
Here are the three blocks of code I am using for the links, truth is the instance name of the button. These code snippets are arranged in their own “actions” layer on my timeline
Any help would be great, if needed I can supply the FLA (it is CS4 but I can downsave).
[U]**First URL
**[/U]truth.addEventListener(MouseEvent.CLICK, onMouseClick);
function onMouseClick(e:MouseEvent):void
{
var request:URLRequest = new URLRequest(“http:…/pages/calculate.html”);
navigateToURL (request, “_blank”);
}
Second URL
truth.addEventListener(MouseEvent.CLICK, onMouseClick2);
function onMouseClick2(e:MouseEvent):void
{
var request:URLRequest = new URLRequest(“http:…/pages/recycle.html”);
navigateToURL (request, “_blank”);
}
Third URL
truth.addEventListener(MouseEvent.CLICK, onMouseClick3);
function onMouseClick3(e:MouseEvent):void
{
var request:URLRequest = new URLRequest(“http:…/pages/wheretouse.html”);
navigateToURL (request, “_blank”);
}