A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: if ... else ... bug?

  1. #1
    Senior Member
    Join Date
    Jun 2001
    Location
    Virginia, USA
    Posts
    437

    if ... else ... bug?

    Don't know if this is a bug or not.

    If I set my if-else like this then my app not working:
    _level0.btInfo.onPress = function() {
    if ( _level0.msgLCD =! _level0.msgInfo){
    var tmpMsg = _level0.msgLCD ;
    _level0.msgLCD = _level0.msgInfo;
    setInterval (function() {_level0.msgLCD = tmpMsg}, 5000);
    } else {
    trace ("same message")
    }
    };
    but if I change to this, then it works

    _level0.btInfo.onPress = function() {
    if ( _level0.msgLCD == _level0.msgInfo){
    trace ("same message")
    } else {
    var tmpMsg = _level0.msgLCD ;
    _level0.msgLCD = _level0.msgInfo;
    setInterval (function() {_level0.msgLCD = tmpMsg}, 5000);
    }
    };
    is this a bug, or it's me ???
    Still looking for a freelancer to work on my footer!

  2. #2
    Member
    Join Date
    Dec 2003
    Location
    Gurgaon, India
    Posts
    64
    Hi RapidCarbon,

    _level0.btInfo.onPress = function() {
    if ( _level0.msgLCD != _level0.msgInfo){
    var tmpMsg = _level0.msgLCD ;
    _level0.msgLCD = _level0.msgInfo;
    setInterval (function() {_level0.msgLCD = tmpMsg}, 5000);
    } else {
    trace ("same message")
    }
    };
    U've put the != sign wrong, that's it.
    Keep flasin'
    Sam
    Flash makes the Web go Round

  3. #3
    Senior Member
    Join Date
    Jun 2001
    Location
    Virginia, USA
    Posts
    437

    thanks

    I can't believe I overlook that
    Still looking for a freelancer to work on my footer!

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