K
K
Katisha2016-04-19 15:33:25
Adobe
Katisha, 2016-04-19 15:33:25

How to write code on the Actionscript 3 button to make the banner clickable?

Please help me figure out what's going on: on the finished banner I make a transparent top layer with a button, I prescribe the name btn to it, then I hang the code on the first frame:
btn.addEventListener(MouseEvent.CLICK, clickHandler);
function clickHandler(e:MouseEvent):void{
navigateToURL(new URLRequest(" www.mail.ru "), "_blank")
}
This results in the error "1120: Accessing non-existent btn property". What's the matter that I forgot to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
illuzor, 2016-04-20
@Katisha

It's all written in error.
If it's a banner, you can try replacing btn with stage or this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question