Skip to main content
barpos
Known Participant
February 7, 2011
Answered

Untraceable error in script code

  • February 7, 2011
  • 1 reply
  • 736 views

Hi,

When I do a syntax check, everything yields ok.  But, when I try to publish, I get the following error:

>1046: Type was not found or was not a compile-time constant: MotionEvent.<

Here's the code in question:

function clickHD_Btn(e:MotionEvent) {

Any ideas?

Ron

P.S. Here's the entire code:

function setupEvents() {
// associate events with event handlers
HD_Btn.addEventListener(MouseEvent.CLICK, clickHD_Btn);
Machining_Btn.addEventListener(MouseEvent.CLICK, clickMachining_Btn);
}
 
function clickHD_Btn(e:MotionEvent) {
if(stage.displayState=="fullScreen") {
  stage.displayState="normal";
} else {
  stage.displayState="fullScreen";
}
}

function clickMachining_BtnButton(e:MouseEvent) {
gotoAndPlay(1,"Usinage");
}
 
setupEvents();

This topic has been closed for replies.
Correct answer Ned Murphy

Yes, fix this line to agree with the event type that is calling the function...

function clickHD_Btn(e:MotionEvent) {

should be...

function clickHD_Btn(e:MouseEvent) {

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
February 7, 2011

Yes, fix this line to agree with the event type that is calling the function...

function clickHD_Btn(e:MotionEvent) {

should be...

function clickHD_Btn(e:MouseEvent) {

barpos
barposAuthor
Known Participant
February 7, 2011

You just confirmed that I need eyeglasses. <g>  No matter how many times I reviewed it, it just didn't notice it.

Thanks!

Ron

Ned Murphy
Legend
February 7, 2011

You're welcome.  For something like that the find and replace option in the actions panel menubar (the magnifyiung glass icon) is your friend, though for that little bit of code it wasn't hard to find by just looking.