PDA

View Full Version : Making SWF banner clickable


Yaro007
07-14-2009, 09:34 AM
Hi Guys,

I have got stuck on what seems to be a very simple task.
I have an animated flash banner for the website, but I cannot make it clickable, so that visitors can click on any part of it, and be tranfered to another website page.

Could anyone please help me out? :rolleyes:

I am quite new to Adobe Flash, I use CS4 to edit. :(
I have tried making transparent rectangles, converting them to a Button type, inserting various codes, but all that I tried has no effect :eek::confused:

DukeW
07-14-2009, 11:46 AM
Add this code to the first frame of your fla:
stage.addEventListener(MouseEvent.CLICK, navTo)
function navTo(e:Event)
{
navigateToURL(new URLRequest("http://www.google.com"),"_blank");
}
Change "http://www.google.com" to what ever you wish.
Best regards.

Yaro007
07-14-2009, 12:29 PM
Hi DukeW ! :D

Thanks for your response, I have about 7 layers on there, I tried inserting a code into the first frame, of the first layer, and then to all layers (first frame). However, still nothing happens :eek::o

DukeW
07-14-2009, 12:36 PM
Try restarting flash, making sure your firewall/antivirus isn't stoping the browser from opening the url because i downloaded your fla placed the code directly in the first frame on first layer and it worked perfectly.

Yaro007
07-14-2009, 12:44 PM
:confused: you couldnt please send me the edited file, could you?

I tried making a new flash file, and the codes worked on it. So maybe i'm doing something wrong when i insert the codes in this file... :rolleyes:

DukeW
07-14-2009, 12:50 PM
Here you go:http://edituraedu.ro/clickablebanner-1.fla

Yaro007
07-14-2009, 01:23 PM
Thanks for that :confused:
is it also possible to publish the clickable SWF file?

I have tried publishing and testing your fla file, and still same result.
Tried switching off firewall and antivirus, no change.
Will re-install CS4 in about 1 hour (another version).

Could you in the meantime put the link to the SWF clickable file?
Which program do you use?
:D

DukeW
07-14-2009, 01:31 PM
Hey
Same url, just change .fla to .swf. Don't go out on the street with your luck it might be dangerous :p .

Yaro007
07-14-2009, 01:35 PM
Yeah, your SWF works fine on my comp ;)
must be something with my CS4 :mad:
Do you use Adobe Flash CS4 too, or another one? :eek:

DukeW
07-14-2009, 01:50 PM
I have both CS3 and CS4 and alternate them, but I always do the last save of the day in CS4 for compatibility with coworkers.

Yaro007
07-19-2009, 06:35 PM
Hi DukeW,

Thanks for your help, especially that you proved to me that something was wrong on my computer, and not on the file :rolleyes:

I have done 1000 + 1 things to try and figure it out, and in the end it worked.

Things I have done, included:

1. Moving the .fla file from the original editing folder, where I had many additional files, including the MainTimeline.as

2. Updated flash to 10.0.2

Many thanks again ;):D:)