dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: tell target problem ?

  1. #1
    Junior Member
    Join Date
    Apr 2001
    Posts
    27
    I have a button that plays an mc on its release( one click)
    is there a way to make the mc disappear on clicking the button again..like you can play and remove an mc on rollover and rollout stages of a button.

    tks.

  2. #2
    Member
    Join Date
    Aug 2000
    Posts
    83
    Just have this code in your button

    on (release) {
    tellTarget ("i") {
    gotoAndPlay (2);
    }
    if (pressed==1) {
    setProperty ("i", _visible, 0);
    pressed = 0;
    }
    pressed = 1;
    }

    "i" being the instance name of the movie clip

    Regards...

  3. #3
    Junior Member
    Join Date
    Apr 2001
    Posts
    27
    tks vinaya for your reply.
    this works,but only once..that is first time i click the button it brings up my mc,and on the next click,the mc goes away...when i want the mc to appear again on a subsequent click,nothing happens.

    do you know why ?

    tks.

  4. #4
    Member
    Join Date
    Aug 2000
    Posts
    83
    on (release) {
    if (pressed == 1) {
    setProperty ("i", _visible, 0);
    pressed = 0;
    } else {
    setProperty ("i", _visible, 1);
    tellTarget ("i") {
    gotoAndPlay (2);
    }
    pressed = 1;
    }
    }

    this code in your button should do what you wanted

    Regards...

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