1084: Syntax Error

Posted on 2010-01-05
Last Modified: 2013-11-11
Hi all,

I have a piece of code written in Actionscript. When I checked syntax, I got the following error message;

"1084: Syntax error: expecting rightparen before add."

duplicateMovieClip(tremble, "tremble" add c, c) code leads to the above error.

Additionally, I am using actionscript 3 and also tremble is an instance name of movieclip

How can I fix this problem?

Thanks in advance,

a = 3;

b = 6;

c = 9;

duplicateMovieClip(tremble, "tremble" add c, c);

tremble._x = random(a);

tremble._y = random(b);

tremble._alpha = random(45);

tremble._rotation = random(a);

Open in new window

Question by:Delidumrul
    LVL 19

    Accepted Solution

    that won't work in actionscript 3

    you cant use "add" in AS3 - you have to use "+"

    _rotation, _x and _y are now just rotation, x and y (no underscore), but otherwise work the same

    _alpha is now just alpha (again, no underscore), and uses a 0 - 1 range, rather than 0 to 100 (e.g., 0.2 in AS3 is the same as 20 in AS2)

    most importantly, there is no duplicateMovieClip method in AS3.  there is no equivalent.  instead, create the clip you want to use repeatedly as a Class, and instantiate it using the "new" operator, e.g.,

    // if you made a class previously called "MyClass"

    var myClass:MyClass = new MyClass();

    AS3 is very different from AS2 (and AS1), so plan on spending some time learning the new stuff and forgetting the older stuff : )

    Author Comment

    it is a very quick and helpful solution.

    Thanks a lot,

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
    There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
    The goal of the tutorial is to teach the user how to how to record live broadcast.
    The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now