Skip to main content
Participant
September 25, 2008
Question

how to make a flash animation clickable

  • September 25, 2008
  • 8 replies
  • 2000 views
Hello, I built an animation with actionscript 3 that I want to use as a welcome page for a website... I put the animation in DW cs3 and it works but i don't know how to make it "clickable" to link it to my website's index!
it would be fantastic if someone could help me 🙂 Thank you.
This topic has been closed for replies.

8 replies

Ned Murphy
Legend
November 15, 2008
Resolved... no instance name assigned
Ned Murphy
Legend
November 14, 2008
You can either:

zip it up, upload it to a server, and provide the URL for it

or

if you don't have a server, you can check your private mail here and you'll find my email address and you can zip it up and send it to me.
Participant
November 13, 2008
Thank you, yes I can do that but how can I make the file available for download?

Yann.
Ned Murphy
Legend
November 13, 2008
There's something wrong that is probably fairly basic.

Is that code on the main timeline as well as the button?--both should be.

Is clic the instance name or the button's name in the library?--the instance name should be clic?

If those conditions are met, is there any way you can make the fla file available for download? It may be easier to give it a look than to beat it to death with Q&A.
Participant
November 13, 2008
Thank you Ned,
It says that there is a problem with this line of code: clic.addEventListener(MouseEvent.CLICK, clicked);

1120: Access of undefined property clic.

I named the button covering the stage clic

What should I do?
Ned Murphy
Legend
November 13, 2008
Be sure that you have assigned the button covering the stage the instance name "clic"

Also, to cover all bases, you will be better off to approach the code using strict AS3...

var url:String = " http://hartkopfconstruction.com";
var request:URLRequest = new URLRequest(url);

function clicked(e:MouseEvent):void{
navigateToURL(request);
}

clic.addEventListener(MouseEvent.CLICK, clicked);

Sorry, but I don't personally know any good Flash books. I've done most of my learning by doing (trying) and searching for solutions when I need them. If you search the forum you may find some recommendations. I've seen this question a few times.

Participant
November 13, 2008
Hello Aaron, Thank you so much and sorry for the late reply, I built the animation with Flash CS3 AS3, I just tried the rectangle solution and add the code but it says the following error message:

Scene 1, Layer 'clic', Frame 1, Line 2 1120: Access of undefined property clic. clic.addEventListener('click',clicked);

Here is the code:

var url = new URLRequest(" http://hartkopfconstruction.com");
clic.addEventListener('click',clicked);
function clicked(evt){
navigateToURL(url);

Also if someone could give me an advise on a good book to learn Flash, the actions script and how to build Flash websites.

Thank you for your help.
September 26, 2008
"I built an animation with actionscript 3" - does this mean you used AS3 to make the animation? Or you made the animation on the timeline?

Probably the easiest thing to do is just make a big rectangle over your whole stage on top of everything, give it a transparent fill, convert to Button (press F8), give it a Instance Name in the Properties panel (example "link_btn") and add this code to frame 1:

var url = new URLRequest(" http://example.com");
link_btn.addEventListener('click',clicked);
function clicked(evt){
navigateToURL(url);
}