PDA

View Full Version : actionscript 3.0 buttons problem...



meteoric
February 14th, 2008, 01:29 AM
hi guys...

was trying out actionscript 3.0 buttons and after following advises, i find that i couldn't publish my work!

this is all the codes i use...


import flash.events.MouseEvent;
showing.addEventListener(MouseEvent.MOUSE_DOWN, showingclick);
mayhem.addEventListener(MouseEvent.MOUSE_DOWN, mayhemclick);
kindness.addEventListener(MouseEvent.MOUSE_DOWN, kindnessclick);
intime.addEventListener(MouseEvent.MOUSE_DOWN, intimeclick);
thepower.addEventListener(MouseEvent.MOUSE_DOWN, thepowerclick);
going.addEventListener(MouseEvent.MOUSE_DOWN, goingclick);
function showingclick(event:MouseEvent) {
trace("button clicked");
gotoAndPlay("Scene 7");
}
function mayhemclick(event:MouseEvent) {
trace("button clicked");
gotoAndPlay("Scene 5");
}
function kindnessclick(event:MouseEvent) {
trace("button clicked");
gotoAndPlay("Scene 3");
}
function intimeclick(event:MouseEvent) {
trace("button clicked");
gotoAndPlay("Scene 2");
}
function thepowerclick(event:MouseEvent) {
trace("button clicked");
gotoAndPlay("Scene 6");
}
function goingclick(event:MouseEvent) {
trace("button clicked");
gotoAndPlay("Scene 4");
}


not sure if its perfectly correct or not... and when i try to publish... the error which came out is this...


TypeError: Error #1009: Cannot access a property or method of a null object reference.
at stn15comicpresenation_fla::MainTimeline/stn15comicpresenation_fla::frame1()


and it shows a blank preview screen! any help or advise to correct would be great! thanks for looking it into me as i've spent alot of hours trying to solve this problem and still got stuck!

excogitator
February 14th, 2008, 04:03 AM
I tried the code above and everything worked fine. The only errors i got were ArgumentError: Error #2109: Frame label Scene 2 not found in scene Scene 1. which was because i did not add the scenes stuff.
Recheck the button names and try again.

chenet
February 22nd, 2009, 10:53 PM
In actionscript 3.0, normally gotoAndPlay("Scene #") not accepted;

gotoAndPlay(1, "Scene 2");

1 is Frame number of Scene 2 :)