Michael,
> I'm taking a stab at converting my lingo scripts to javascript
> syntax. I started with a very easy one. My question is why does
> on beginSprite(me) NOT translate to function beginSprite(this){}.
> That returns an error of missing formal parameter, and function
> beginSprite(){} compiles when omitting the this.
In JS syntax "this" is implicitly available and so you don't need to
include it as a passed parameter to the creator (beginSprite) function
in your script, doing so causes the compiler to obviously choke
(producing the formal parameter error you are citing). Just rename it or
exclude it, but keep in mind that something akin to the 'me' parameter
will be passed to beginSprite and any method calls made off the sprite,
but in your scripts you can always implicitly use 'this' without ever
having to declare it (and also without declaring your properties at the
top of your script like you did).
Cheers,
Tom Higgins | Product Manager | Director & the Shockwave Player
Adobe Systems Incorporated
http://weblogs.macromedia.com/thiggins/
...
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list, email
[email protected] (Problems, email [EMAIL PROTECTED]). Lingo-L is for
learning and helping with programming Lingo. Thanks!]