PDA

View Full Version : HELP w/ simple actionscript?


slowguy
08-08-2009, 01:37 AM
Hey guys, i hav a problem making a website. Im u kno, slow... anyways can someone explain/fix my problems here? Im trying 2 make a link 2 another website but it says "the class or interface 'MouseEvent' could not be loaded. Some1 told me that means i hav 2 convert into Actionscript 3.0. I did that, but i get a whole lot of problems which i fixed, but now i cant make links. Basically the problem is that actionscript on objects are completely ignored in 3.0. Maybe it just does that or something. Can someone help me out here? It confuses me like hell! Well, a lot of things do...

I dont really understand flash, so maybe im missing something really simple.

My actionscript is rite here.
button1.addEventListener(MouseEvent.CLICK, goToURL1);
function goToURL1(e:MouseEvent): void{
navigateToURL(new URLRequest("http://www.biomicsinc.com/Products.htm"));
}

When I convert 2 actionscript 3.0 it causes these errors:

Syntax error: extra characters
Migartion error 1058 and 1090

Any help would totally be appreciated. Any criticism would also be accepted.

Slowguy

snickelfritz
08-08-2009, 01:47 AM
Your FLA document properties should be set to Actionscript 3.0 and Flash 9.0.
You can do this in the properties panel in settings.
You need a button or movieclip on the stage on frame1, with an instance name of "button1".
Your actionscript should be on frame1 of the main timeline.

slowguy
08-08-2009, 05:08 AM
Does it hav 2 be on frame1? And the real name for the button is "pizzathingwithtwozs"
And i did put it on Flash Player 9 and actionscript 3.0. Thats when it has the errors.

snickelfritz
08-08-2009, 05:16 AM
I built a prototype based on your original description of the file.
Works perfectly.
Honestly, this is extremely basic stuff, and should be working if your file bears any resemblance to your description.

slowguy
08-08-2009, 05:23 AM
Thx a lot! Ill try it l8r.

slowguy
08-09-2009, 05:28 AM
:(
Doesnt work.
ok, so i put it on 3.0, but then it said 'All actionscript on buttons or movie clip symbols will be ignored' Wat the heck r u supposed 2 do on Actionscript 3.0 then?

snickelfritz
08-09-2009, 10:09 AM
Create a new AS3 FP9 document.
Create a button on the stage on frame1.
Give it an instance name of "Button1".
Paste this into the actions layer on frame1:

button1.addEventListener(MouseEvent.CLICK, goToURL1);

function goToURL1(e:MouseEvent):void
{
navigateToURL(new URLRequest("http://www.biomicsinc.com/Products.htm"));
}