A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: If statement problem

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    1

    If statement problem

    Hello - I've been stuck on this for 3 days now and I am hoping someone can solve my scripting broblem. Well I believe the problem lies in the script below. The script reisdes in a mc on the root. Once all items are placed on the wheel, gotoAndPlay(2); is suppose to kick in but nothing happens. I would be happy to show the .fla to who ever can help me. I really am strugging here.



    if (0 != (0 != (Number(eval("/wheelOrangeO:OrangeO")) == 1) & 0 != (Number(eval("/wheelOrangeE:OrangeE")) == 1)) & 0 != (Number(eval("/wheelYellowO:YellowO")) == 1))
    if (0 != (0 != (Number(eval("/wheelPurpleO:PurpleO")) == 1) & 0 != (Number(eval("/wheelPurpleE:PurpleE")) == 1)) & 0 != (Number(eval("/wheelYellowE:YellowE")) == 1))
    if (0 != (0 != (Number(eval("/wheelGreenO:GreenO")) == 1) & 0 != (Number(eval("/wheelBlueO:BlueO")) == 1)) & 0 != (Number(eval("/wheelBlueE:BlueE")) == 1))
    if (0 != (0 != (Number(eval("/wheelGreenE:GreenE")) == 1)) )
    {
    tellTarget("/wheel")
    {
    gotoAndPlay(2);
    }

    tellTarget("/variable")
    {
    gotoAndStop(3);
    }

    }

  2. #2
    Dignitary rynoe's Avatar
    Join Date
    Jan 2003
    Location
    Earth
    Posts
    760
    If the code is attached to a movieclip you have you have to call it within a function.

    Actionscript Code:
    onClipEvent(enterFrame){
       //do stuff
    }
    [SIGPIC][/SIGPIC]

  3. #3
    Senior Member
    Join Date
    May 2010
    Posts
    178
    post a sample fla in CS3

  4. #4
    Member Pepember
    Join Date
    Jul 2001
    Location
    Berlin
    Posts
    886
    does trace(tellTarget("/wheel")); actually return the object you want?
    Please sign here

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