A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [lol] code wtf of the day

  1. #1
    Farmer divillysausages's Avatar
    Join Date
    Mar 2004
    Location
    ireland
    Posts
    251

    [lol] code wtf of the day

    Just now I've have to add a button to toggle quality in a game I'm working on. I've never had to do it before, but I lolled when I saw this.

    Code:
    this.stage.quality = StageQuality.LOW;
    trace( this.stage.quality ); // traces "LOW"
    trace( StageQuality.LOW ); // traces "low"
    Makes it a bit hard to do something simple like
    Code:
    if( this.stage.quality == StageQuality.LOW )
       ...
    Ah Flash, even after all these years, you still got it...

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    That's nuts. But I'm sure you've already realized you can do this:
    Code:
    if (this.stage.quality.toLowerCase() == StageQuality.LOW.toLowerCase())
    ...
    Why they didn't use an enum pattern is beyond me. Or at least integer constants.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center