Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Changed answer to full instructions because the asker is probably missing a key step through the Flash GUI.</p> <ol> <li>Open Adobe Flash CS5 (might work for CS4 too.)</li> <li>File, New, Actionscript 3.0.</li> <li>Click the text tool. Draw a TextField.</li> <li>Click the TextField, in the Properties window select Input Text in the drop down.</li> <li>With the TextField still selected, in the Properties window, set the Instance Name to "tField" no quotes.</li> <li>Click on the stage. In the Properties window set the Class: text field to "Main" no quotes.</li> <li>File, Save As, "Test.fla" no quotes.</li> <li>File, New, Actionscript 3.0 class.</li> <li><p>Paste the following in to the new AS file:</p> <p>package {</p> <pre><code>import flash.display.MovieClip; import flash.events.FullScreenEvent; import flash.events.MouseEvent; import flash.events.Event; public class Main extends MovieClip { public function Main() { var another:Another = new Another(this.tField); } } </code></pre> <p>}</p></li> <li><p>File, Save As, "Main.as" no quotes, IN THE SAME DIRECTORY AS STEP 3.</p></li> <li>File, New, Actionscript 3.0 class.</li> <li><p>Paste the following code into the new .as file (I can't get StackOverflow to display this correctly. Just paste it as is):</p> <p>package { import flash.text.TextField; public class Another { public function Another(textField:TextField) { textField.text = "Hello"; } } }</p></li> <li><p>File, Save As, "Another.as" no quotes, in the SAME DIRECTORY AS STEP 3.</p></li> <li>Hit Ctrl-Enter.</li> </ol> <p>All drawing a TextField on the stage and setting its instance name does is secretly add the lines of code:</p> <pre><code>public var tField:TextField = new TextField(); tField.type = "input"; </code></pre> <p>To whatever class the stage is associated with (in this case, the class Main.) If you need any more help than that, I would recommend getting a good book on AS3 programming and the Flash IDE because the answer is well beyond the scope of a simple StackOverflow answer.</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