Button inside a Movie Clip
Hi
Ok, so i have a button inside a movie clip.
I want the button, when i click it, to go to a web page in a new window.
I have put my script on the top layer of the main timeline, in a layer called 'controls'
Here is the script:
Code:
function openPhotomore(yourEvent:MouseEvent):void {
navigateToURL(new URLRequest("http://anarkiuk.deviantart.com/gallery/#Photograph"),"_blank");
};
photomore_btn.addEventListener(MouseEvent.CLICK, openPhotomore);
I have given the button an instance name of 'photomore_btn', but it seems to be inside a tween aswell?
When running the swf i get the error:
1120: Access of undefined property photomore_btn.
I'm new to flash / im confused.
How come it cant find the photomore_btn?
Any help is greatly appreciated, thanks!
re: Button inside a Movie Clip
I created an invisible button inside a movieclip and used the code below which if clicked would take you to a web page in a new window
URLVisions_but.addEventListener (MouseEvent.CLICK, URLVisions_butFunction);
function URLVisions_butFunction(event: MouseEvent)
{
var request:URLRequest = new URLRequest("http://INSERT WEBSITE HERE");
navigateToURL(request);
}
Can't promise this will work for you but give it a try and let me know.
Alan