A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [Resolved] whats wrong with my if?

  1. #1
    Member
    Join Date
    Jan 2004
    Location
    England
    Posts
    87

    whats wrong with my if?

    im making an online gallery for my friends and family, but something is going wrong with the if command:

    on (press) {
    if ph1.text = "Belle in Poolroom" {
    gotoAndPlay(7);
    }
    if ph1.text = "st. Pauls from Millenium Bridge" {
    gotoAndPlay(10);
    }
    }

    the actionscript error report says i need to put in some (, but i dont know where?

    thanks,
    jellyrools

  2. #2
    Left-Handed Flash User mickbrit55's Avatar
    Join Date
    Nov 2003
    Location
    NJ USA
    Posts
    1,375
    Hiya

    Like this :

    Code:
    on (press) {
    if (ph1.text = "Belle in Poolroom") {
    gotoAndPlay(7);
    }
    if (ph1.text = "st. Pauls from Millenium Bridge") {
    gotoAndPlay(10);
    }
    }
    The conditional test has to be in brackets ()

    Mick

  3. #3
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    A comparisom if statement uses 2 "==" characters, not one!

  4. #4
    Member
    Join Date
    Jan 2004
    Location
    England
    Posts
    87

    thanks

    Thanks, that works a treat. (especially after adding == )

    thakns for your help,
    jellyrools

  5. #5
    Left-Handed Flash User mickbrit55's Avatar
    Join Date
    Nov 2003
    Location
    NJ USA
    Posts
    1,375
    Thanks newb ... didn't spot that one

    Mick

  6. #6
    Member
    Join Date
    Jun 2002
    Posts
    67
    DAMN, i was too late to report help in this thread...

    darn it you guys.. hehehe


    peace.

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