A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Tutorial Needed, Complex Button in Flash MX

  1. #1
    Junior Member
    Join Date
    May 2004
    Posts
    21

    Tutorial Needed, Complex Button in Flash MX

    I need to create a button that will only activate at a certain time, here is the scenario...

    Say for example you have a ten frame animation that is looping round and round. In this animation there is a button saying 'onMouseDown goto Frame 11'. Everything is fine so far, but if someone clicks on the button in the middle of the animation, say on frame 4, there will be a jump between frame 4 and 11. I want to know if there is a way of telling the button to goto frame 11, but not before it has gone to the end of the loop at frame 10.

    Thanks for your help,

  2. #2
    Senior Member mal pacino's Avatar
    Join Date
    Jul 2003
    Location
    England - and it's going down the pan!
    Posts
    996
    so you want the animation to play all the way through once and then when it starts lopping yo want the button to become active?

  3. #3
    Junior Member
    Join Date
    May 2004
    Posts
    21
    I want the button to stay on the screen all of the time, and when clicked I want it to send the animation to frame 11. The loop I've created goes from 1 to 10, and I want the loop to go through to the end at frame ten before it jumps to 11, even if someone pushes the button early in the loop.

    The main reason is because I want there to be a smooth transition between the loop and the content that starts on frame 11, even if someone clicks on the button early on in the loop to go to frame 11.

    I posted this problem on a different forum and I got this reply...

    on frame 10:
    if (myVar == 1) {
    gotoAndStop(11);
    } else {
    gotoAndPlay(1);

    on button:
    on (mouseDown) {
    myVar = 1
    }

    Problem is I don't really understand any of it!

    I hope this is problem clear enough!

  4. #4
    Senior Member mal pacino's Avatar
    Join Date
    Jul 2003
    Location
    England - and it's going down the pan!
    Posts
    996
    All that guys is saying is to put these lines of code on your timeline at frame 10:

    if (myVar == 1) {
    gotoAndStop(11);
    } else {
    gotoAndPlay(1);


    and on your button he tells you to add this code:

    on (mouseDown) {
    myVar = 1
    }

    But it would be good to see you fla really.

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