...

View Full Version : "click to enlarge" in flash



stanleyd25
07-24-2009, 09:43 PM
Is there any action script you can put on an image in flash that "on-click" makes it open up in a new web browser page with a magnifying glass to be able to zoom in and pan around the image? I'm really new to flash so any help would be much appreciated. Thanks

gnomeontherun
07-24-2009, 11:37 PM
You could make a link on the image that would open up a new window with a new Flash window, that loads that image.

You would need to start with making the icons that open a new window.

I'll help you conceptually, but what version of AS?

stanleyd25
07-26-2009, 12:45 AM
I'm currently working with Adobe Flash CS3 Pro which is version 9 I think. Ok, so how is it that like on shopping websites or whatever, when you click on an image it opens up a window with a larger image and a magnifying glass to be able to zoom in and even pan around the image. Any hopes of doing something like that in flash?

gnomeontherun
07-26-2009, 01:01 AM
Sure, but the question is still which version of Actionscript, 2 or 3?

The basic functions for opening a new window in version 2 are getURL (look at the documentation for examples on how to use it) and then the zoom function would be a separate page with something like this

http://www.artluvr.com/2008/03/22/magnifying-glass-zoom-flash-actionscript-2/

If you want to use AS3, there are other methods but similar processes.

stanleyd25
07-26-2009, 06:10 AM
I'm using AS 2.0. That's all pretty much Greek to me man. I'm new to all this flash stuff. Could you break it down a little bit for me?

gnomeontherun
07-26-2009, 10:48 AM
Oh I'll try, but its going to require some experience with coding to get this to work.

Start with this.

http://www.developingwebs.net/flash/geturl.php

It will help you make the links in the main movie to open a new window.

stanleyd25
07-26-2009, 04:08 PM
ok i've done that with the picture i want make into the link now.

gnomeontherun
07-26-2009, 05:54 PM
Make another file and do this tutorial.

http://www.webwasp.co.uk/tutorials/b11-magnify/index.php

That will show you how to make the magnify effect. Then lastly we'll have to change it so that it will load the same image that was clicked.

stanleyd25
07-27-2009, 09:14 PM
i can't open up that tutorial without a "members password" it says.

gnomeontherun
07-27-2009, 10:13 PM
http://www.webdesign.org/web/flash-&-swish/flash-tutorials/animated-magnify-effect.14833.html

There are others online if you want to search for them.

stanleyd25
07-29-2009, 02:50 PM
Ok, I did this flash video tutorial and that's not really what I want o do. What would be the easiest way to just have a new browser window open with a larger size image?

stanleyd25
07-29-2009, 03:39 PM
here's an example of what I mean. When you click the picture it opens up a new box with a larger image.

http://www.circuitcity.com/applications/SearchTools/item-details.asp?EdpNo=4651424&Sku=W330-1602

gnomeontherun
07-29-2009, 04:40 PM
Then just have it open up a new link with javascript.

http://kb2.adobe.com/cps/141/tn_14192.html

stanleyd25
07-30-2009, 12:06 AM
ok cool I got the new browser window to open. Now I need to know how to get the larger image file I want to pop up in that window. And another little thing...in the new browser window that opens it says "untitled". How can I change that?

gnomeontherun
07-30-2009, 12:16 AM
Well link directly to the large image, you'll have to know that in the actionscript so that it opens a new window directly to that image. Or you can create some kind of PHP page that accepts a variable and displays that image.

stanleyd25
07-30-2009, 02:18 AM
So what would I have to put in the action script? Here's my scripting to open the new browser window:

on (release) {
getURL("javascript:openNewWindow('http://www.macromedia.com','thewin','height=400,width=400,toolbar=no,scrollbars=yes') ");
}


Would I need to link to the larger image in THIS scripting here or somewhere else?

gnomeontherun
07-30-2009, 11:44 AM
Yes right on. So the way of easiest programming is to put this on each image button, and then change the URL to link to the bigger version. If you are messing with a lot of dynamic images, this becomes impractical though, not sure what your setup is.



on (release) {
getURL("javascript:openNewWindow('link-to-the-image','thewin','height=400,width=400,toolbar=no,scrollbars=yes') ");
}

stanleyd25
07-30-2009, 02:39 PM
haha, I told you I'm an amateur. I 'm not sure how to include a link to an existing image in this scripting. Do I link to the actual image file? Or do I import the image to my library in the flash file? A little help?

gnomeontherun
07-30-2009, 03:14 PM
Yeah just put the URL to the image itself, the full URL. This is the simplest way to do it. There is no need to import something unless it is in Flash itself, the new window will be outside of Flash.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum