A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [help] Whats with my dynamic text box?

  1. #1
    Senior Member Gloo pot's Avatar
    Join Date
    Aug 2005
    Location
    Australia Mate!
    Posts
    874

    [help] Whats with my dynamic text box?

    i have attached my .fla file that have a mc called score and a dynamic text box... i want my dynamic text box to have 0 in it and every time u press the score mc i would like the dynamic text box to increae by 1... why didnt it work for me?
    92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!

  2. #2
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167
    I hate to be a bother, but I couldnt open the file, perhaps try reattaching it?

    -Osteel-

  3. #3
    Senior Member TeroLebe's Avatar
    Join Date
    Mar 2003
    Location
    Lahti, Finland
    Posts
    302
    well, there's some errors.

    First of all, You cannot name variable and textbox with the same name. It just won't work.

    Second, You have to define the textbox.text when you increase the "score".

    Third, you must define Score variable before You can use _root.score +=1 in Flash 7.



    1)so in the firstframe put
    _root.score = 0;

    and in then put this code in the movieClip You want to press.
    2)
    on (release) {
    _root.score += 1;
    _root.scoretext.text = _root.score;
    }

    3)
    rename the dynamic textbox to scoretext
    Last edited by TeroLebe; 09-29-2005 at 09:30 AM.

  4. #4
    Senior Member Gloo pot's Avatar
    Join Date
    Aug 2005
    Location
    Australia Mate!
    Posts
    874
    Awsome... thanks mate
    92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!

  5. #5
    Elvis...who tha f**k is Elvis? phreax's Avatar
    Join Date
    Feb 2001
    Posts
    1,836
    Well, you cannot call the textfield score but the var name of the field could be score...then it would update with _root.score++; ...not the cleanest but it works

    For your initial example that would mean delete the instance name score, and write score in the var field instead, then init score int the main frame like score = 0; ...cheers
    Last edited by phreax; 09-29-2005 at 10:14 AM.
    Streets Of Poker - Heads-Up Texas Hold'em Poker Game

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