FORUMS: list search recent posts

Error 1071 - please assist

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Kyandra Letts
Error 1071 - please assist
on Sep 14, 2011 at 1:29:37 am

I'm trying to make a flash website where you click one button and you go back a frame and you click another and you go forwards one.
My code is
stop();
left_btn onRelease = function() {
prevFrame();
}
right_btn onRelease = function() {
nextFrame();
}

but I keep getting the error
1071: Syntax error: expected a definition keyword after attribute left_btn, not onRelease.

Any ideas?


Return to posts index

demetri tashie
Re: Error 1071 - please assist
on Sep 14, 2011 at 2:21:07 pm

your code is AS2, which i don't work with, but i do believe you should use a dot(period/full stop) after the object( movieclip/button) and before the method (onRelease). like this:

left_btn.onRelease = function() {
prevFrame();
}


if you were to do it as an AS3 project instead, the code would be:
left_btn.addEventListener(MouseEventEvent.CLICK, advanceFrame);
function advanceFrame(e:MouseEvent):void {

prevFrame();

}


Return to posts index

Kyandra Letts
Re: Error 1071 - please assist
on Sep 15, 2011 at 2:02:46 am

Thanks
It seemed to solve the 1071 error but now that I have thisleft_btn.addEventListener(MouseEventEvent.CLICK, advanceFrame);
function advanceFrame(e:MouseEvent):void {

prevFrame();

}
right_btn.addEventListener(MouseEventEvent.CLICK, advanceFrame);
function advanceFrame(e:MouseEvent):void {

nextFrame();

}

but its saying there is a duplicate function definition (1021)


Return to posts index


demetri tashie
Re: Error 1071 - please assist
on Sep 15, 2011 at 2:16:50 am

the 2 functions both have the same name. you have to change one of them. maybe do this:

left_btn.addEventListener(MouseEventEvent.CLICK, goBackFrame);
function goBackFrame(e:MouseEvent):void {

prevFrame();

}


that should do it.

PS: when you are ready, i really advise you to start learning AS3, as AS2 is very outdated by now.


Return to posts index

Kyandra Letts
Re: Error 1071 - please assist
on Sep 22, 2011 at 3:25:47 am

Thankyou sooooo much.
I'm really new at flash other than simple animations and you have helped heaps.
I was using several buttons like this so I had to go through each action and change the goBackFrame to things like retreatFrame and it still worked.

Would you happen to know how to have a hyperlink on a button? I've tried several tutorials but they didn't work.

Thanks again


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]