Text appears in the new text box even if they say do not.

So that's my problem. I'm trying make a text based game to learn a little more about coding, but even after looking around, I can't find a way to solve this problem.

The point of the code is to have a type writer effect, I have a button to jump at the end of the timer and show all text at once, but because it doesn't seem to be part of the issue I failed it by below.

What happens with the code below, it's that when the button is pressed a blank text box appears instead to display the new sting of the text. If the button is pressed before the end of the text by typing the text that appears in the following image will be the text which had no time to post.

I tested with the 2nd fair framework be T1.text = "NewTexthere" and it worked properly but when the type writer effect is applied, is no longer works.

-Part 1-

Stop()

T1. Text = «»

var i = 0;

var myString:String = "text".

var mytimer:Timer = new Timer(10,myString.length);

mytimer.addEventListener (TimerEvent.TIMER, timerHandler);

myTimer.Start ();

function timerHandler(event:TimerEvent):void {}

T1. AppendText (myString.charAt (i));

i ++ ;

}

Button1.addEventListener (MouseEvent.CLICK, fl_ClickToGoToNextFrame);

function fl_ClickToGoToNextFrame(event:MouseEvent):void

{

nextFrame();

MyEventArgs;

}

-Part 2-

T1. Text = «»

var i2 = 0;

var myString2:String = "NewTextHere".

var mytimer2:Timer = new Timer(10,myString.length);

mytimer2.addEventListener (TimerEvent.TIMER, timerHandler);

mytimer2. Start();

function timerHandler2(event:TimerEvent):void {}

T1. AppendText (myString.charAt (i2));

i ++ ;

}

---------

Why do you use the appearance of string 1 frame when you define a new string under 2?  Why I increment when you use i2?  Between the two of you might find the problem.

var i2 = 0;

var myString2:String = "NewTextHere";

function timerHandler2(event:TimerEvent):void {}

T1. AppendText (myString.charAt (i2));

i ++ ;

}

Tags: Adobe Animate

Similar Questions

Maybe you are looking for

  • Satellite C55-A-1MW - no startup by pressing the power button

    Hello, I have a problem starting with this laptop. When I press the touch as well, the light starts to turn on but the screen stay black, hard drive not turn, I hear just a slight noise from the dvd player. It's to see, no logo No bios/uefi. After se

  • problem with airplay on my iMac

    Hello I have the latest Apple TV The Airplay button is available on my Mac mini server, my 27 iMac, but not on my 24 iMac. All are with El Captain 10.11.4 and connected on the same network What should I do to get the airtime button/option available o

  • Satellite A300 and Windows 7, missing the option 'create disc '.

    Hello. I installed windows 7 Professional in my laptop A300 - 15 c (PSAJ4E) two weeks ago and I have a problem.I installed all the drivers for win 7 on the official website of toshiba and I do not see the option 'Create disc' where I can install the

  • Satellite A300-29N - Touchpad lagging if the network cable is connected

    I have a very strange problem with my Satellite A300-29N. When I connect the LAN cable on my laptop touchpad gal and penetrating becomes very high. Here is a picture of the demand shows the problem touchpadBTW, the problem is on windows and linux, so

  • How to get floating apps in addition to homescreen of10.1 tablet?

    How to remove floating apps from home screen of Tablet 10.1 AND how do you remove to destinations of cards when you won't need them once again?  This tablet is cruelly a manual and instructions for those of us who aren't tech geeks!