Adding url to flash banner

Hi, I am new here so glad to meet you all.

I have the following situation: I have to put a link into a flash banner with a duration of around 20 seconds. I know I have to do it through Adobe Flash, but none of the codes I have tried have worked so far, and I am stuck.

Som of the codes I have tried are the next ones:

hitSpot_mc.addEventListener(MouseEvent.CLICK, callLink);
function callLink(event:MouseEvent):void {
var url:String = “http://www.google.com”;
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, ‘_blank’);
} catch (e:Error) {
trace(“Error occurred!”);
}
}

myBtn_btn.onRelease = function(){
getURL(“http://www.xxxxxx.com”);
};

And some more I don’t remember

Any help will be more than welcome.

Thank you all.

Hi, I’m new here as well. The following should help a bit.

You need to first check to see what version of actionscript your flash is using. You can create a flash file with actionscript 2 or 3. The first code that you have posted will work with 3 and the second will work with 2.

You can find out which version your file was created in by opening the file and then checking the ‘Script’ property in the ‘Properties’ window of flash.

Remove the code that is not applicable with your version of Actionscript if you have not done so already.

You then need to make sure that your button has the same instance name as what is in your code (the first bit before the dot in both instances). See if this suggestion makes a difference in your troubleshooting and let us know what the compile error(s) are if it doesn’t.

The other thing to check is that the referenced clip that you are trying to attach the click action to, persists on its own timeline for the entire duration of the movie

The thing is, the whole animation is done in Flash, so I haven’t really imported a movie. What I mean is that there is not a single clip on the timeline, there are several layers that run throughout the 20 seconds.

Thanks for the inputs.

The clip with the click reference has to be on a layer that runs for the same length to the right as any other layers

It does run along the full duration of the clip. Still doesn’t work… :frowning:

If you want to post the .fla I can take a look if you want

I am afraid I can’t, but thanks anyway.

I still haven’t fixed it… :frowning: