Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Flash (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 16th, 2004, 09:07 PM
Friend of Wrox
 
Join Date: Sep 2003
Location: Madison, Wisconsin, USA.
Posts: 451
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ben Horne
Default How do I use onClick in Flash?

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"
__________________
Ben Horne
-------------------------
I don\'t want to sound like I haven\'t made any mistakes. I\'m confident I have.

Most likely using FireFox and concocting my next Macromedia Flash project
Snibworks Forums Moderator

Welcome to the New Age
 
Old April 16th, 2004, 09:17 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

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

<><
 
Old April 16th, 2004, 09:33 PM
Friend of Wrox
 
Join Date: Sep 2003
Location: Madison, Wisconsin, USA.
Posts: 451
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ben Horne
Default

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"
 
Old April 16th, 2004, 10:12 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

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','flashPopW in')

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

<><




Similar Threads
Thread Thread Starter Forum Replies Last Post
onClick crmpicco Javascript How-To 1 March 21st, 2005 09:18 AM
onClick crmpicco HTML Code Clinic 2 February 24th, 2005 11:28 AM
How Do I Use 'OnClick' in Flash? Lucy Flash (all versions) 1 January 25th, 2004 11:59 PM
table onClick miguel.ossa ASP.NET 1.0 and 1.1 Basics 4 January 23rd, 2004 05:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.