Note that there are some explanatory texts on larger screens.

plurals
  1. PO#1009 null object reference (AS3, TextField)
    text
    copied!<p>I would like some help (and I'm new to this site)</p> <p>I want a typewriter-effect. So that it looks like the code in the string is typed character by character (for an animation). However, I get a #1009 back. It talks about a null object reference (the error is in Dutch). </p> <p>My dynamic text field is in the same scene, on a different layer. codeTekst is the instance name. It is classic, dynamic text. Multiline behaviour and not embedded in a symbol. I'm using Flash CS5. Here is my code:</p> <pre><code>import flash.utils.Timer; import flash.events.TimerEvent; var string:String = 'import flash.events.Event import flash.utils.Timer; import flash.events.TimerEvent; import flash.display.MovieClip; import flash.events.MouseEvent; import flash.media.Sound; import flash.media.SoundChannel; stop(); var beginSchermSpraak:Sound = new BeginSchermSpraak(); var beginSchermSpraakKanaal:SoundChannel = new SoundChannel(); var helpKnopSpraak:Sound = new HelpKnopSpraak(); var helpKnopSpraakKanaal:SoundChannel = new SoundChannel(); var eersteKeer:Boolean; var gebouw:uint; var vandaan:Boolean; var timer:Timer = new Timer(1, 1); splashMC.x=-9001; startKnop.x=-9001; if (eersteKeer == false) { splashMC.x=250; startKnop.x=250; beginSchermSpraakKanaal = beginSchermSpraak.play(); beginSchermSpraakKanaal.addEventListener(Event.SOUND_COMPLETE, helpKnopMaken); startKnop.addEventListener(MouseEvent.CLICK, startTimer); timer.addEventListener(TimerEvent.TIMER_COMPLETE, vervaag); } else {}'; var i:uint = 0; var timer:Timer = new Timer(10); timer.start(); timer.addEventListener(TimerEvent.TIMER, goTime); function goTime(e:TimerEvent){ codeTekst.appendText(string.charAt(i)); i++; if(i&gt;=string.length) { timer.stop(); } } </code></pre> <p>Thanks for any ideas :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload