try the following:

if (pVidSprite.member.type.toString().toLowerCase() 
== "#visiblelightonstagemedia"){
  //do stuff here
}

rationale:

in JS syntax, I believe there is a difference in terms of how symbols 
are handled. They become actual object instances (I believe, Tom slap 
me upside the head if I'm wrong). Therefore you are comparing two 
different instances of the symbol both having the same visible "value". 
Therefore it is often better to check the string representation of a 
symbol in a comparison. I tend to force either to lowercase or 
uppercase in order to eleminate the chance that Director will screw up 
the case of the symbol (since Lingo comparisons of symbols and strings 
are case-insenstive) it is often easy to forget that JS is case 
sensitive comparison.

Sincerely
Mark R. Jonkman

----- Original Message -----
From: "Mendelsohn, Michael" <[EMAIL PROTECTED]>
Date: Friday, December 23, 2005 10:03 am
Subject: <lingo-l> js syntax weirdness

> Hi list...
> 
> In js syntax, I can't get the following to work:
> 
> if(pVidSprite.member.type == symbol("VisibleLightOnStageMedia")){
> //do stuff
> }
> 
> 
> When I trace(pVidSprite.member.type);
> // #VisibleLightOnStageMedia 
> 
> pVidSprite is always correctly sprite(21). 
> 
> The result I am experiencing when debugging is that it steps out 
> of the
> entire behavior without error.
> 
> Any ideas?
> Thanks,
> - Michael M.
> 
> 
> [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 owner-
> [email protected]). Lingo-L is for learning and helping with 
> programming Lingo.  Thanks!]
> 
[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!]

Reply via email to