A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Conditional statement help

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Posts
    9

    Conditional statement help

    I have a button that I want to write a conditional statement that will perform a certain task dependent on what frame label a specific movieclip is on. This is what I want to do written out in basic english.

    if movieclip on "blue" then clicking button makes movieclip go to and play or remain on "blue"
    if movieclip on "green" then clicking button makes movieclip go to and play or remain on "green"
    if movieclip on "red" then clicking button makes movieclip go to and play or remain on "red"

    Thanks in advance.
    Andy
    Last edited by andorosfire; 09-02-2010 at 11:41 AM.

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Sorry but I don't understand, are there two movie clips?

  3. #3
    Junior Member
    Join Date
    Sep 2010
    Posts
    9
    Just one movie clip for the conditional statement.

    the button already controls a different clip, and that function unavoidably changes the appearance of the movieclip I want to write the conditional statement for. The conditional statement in theory will correct this problem for me.......I hope.

  4. #4
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Code:
    if (sendMC.currentLabel=="blue") {
    	recMC.gotoAndStop("blue");
    } else if (sendMC.currentLabel=="red") {
    	recMC.gotoAndStop("red");
    } else if (sendMC.currentLabel=="green") {
    	recMC.gotoAndStop("green");
    }

  5. #5
    Junior Member
    Join Date
    Sep 2010
    Posts
    9
    VICTORY!!!!!!!!!!!!!!!! AWESOME! thank you so much! Is there a ranking system on this site? if so I's like to give you a billion points.

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