Avatar of NickDionne
NickDionne

asked on 

Flash Mx2004 - Actionscript

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

Adobe Flash

Avatar of undefined
Last Comment
CyanBlue
SOLUTION
Avatar of Zeffer
Zeffer
Flag of New Zealand image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of CyanBlue
CyanBlue
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of NickDionne
NickDionne

ASKER

ok i placed the code into another layer, now it just wont open up the link. Any ideas?
Avatar of NickDionne
NickDionne

ASKER

EDIT:: I used the behaviors on the button to fix the problem using the go to webpage behavior.  Thanks for your help
Avatar of CyanBlue
CyanBlue
Flag of United States of America image

You're very welcome...  :)

CyanBlue
Adobe Flash
Adobe Flash

Adobe Flash (formerly Macromedia Flash) is a cross-platform multimedia and software platform used to embed animations, video, and interactive applications into web pages and desktop and mobile applications and games. Flash displays text, vector and raster graphics to provide animations, video games and applications. It allows streaming of audio and video, and can capture mouse, keyboard, microphone and camera input. The ActionScript programming language allows creation of interactive animations, video games, web applications, desktop applications and mobile applications.

29K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo