FORUMS: list search recent posts

1084: Syntax error: expecting rightparen before semicolon.

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Christopher Dougherty
1084: Syntax error: expecting rightparen before semicolon.
on Jul 19, 2013 at 3:36:25 pm

STUCK

I'm trying to code a flash project to play a short movie clip as an intro and then go to frame 2 to continue the rest of the animation as planned.

I keep getting:

WEB INTERFACE, Layer 'Actions', Frame 1, Line 9 1084: Syntax error: expecting rightparen before semicolon.
WEB INTERFACE, Layer 'Actions', Frame 1, Line 10 1158: Syntax error: missing left brace ({) before the function body.
WEB INTERFACE, Layer 'Actions', Frame 1, Line 12 1084: Syntax error: expecting rightparen before semicolon.

The code I'm using is:

BANG.play();
BANG.addEventListener(VideoEvent.COMPLETE, gotoAndPlay("Scene 1","frame2"());
function _doNext(e:VideoEvent):void
{
BANG.removeEventListener(VideoEvent.COMPLETE, gotoAndPlay("Scene 1","frame2"());
trace("video done, what's next?");
}


Return to posts index

demetri tashie
Re: 1084: Syntax error: expecting rightparen before semicolon.
on Jul 20, 2013 at 7:28:41 pm

try it this way instead

import fl.video.*;
BANG.source = "myVideo.flv";
BANG.play();

BANG.addEventListener(VideoEvent.COMPLETE, doNext);
function doNext(e:VideoEvent):void
{
BANG.removeEventListener(VideoEvent.COMPLETE, doNext);
trace("video done, what's next?");
// go to a specific frame: gotoAndPlay(2);
// go to a specific frameLabel: gotoAndPlay('frameLabel');
}


- this code is for AS3. by some of your syntax, you might be using AS2.
- although technically acceptable, don't start a function name with an underscore. stick to all letters
- let the event listener reference the function, and don't put any other code there
- don't use scenes. if you are directing the timeline, call out the frame number, or use a frame label

IF this line of code would be OK, to use:
(VideoEvent.COMPLETE, gotoAndPlay("Scene 1","frame2"());
you would first need another parenthesis on the end:
(VideoEvent.COMPLETE, gotoAndPlay("Scene 1","frame2"()));

however, gotoAndPlay doesn't use double parenthesis inside of it. those are extraneous, and wrong. it should enact whichever frame based command is encased within the original parenthesis like this:
gotoAndPlay(2);
for a frame number(notice there are no quotation marks around the frame number),
or:
gotoAndPlay('frameLabel');
for a frame label.

or for a scene, i beieve this is the correct AS3 code:
gotoAndPlay(2,"Scene 1")

i hope that can help


Return to posts index

Christopher Dougherty
Re: 1084: Syntax error: expecting rightparen before semicolon.
on Jul 22, 2013 at 3:32:28 am

I figured out that gotoAndPlay requires only one number... I now have it jump to frame 6, giving the video 5 frames to play out before I begin my animation.

Now the only problem is that when it jumps to scene 6, my tweened objects flicker for a second and then disappear and I can't figure out why. I had tried to make the objects buttons, but I got an error code. So I switched them back to graphics.... But they still don't work.

Do I need to redo all of my animations?

What could be causing this?

P.S. thank you for all of your help earlier.


Return to posts index


demetri tashie
Re: 1084: Syntax error: expecting rightparen before semicolon.
on Jul 22, 2013 at 1:29:36 pm

it is hard to say without more information or seeing better.

but you seem to be runnng into classic timeline based navigation issues. there are better ways to do all of this but it involves ditching the timeline/linear way of thinking about and creating your project, and moving towards code based program and design, involving manipuilated movieclips rather than a linear timeline.

think of these few intial concepts if you are using a timeline:

- an object must be present on all the frames playing for it to be 'seen'
- tweens are actually programatic(logarithmic) extrapolations of movement. it is NOT a frame by frame ( 'stop frame') animation, and therefore:
- a timeline based animation/tween will be disrupted if you jump over frames where it is expected to be tweening ( i.e it will give a 'flash', or dissapear, or have some other unexpected results)

also

while a video ( flv, f4v etc) is playing, the main timeline should not be playing, it should be stopped, and then directed to run/play again once the video is complete(assuming your previous code hold true for this)
any desired animation or tween should be encapsulated in their own, self contained, movieclips,with thier own ondependent timelines.

i hope that helps rather than confuses! it will help to look at some beginning tutorials on these subjects:

- movieclips
- AS3 coding
- AS3 based navigation
- tweening engines ( like Greensock's TweenLite) instead of using classic tweens


Return to posts index

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