A Flash Developer Resource Site

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Apr 2007
    Posts
    8

    playing movie clips using a button

    hi,

    i have a button on the main stage called "three_btn"

    i have a movieclip on the stage called "village_mc" and a movieclip inside this 'village' called "sign_mc".

    what i want is the "sign_mc" movie to play when you press "three_btn".

    this seems very simple but all the action script i have tried does'nt work!!!

    please help!
    ---------------
    while im here, can anyone help with this:

    the "sign" movie clip reveals(mask) a signpost. i want the sign to be revealed when you press the three_btn, but also i want the sign to disappear IF you press three_btn and the sign post is visible.

    obviously i would have to make a movie clip that removes the signpost (is there an easy way to 'reverse' a movie clip?) and create an if statement, but i dont know how to do this!!!

    any response would be great

    thanks..

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    code on main timeline, same frame as button

    three_btn.onRelease = function(){
    village_mc.sign_mc.play();
    }

    for an if(condition) use the _currentframe of the clip (ie.. sign revealed at frame#10)

    three_btn.onRelease = function(){
    if(village_mc.sign_mc._currentframe == 10){
    village_mc.sign_mc.gotoAndPlay("close_me_label"); // frame label to close sign
    } else {
    village_mc.sign_mc.play();
    }
    };

    hth

  3. #3
    Junior Member
    Join Date
    Apr 2007
    Posts
    8
    thanks for the help, really appreciate it, just one question..

    i dont really get this bit ("close_me_label"); // frame label to close sign

    does this mean i have to label the first frame of the sign animation?

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    pseudo set-up -

    the "sign" movie clip reveals(mask) a signpost from frame#1 to #10

    the "sign" movie clip closes(unmasks) a signpost from frame#11 to #20

    so frame#11 has a frame label - close_me

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