• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

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

Participant ,
Jul 27, 2012 Jul 27, 2012

Copy link to clipboard

Copied

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");

TOPICS
ActionScript

Views

504

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jul 27, 2012 Jul 27, 2012

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 (=)

Votes

Translate

Translate
LEGEND ,
Jul 27, 2012 Jul 27, 2012

Copy link to clipboard

Copied

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 (=)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 27, 2012 Jul 27, 2012

Copy link to clipboard

Copied

LATEST

Brilliant - you guys know everything. It also makes it clearer about = signs.

Cheers

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines