A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Need a helping hand

  1. #1

    Need a helping hand

    right where do i start umm..


    got a little game i made but need a hand with a script

    i have codes for all 10 levels in "select a level menu" and want to have incomplete levels locked when selecting a level

    (AS) frame 1
    level_2_complete = false;
    (AS) level 1 complete
    if (_root.finish.hitTest(_x, _y, true)) {
    xspeed = 0;
    yspeed = 0;
    _y -= power;
    _root.gotoAndStop("level select");
    level_02_complete = true;
    }
    (AS) level select script
    if (level_02_complete=true and _root.level2.hitTest(_x, _y, true)) {
    xspeed = 0;
    yspeed = 0;
    _y -= power;
    _root.gotoAndStop("level2");
    } else {
    _root.lvl_stats.gotoAndPlay("locked");

    }
    the hit test is detected but it wont detect the true or false

    anyone help?

    all but frame 1 codes are within "onClipEvent"
    Last edited by hopies; 11-28-2010 at 12:00 PM.

  2. #2
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    You are missing the proper number of equal signs.

    If you use only one equal sign, then the left side of the equation will equal the right. Two equal signs is a comparison test. Also when testing for true or false, you don't need to add the true/false. And finally you should use && instead of AND. I've corrected the line.

    actionscript Code:
    if (level_02_complete && _root.level2.hitTest(_x, _y, true)) {
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  3. #3
    still it continues to go to level 2 when level 2 is set at false

    if you like i will upload a quickly made sample for you to look at
    The one that smiles when things go wrong, Has thought of someone to blame it on

  4. #4
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    That would be a good idea. Would be easier to help out.
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  5. #5
    The one that smiles when things go wrong, Has thought of someone to blame it on

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