lundi 29 février 2016

Dynamic Text of a Movie Clip is not updating

I have a stage set up with a "movie clip" in the frame named jackpotNote. In that movie clip (or symbol), there is a dynamic text field named "jackpotAmt".

What is supposed to happen is that I'm to press the Space Bar on my keyboard and it will trigger the Movie Clip to play out. What's also supposed to happen is that the text is supposed to change as well, here is the current coding:

        if (event.keyCode == Keyboard.SPACE) {

            if (jackpotNote.visible == true) {
                trace("Jackpot amount already shown. Ignored.");
            } else {
                jackpotNote.visible = true;
                jackpotSymbol.visible = true;

                //jackpotSymbol.jackpotAmt.text =  currency_str + String(jackpotamt_int);
                if (jackpotamt_int < 100000) jackpotSymbol.jackpotAmt.text = currency_str + String(jackpotamt_int);
                else if (jackpotamt_int >= 100000 && jackpotamt_int <= 999999) jackpotSymbol.jackpotAmt.text = String(jackpotamt_int);
                else jackpotSymbol.jackpotAmt.text = currency_str + "1MIL+";


                trace("Jackpot amount shown.");



However when I trigger this event, the following happens:

  • The sound effect plays as normal.
  • The jackpotSymbol becomes visible.
  • However, the text is not changed in the following line: jackpotSymbol.jackpotAmt.text = currency_str + String(jackpotamt_int);

This used to run well on Adobe Flash Professional CS6, however when I upgrade to Adobe Animate CC... it broke. (I had to remove all of the TLF fields and make them dynamic again.)

What is missing to make all of this work?

Aucun commentaire:

Enregistrer un commentaire