O'Reilly logo

What's New in Flash Player 11 by Joseph Labrecque

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Secure Sockets Support

Flash Player 11 has had the ability to establish Transport Control Protocol (TCP) socket connections ever since they were introduced in Flash Player 9 with the flash.net.Socket class. Sockets allow an application to connect to a server and transmit binary data asynchronously between the client and server. This is often used for gaming, FTP, and connections to email servers over POP3.

With the addition of the flash.net.SecureSocket class, we can now perform the same data transport on secure servers using Secure Sockets Layer (SSL) and Transport Layer Security (TLS) protocols as well.

When invoking SecureSocket.connect(), the method expects two arguments. The first is the IP or full domain name of the server to connect to. The second is the port that is to be used to establish the socket connection. Actually receiving and transmitting data over an established socket connection is done in exactly the same way as if you were using an unsecured socket.

SecureSocket results readout

Figure 7-3. SecureSocket results readout

The figure above demonstrates some of the information that can be derived when connecting through a secure socket. In this case, we are making a secure socket connection to adobe.com and then displaying some choice bits of data within a TextField on the Stage. The code to accomplish this is included below.

package { import flash.display.Sprite; import flash.events.Event; import flash.events.IOErrorEvent; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required