Search code examples
actionscript-3flash-cs5

How to get text input to display text in Flash Actionscript 3


It's been forever since I've done Actionscript and we have a really old one that had to be redone in Actionscript 3. It has a textinput for a search and a "search" button that will call a webpage when pressed. My problem is that when I run it, I can enter text into the textinput but you don't see anything that you typed and I can't figure why. I've got the script to get the textinput as a variable and it goes to the test page, but I need to make the text visible in the SWF.

Here's my Actionscript:

import flash.events.MouseEvent;
import flash.net.navigateToURL;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
import fl.controls.Label; 
import fl.controls.TextInput; 

var searchtext = misa_stext.text;
gosearch.addEventListener(MouseEvent.CLICK, onMouseClick);
function onMouseClick(event:MouseEvent):void
{
   var searchtext = misa_stext.text;
   var request:URLRequest = new URLRequest("http://stackoverflow.com?" + searchtext);
   request.method = URLRequestMethod.GET;
   var target:String = "_blank";
   navigateToURL(request, target);
}

It does what it's supposed to do, I just want the user to see what they typed and I know I'm missing something.

UPDATE: Here's what the properties panel says:

enter image description here

And what I get when embedding: enter image description here

But still nothing. :(


Solution

  • If your input does not use system fonts, you must embed the font to support dynamic text.

    Press Embed... from the text input properties

    font-properties

    Then include character ranges as needed.

    enter image description here