A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Easy solution?

  1. #1
    Senior Member
    Join Date
    May 2001
    Posts
    169
    Okay- I've done this a few times before, but for some reason I can't get it to work now!

    I have a series of buttons that target MCs to slide up and down. I only want one MC to be up at any time. My script for the buttons is this:

    on(release) {
    if movieclip2=="up" {
    telltarget (movieclip1)
    play()
    }
    }
    on(release) {
    telltarget (movieclip1)
    play()
    }

    ...and so on for every button and every movie clip. The problem is that they slide in and out ok, but don't recognize the variables that I set in the movieclips. These variables set each movie clip as "down" or "up". Is there something I'm missing?

    Thanks for any help!

  2. #2
    Senior Member
    Join Date
    Nov 2000
    Posts
    123
    Hi there,I don´t really understand your script:

    on(release) {
    if movieclip2=="up" {
    telltarget (movieclip1)<-- you tell the clip to play if your clipvar= "up"
    play()
    }
    }
    on(release) {
    telltarget (movieclip1)<-- but here you tell the clip to play no matter what. So it will always play on release!!!
    play()
    }

    tell me what you want the button to do if the variable is "up", and what if the Variable is down,
    by the way why are you using telltarget?

    Have Fun, SL

  3. #3
    Senior Member
    Join Date
    May 2001
    Posts
    169
    The target MCs are just a tweened shape that has a keyframe in the middle. The keyframe has a script: this="up"

    The first frame of the MC has a script:
    stop()
    this="down"

    Here is my button script.

    on (release) {
    if (about=="up") {
    tellTarget ("about") {
    play ();
    if (commercial=="up") {
    tellTarget ("commercial") {
    play ();
    if (applications=="up") {
    tellTarget ("applications") {
    play ();
    if (links=="up") {
    tellTarget ("links") {
    play ();
    }
    }
    }
    }
    }
    }
    }
    }
    tellTarget ("residential") {
    play ();
    }
    }

    And for some reason, the buttons don't recognize the variables.

  4. #4
    Senior Member
    Join Date
    May 2001
    Posts
    169
    Okay - I think I can only use one 'if' statement at a time. That seems to be the problem.

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