troubleshooting Question

Flash Mx2004 - Actionscript

Avatar of NickDionne
NickDionne asked on
Adobe Flash
5 Comments2 Solutions342 ViewsLast Modified:
program: Macromedia Flash MX2004 - actionscript

I am trying to link a button to open a webpage WHEN CLICKED to google for example. I found this code on macromedias help but I keep getting an error.

CODE:
homepage_btn.onRelease = function () {
  getURL("http://www.google.com", "_blank");
};

This is the error I get:

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Statement must appear within on handler
     homepage_btn.onRelease = function () {

Total ActionScript Errors: 1        Reported Errors: 1

Thanks for your help

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros