PDA

View Full Version : Linking to URLS with movie clips?


harpwing
07-30-2008, 01:07 PM
Hey there,

I'm familiar with HTML, however not so much on Flash.

I'm having a little problem with linking movie clip buttons to URLs in a small calendar when the dates are selected.

The calendar is not my own, i'm just trying to make it so that when a date is picked it forwards the user to a URL.

I've tried the following code...

on (release) {
getURL ("http://www.url.com");
}

...but it simply says that I cannot apply mouse effects to movie clips (something similar to this anyway).

I'm using Flash CS3 for this, I've attatched the file.

Thanks! ;)

jason2d
07-31-2008, 04:08 PM
Hi Harpwing. Where are you putting the code? If you are placing the code directly on the movieClip then you should be fine with:


on(release){
getURL("www.url.com");
}


If you are putting your code on the main timeline in its own layer, you need to firstly give you movieclip an instance name, i called mine date_mc for this example. Then you need to link the code to this movieclip like this:


date_mc.onRelease = function(){
getURL("www.url.com");
}


Hope this helps :D

harpwing
08-01-2008, 01:15 PM
Yep, the second bit of code was useful - it's working now!

Thanks, this helped a lot. ;)

Norton
08-03-2008, 05:14 PM
Hi Jason,

I try the 1st one, it seems ok when I test with Flash CS3. But, when I run alone with Flash Player 9 or Firefox, an error message says that i must change some things in settings, because of security settings. How can I solve that problem? Is that error browser errors or I need to modify in my code?

When I click the link, the link will be opened in the same windows or in new window? I cant try it, since I get into the above error.

Thanks.