[mtasc] Problem with some native functions

Scott Hyndman Scott at affsys.com
Mon Jun 13 18:14:56 CEST 2005


...I think you should read the documentation on startdrag. It is a movieclip method, and does not take a movieclip as it's first argument. It takes a boolean called lock.

lock: A Boolean value specifying whether the draggable movie clip is locked to the center of the mouse position (true), or locked to the point where the user first clicked on the movie clip (false). This parameter is optional.

/Scott

-----Original Message-----
From: mtasc-bounces at lists.motion-twin.com [mailto:mtasc-bounces at lists.motion-twin.com] On Behalf Of Cédric Néhémie
Sent: Monday, June 13, 2005 4:32 AM
To: MotionTwin ActionScript2 Compiler List
Subject: [mtasc] Problem with some native functions

Hi all,

I have a problem with some "native" functions like set or get used in a 
class,  Also when i call startDrag(this) MTASC say : type error Test 
should be Boolean, like it scope on the movieClip function. It's a bit 
hard in this condition to build, for example, a window components, where 
titlebar call a startDrag on his parent, or I need to, in that case, 
link titlebar event to parent function (and in this case it enhance 
dramatically the Window class weight).

Here the class witch fail :

class Test extends MovieClip
{
    public function Test ()
    {           
        startDrag(this);  // > type error Test should be Boolean  (in 
this case we shall use another movieclip instead of 'this')
       
        set("_root.myVar",0); // > type error Unknown variable set
       
        get("_root.myVar");     // > type error Unknown variable get
    }
}

If Test extends MovieClip, startDrag and stopDrag are accepted, but if 
not, I ve got an error like with set or get function.
Is it like MTASC don't know those functions.

Have you a solution for using get and set function ?

cedric








--
MTASC : no more coffee break while compiling




More information about the mtasc mailing list