Subject: How do I use onClick in Flash?
Posted By: Ben Horne Post Date: 4/16/2004 9:07:38 PM
Hi all,

How can I use an onClick function in a Flash movie?  I was thinking that I could just use image thumbnails in the movie and use a window-open event (if ActionScript even suppports this) to open the image in a new window when the image thumbnail is clicked.  Of course, I would not be doing this for all images.  I think this is a viable alternative to storing the full size image in the Flash library because I believe it would help keep the movie size down considerably.

Thanks in advance,



Ben Horne
Madison Area Technical College student

-------------------------
http://community.webshots.com/user/valerian114

"There are two kinds of people in the world: Those who claim to be Flash junkies and those who actually are Flash junkies"


Reply By: Snib Reply Date: 4/16/2004 9:17:55 PM
Well, I usually use (once again) the behaviors panel. For buttons, there's a Click event. For most other things, use the Release event.

Of course, you can skip the Behaviors Panel if you know ActionScript.

In the ActionScript for the object, I think it looks something like this:

on(release) {
 //the action you want to occur, such as "Go to Web Page"
}

HTH,

Snib

<><
Reply By: Ben Horne Reply Date: 4/16/2004 9:33:37 PM
Snib,

I hear ya.  I need to use an event that'll open a web page in a new window, though.  How can I do this?

Ben Horne
Madison Area Technical College student

-------------------------
http://community.webshots.com/user/valerian114

"There are two kinds of people in the world: Those who claim to be Flash junkies and those who actually are Flash junkies"


Reply By: Snib Reply Date: 4/16/2004 10:12:49 PM
Like I posted in the FAQ, you can run a JavaScript. Just put this in the Go to Web Page text box:

javascript:window.open('your_popup.php','flashPopWin')

Put the page you want to pop up where I entered "your_popup.php". Don't put a ';' at the end because Flash doesn't except ';' as a valid Web Address character.

Let me know if there is more to the problem.

Snib

<><

Go to topic 1731

Return to index page 86
Return to index page 85
Return to index page 84
Return to index page 83
Return to index page 82
Return to index page 81
Return to index page 80
Return to index page 79
Return to index page 78
Return to index page 77