> I'm dabbling in the js syntax and I've found that adding the
> below to a behavior won't allow it to attach to anything.
> Am I missing something?
>
> - MM
>
>
>
> function isOKToAttach(spriteType, spriteNum){
> switch (spriteType) {
> case symbol("graphic"):
> return true;
> case symbol("script"):
> return false;
> }
> }
Yes, the first parameter passed to the isOKToAttach is a reference to
the script cast member itself (note that it is _not_ a reference to the
instanced script for it hasn't been instanced yet), the second is your
spriteType. So change your isOKToAttach handler to be like this:
function isOKToAttach (scriptRef, spriteType, spriteNum) {
...
}
Please note that this is true in both Lingo and JS syntax.
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!]