List Info

Thread: Herency in Director (javascript)




Herency in Director (javascript)
user name
2005-12-29 16:45:38
Danny,

> I'm no expert on JS syntax in Lingo, but this line
looks weird to me.

Sure, but it's Javascript syntax in director not in lingo.

> You're setting the prototype of a function to an
object? What does that 
> even mean?

In ecmascript (as far as i know) herency work in that way,
setting the 
prototype of an function (CLASS) to the base class.
In c++ would be:

class cclass: public cbaseclass

In javascript it's:

function cclass ()
...
cclass.prototype = new cbaseclass ();

All the functions and variables from cbaseclass are
"copied" or "instanced" 
into cclass.
I put "CSprite" and "CClipper" and the
first "C" means "class" later in the 
code i'll use something like this:

var dummyvar = new CSprite ();

> And CClipper () is just the value 0 anyway, so 'new
CClipper()' is the 
> same as 'new 0' which doesn't make any sense.

Why is 0? I don't  understand that. You mean
"null"?
CClipper it's an object, class... when i put "new"
that means a new instance 
of CClipper.

Whatever, i don't know if this's it:

class.prototype = new baseclass ();

or:

class.prototype = new baseclass;

or:

class.prototype = baseclass ();

Hum, nevermind, i think the shockwave plugin isn't good for
me. =(
I wanna cry.

Regards,
Sebastian Lucas
_______________________________________________
> dirGames-L mailing list  -  dirGames-Lnuttybar.drama.uga.edu
> http://nuttybar.drama.uga.edu/mailman/listinfo/dirgames
-l 

_______________________________________________
dirGames-L mailing list  -  dirGames-Lnuttybar.drama.uga.edu
http://nuttybar.drama.uga.edu/mailman/listinfo/dirgames
-l
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )