# Random boolean?

**URL:** <https://forum.kirupa.com/t/random-boolean/251676>\
**Category:** Uncategorized\
**Created:** [February 11, 2008, 5:49pm UTC](https://forum.kirupa.com/t/random-boolean/251676 "2008-02-11T17:49:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrickjv](https://avatars.discourse-cdn.com/v4/letter/p/ce7236/32.png) [@patrickjv](https://forum.kirupa.com/u/patrickjv)\
**Post date:** [February 11, 2008, 5:49pm UTC](https://forum.kirupa.com/t/random-boolean/251676/1 "2008-02-11T17:49:19Z")

</div>

public var doflip:Boolean;  
doflip = Math.floor(Math.random()\*2);

can have 0 or 1 as outcome, always worked fine in AS2.0, now in 3.0 it gives

Warning: 3590: Number used where a Boolean value was expected. The expression will be type coerced to Boolean.

Nevertheless, seems as flash resolves it himself since it works… but error is annoying. Anybody any non-error solution?

P
