A Flash Developer Resource Site

View Poll Results: How to get upgrades menu working

Voters
1. You may not vote on this poll
  • Upgrades menu

    0 0%
  • text box funtions

    0 0%
  • number functions

    0 0%
  • functions with numbers

    1 100.00%
Multiple Choice Poll.
Results 1 to 3 of 3

Thread: How to make my upgrades menu work

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Posts
    14

    Exclamation How to make my upgrades menu work

    Hi all

    i have a flash game that i am creating but the upgrades menu doesnt want to work, i have a text box that i use for my coding so that if the text box is showing a certain number something happens (I.E A function happens), but i cant seem to get this working here is my code:

    time.onEnterFrame = function() {
    if(_root.cash <= 99) {
    _root.count = 1;
    }
    }

    time.onEnterFrame = function() {
    if(_root.cash >= 100) {
    _root.count = 2;
    }
    }

    time.onEnterFrame = function() {
    if(_root.cash <= 149) {
    _root.count = 3;
    }
    }

    I am using A.S 2.0 on this and i have two text boxes working on this, the first the cash text box and this goes up every time the player kills an enemy, and the second text box is a the count text box which should go up when the cash equals a certain amount how can i get this to do it? please help

  2. #2
    Senior Member
    Join Date
    May 2010
    Posts
    178

    AS2 Code

    Actionscript Code:
    time.onEnterFrame = function () {
        if (_root.cash.text<=99) {
            _root.count.text = 1;
        }
        if (_root.cash.text>99 && _root.cash.text<=100) {
            _root.count.text = 2;
        }
        if (_root.cash.text>100 && _root.cash.text<=149) {
            _root.count.text = 3;
        }
    };
    Last edited by poltuda; 09-27-2010 at 02:49 PM.

  3. #3
    Junior Member
    Join Date
    Mar 2010
    Posts
    14
    That doesnt work? :S Nothing happens, when the text boxes reach a certain number they have to run a function how would you get that to work?

    E.G

    time.onEnterFrame = function () {
    if (_root.cash<=99) {
    math99;
    }
    };

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