00:00
00:00
Newgrounds Background Image Theme

Vaittus just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Flash CS6 2012-08-13 21:48:30


How do I link a Flash Button to a Website? :(

Response to Flash CS6 2012-08-13 21:49:59



BBS Signature

Response to Flash CS6 2012-08-14 12:59:24


At 8/13/12 09:49 PM, Attila0413 wrote: http://www.attiliocarotenuto.com/flash/93-as3-linking-to-web pages-with-navigatetourl

Okay, the problem I must be having, is WHERE to place the action script? I have over 50 buttons on one frame to be clicked, its not an animated flash, its just a screen with multiple buttons which all need to direct to a link to another page.

Response to Flash CS6 2012-08-14 13:10:14


At 8/14/12 12:59 PM, pockets08 wrote:
At 8/13/12 09:49 PM, Attila0413 wrote: http://www.attiliocarotenuto.com/flash/93-as3-linking-to-web pages-with-navigatetourl
Okay, the problem I must be having, is WHERE to place the action script? I have over 50 buttons on one frame to be clicked, its not an animated flash, its just a screen with multiple buttons which all need to direct to a link to another page.

package {

import flash.display.SimpleButton;

import flash.net.navigateToURL;

import flash.net.URLRequest;

import flash.events.MouseEvent;

public class byers_btn extends SimpleButton{

public function LinkButton() {

addEventListener(MouseEvent.CLICK, onMouseClick);

}

function onMouseClick(event:MouseEvent):void{

navigateToURL(new URLRequest("http://www.google.com"), "_blank");

}

}
}

is IN the AS, on the button itself...is that correct? it doesnt work. lol

Response to Flash CS6 2012-08-14 13:25:28


At 8/14/12 01:10 PM, pockets08 wrote: is IN the AS, on the button itself...is that correct?

No, you can't place code in object in AS3. What you've got there is a class. Maybe you should go read some AS tutorials (like this one) rather than just copy and pasting code.


The water in Majorca don't taste like what it oughta.

| AS3: Main | AS2: Main | Flash Tutorials |

BBS Signature

Response to Flash CS6 2012-08-14 13:35:33


At 8/14/12 01:25 PM, Kirk-Cocaine wrote:
At 8/14/12 01:10 PM, pockets08 wrote: is IN the AS, on the button itself...is that correct?
No, you can't place code in object in AS3. What you've got there is a class. Maybe you should go read some AS tutorials (like this one) rather than just copy and pasting code.

Well the thing thats urking me, is Ive done this before - but the codes all been erased, and its been like 3 years. So I have to redo it all - and Unfortunatley I have been searching for the tutorials that I need - but I dont have a lot of time to search from scratch. My deadline was Yesterday, and Ive got everything done visually, minus the vanished code. Its just a simple question - and the copy and pasted code, was from the link i was sent previously - which used the class, but didnt explain anything else.

Response to Flash CS6 2012-08-14 14:16:26


http://www.republicofcode.com/tutorials/flash/as3link/

thats the tutorial I was using, and Ive used it before -

byers_btn.addEventListener(MouseEvent.CLICK, onClick);
function onClick(e:MouseEvent):void{
navigateToURL(new URLRequest("http://www.fairlawnplaza.com/"), "_blank");
}

but in line two, the "Class or Interface of "MouseEvent" could not be loaded, is there a specefic Mouse function name, im supposed to use?

Response to Flash CS6 2012-08-14 14:27:32


At 8/14/12 02:16 PM, pockets08 wrote: but in line two, the "Class or Interface of "MouseEvent" could not be loaded

import the class