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.
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-navigatetourlOkay, 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
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.
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.
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?