3 Replies - 5957 Views - Last Post: 01 March 2016 - 02:24 PM

#1 retched   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 48
  • Joined: 25-January 16

Dynamic Text Not Updating in Animate CC

Posted 01 March 2016 - 12:15 AM

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+";
					
					dingsound.play();
					jackpotSymbol.play(); // DO NOT START PLAYING 
					jackpotSymbol.gotoAndPlay(1);
					
					trace("Jackpot amount shown.");
							
				}
				
				
			}


However when I trigger this event, the following happens:

  • The sound effect `jackpotSymbol.play()` 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?

Is This A Good Question/Topic? 0
  • +

Replies To: Dynamic Text Not Updating in Animate CC

#2 ArtificialSoldier   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2425
  • View blog
  • Posts: 7,415
  • Joined: 15-January 14

Re: Dynamic Text Not Updating in Animate CC

Posted 01 March 2016 - 11:25 AM

jackpotSymbol.play(); // DO NOT START PLAYING

What's going on with that?

I don't have the CC version, but are you sure that the jackpotAmt text field is in scope and visible on the frames of jackpotSymbol? That is, that there is a layer that goes for all frames with that text field on it? If you trace the text does that show correctly?
Was This Post Helpful? 0
  • +
  • -

#3 retched   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 48
  • Joined: 25-January 16

Re: Dynamic Text Not Updating in Animate CC

Posted 01 March 2016 - 12:48 PM

View PostArtificialSoldier, on 01 March 2016 - 01:25 PM, said:

jackpotSymbol.play(); // DO NOT START PLAYING

What's going on with that?

I don't have the CC version, but are you sure that the jackpotAmt text field is in scope and visible on the frames of jackpotSymbol? That is, that there is a layer that goes for all frames with that text field on it? If you trace the text does that show correctly?


Sorry that's the MP3 file that is to be played when the event is triggered. That still works.
Relevant bit of code:
		var jackpotsfx:jackpotwin = new jackpotwin();




This is being written as a class file (since I was told is the way to invoke these events and to move away from frame-based scripts.) Right now the frame contains the following:

stage.addEventListener(KeyboardEvent.KEY_DOWN, gamecontrol);


The space bar triggers everything else, just not the the updating of the text within the MovieClip. I even tried to do it give frame script with this:
jackpotSymbol.jackpotAmt.text = String(100);



And it still does not change. Is there some other method of updating text inside a MovieClip?

This post has been edited by retched: 01 March 2016 - 12:52 PM

Was This Post Helpful? 0
  • +
  • -

#4 ArtificialSoldier   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2425
  • View blog
  • Posts: 7,415
  • Joined: 15-January 14

Re: Dynamic Text Not Updating in Animate CC

Posted 01 March 2016 - 02:24 PM

I'm not sure if the property name for text changed, although if you hit F1 it should show the help (I assume). Although if you're just testing then I would use a literal string instead of passing a number to the String constructor, e.g. ackpotSymbol.jackpotAmt.text = "test";.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1