Skip navigation
Currently Being Moderated

1067: Implicit coercion of a value of type void to an unre

Jul 27, 2012 4:49 AM

Hi.

It's telling me that one is void but I don't understand. BTW I am only trying this out because somebody has written it in a game I am using. I am  a newbie so would always write out the long.handed conditional.

 

var strAnimal:String = "animal";

strAnimal = "animal" ? trace("animal"): trace("not an animal");

 
Replies
  • Currently Being Moderated
    Jul 27, 2012 5:02 AM   in reply to codeBeastAdobe

    Change that second line to:

     

    strAnimal == "animal" ? trace("animal"): trace("not an animal");

     

     

    The first part is supposed to be a conditional test (==), not an assignment (=)

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points