Click to See Complete Forum and Search --> : Flash, on button click navigate to some URL


xandeq
11-14-2010, 07:32 AM
Hi there,

I'm using Actionscript 3.0.
I have 3 layers on my stage.
The button is the last object to show on stage.
So i put the following action on its last frame:

stop();
function Example(s:Stage)
{
this.stageReference = s;
entrar_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
var link:URLRequest = new URLRequest("www.google.com");
navigateToURL(link);
}
}


It shows me no ERROR on compilation or execution.
BUT it doesnt open/navigate/redirect to the URL.

somebody please help.

Thank you.

mankis
11-22-2010, 11:45 AM
Where do you call Example(); function? Why do you need that function?
If you need only to navigate to URL why don't you use just this?

stop();
entrar_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void
{
var link:URLRequest = new URLRequest("www.google.com");
navigateToURL(link);
}

mankis
11-22-2010, 12:11 PM
Why do you need this Example() function? Where do you call that function?
If you need just to navigate to URL why don't you simplify it like this:


stop();
entrar_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void
{
var link:URLRequest = new URLRequest("www.google.com");
navigateToURL(link);
}

mankis
11-22-2010, 12:12 PM
I'm new here. How can I edit or remove post? First I tought that it hasn't been sent and now I see two posts.

Eye for Video
11-22-2010, 08:22 PM
OOHHH NOO!!
I think they just kick you OFF the Forum when you do a double post like THAT!!
or... we just say "Welcome!!" Glad you are here offering to help!
Best wishes!
EfV