
Sample Applications 39
To create the user interface for this sample:
1 In the Flash MX authoring environment, select File > New to open a new file.
2 From the toolbox, select the Text tool and draw a text box. In the Property inspector (Window
> Properties), select Input Text for the type of text box and give it the instance name
User.
3 Add a dynamic text box for a debug window by selecting the Text tool and drawing another
text box. In the Property inspector, select Dynamic Text for the type of text box, and give it the
instance name
Message.
4 To add the button for connecting to the server, open the Components panel (Window >
Components) and drag a push button onto the Stage. In the Property inspector, give it the
instance name
Connect_btn, the label Connect, and the click handler doConnect.
5 Create a directory named doc_hello in your flashcom application directory, and save the file as
doc_hello.fla in this directory.
To write the client-side ActionScript for this sample:
1 Select the keyframe in the Timeline and open the Actions panel (Window > Actions).
2 In the Actions panel, stop the progress of the movie.
stop();
3
Open a connection and handle any status message.
// Open connection to the server
client_nc = new NetConnection();
// Handle status message
client_nc.onStatus = function(info) {
trace("Level: " + info.level + " Code: " + info.code);
}
Komentarze do niniejszej Instrukcji