Making a image a hyperlink

Hey guys how would i make it so when a user clicks on the image it would open their browser and goto my website?

Hook the picture up to an “on clicked” handler. Then…


on clicked theObject
open location "http://www.yourwebsitehere.com"
end clicked

Actually, the image view class does not support the ‘clicked’ handler, despite the fact that it is available to you in IB. The most common method of working around this is to add a button to your project that will sit above the image view and handle the clicked event for it. I prefer to set mine as a square button. Disable the “Bordered” property and enable the “Transparent” property. Set it’s size to match the size of the image view completely, and set it to resize as the image view does. Then you can use something like the following to catch the button’s clicked action…

on clicked theObject
	if name of theObject is "overlayedButton" then
		open location "http://www.yourwebsitehere.com"
	end if
end clicked

j

An image view doesn’t but a matrix with image cells does. So you can easily ‘convert’ the image view in a matrix with a single image cell (by option-dragging). Then it supports ‘on clicked’ :wink: