Nicole Henningsen's Blog
Posted At : May 22, 2008 10:43 AM | Posted By : Nicole Henningsen

Linking a movie clip in AS 3.0

I was working on a project early this morning trying to get a movie clip to link onClick to a URL. Out of habit I just starting using getURL and of course it was erroring because I was compiling using AS 3.0 ;). There is a little more to it in AS 3.0 as I found out.

myClip.addEventListener(MouseEvent.CLICK, myButtonFunction);
function myButtonFunction(event: MouseEvent) {
var request:URLRequest = new URLRequest("http://www.cfwebtools.com.com/");
navigateToURL(request, '_self');
}

The navigateToURL of course will determine how you want to open your link. Example in a new window or to open in the same window. Here is an example of opening in a new window.

navigateToURL(request, '_blank');

Comments



Blog provided and hosted by CF Webtools. Blog Sofware by Ray Camden.