A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: button help needed

  1. #1
    Junior Member
    Join Date
    Mar 2009
    Posts
    7

    Question button help needed

    ok, so i've got that when you click a button it takes you to the next frame/level of the game, but i want to make the next level harder, meaning you have to kill all the enemies to goto the next frame/level, so, how do i make it so you have to click ALL 3 buttons on the stage to go to the next frame? Or is there another way to do this? Any help will be greatly appreciated.

  2. #2
    Junior Member
    Join Date
    Mar 2009
    Posts
    7

    Smile

    Maybe a countdown could be used, so every time i click on an enemy and kill them the countdown goes down one, and when it reaches 0, it will go to the next frame, i kinda get it but i don't know what the exact code would be, can you help me with this please?

  3. #3
    |-'|-'|
    Join Date
    Jan 2006
    Posts
    273
    Code:
    // Assuming that all enemy is the same and this is within enemy symbol in library.
    this.onRelease = function (){
      _root.killed++;
    }
    Code:
    // on _root frame 1
    stop();
    var maxkilled = 1;
    var killed=0;
    this.onEnterFrame=function(){
      if(killed == maxkilled){
         nextFrame();
      }
    }
    // frame 2 just need
    maxkilled = 3; killed = 0; 
    // then next frame could be
    maxkilled = 10; killed=0;
    // etc

  4. #4
    Junior Member
    Join Date
    Mar 2009
    Posts
    7

    Unhappy

    Thanks for the reply, but i can't get it to work, i have the code you said in my flash, where did you intend the first bit of code you said to go? I have it at the end of the death sequence of the guy, meaning you watch the death sequence then it goes to the next frame, but nothing seems to be happening...
    (i'm not getting an error report or anything either)

  5. #5
    Senior Member vinayak.kadam's Avatar
    Join Date
    Oct 2006
    Location
    gotoAndPlay("Pune");
    Posts
    831
    is it possible for you to upload ur FLA so that we can try at our end!
    As ever,
    Vinayak Kadam

Tags for this Thread

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