PDA

View Full Version : MouseEvent help


jobbernaul
11-22-2010, 02:57 PM
Its fair to say i am a complete beginner so this probably will be a stupid question but i am working on a website and i have been using help. i copied the code word for word but i am being pulled up for a syntax error and i really dont know what i have done wrong. This is the code its just to move to a certain page after i click the button.


stop();

video.addEventListener(MouseEvent.CLICK, clickSection);

function clickSection(evtObj:MouseEvent)
gotoAndStop("video");
}

the syntax error is "the class or interface MouseEvent could not be loaded"
i underlined the line of code that it says the problem is on

stop(); seems to not be working either with all the pages cycling through. so it seems when i entered the function it eradicated the stop function

to be honest any help here will be grateful

ASWC
11-22-2010, 04:27 PM
Welcome to the forums!
Post the complete error message please. That usually provides a good clue about the problem.

jobbernaul
11-23-2010, 03:00 PM
thanks
ive updated the problem a bit.
hope it helps

ASWC
11-23-2010, 03:23 PM
the stop() are probably working but once you get an error Flash stops the normal code execution and stop() are ignored. They will work again once the error is gone. All I can see here is that you are missing a bracket:
function clickSection(evtObj:MouseEvent)//bracket missing
gotoAndStop("video");
}
should be:
function clickSection(evtObj:MouseEvent){
gotoAndStop("video");
}

jobbernaul
11-26-2010, 07:47 PM
cheers dude i feel like an idiot now