A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: syntax error?

  1. #1
    Junior Member
    Join Date
    Dec 2007
    Posts
    18

    syntax error?

    I'm getting all kinds of action script errors on this code but i can't figure out why, any ideas?

    stop();
    var lv:LoadVars = new LoadVars();
    lv.onData = function(status:String) {
    if (status == "online" || status == "ONLINE" || status == "Online" || status == "oNLINE" || status == "OnLINE" || status == "ONline" status == "ONLine" || status == "ONLIne")
    {
    gotoAndStop(2);
    } else {
    gotoAndStop(3);
    }
    }
    lv.load("status.txt");

  2. #2
    Junior Member
    Join Date
    Dec 2007
    Posts
    18

    ugh nevermind

    lol needed more coffee

  3. #3
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,875
    hahaha ..replace your if statement with

    PHP Code:
    if (status.toLowerCase() == "online") {
        
    gotoAndStop(2);
    } else {
        
    gotoAndStop(3);

    you wont have to check the casing then !
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

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