Macromedia announced the upcomming release of Flash8.5 and ActionScript3.0 yesterday. Most people have read about the new key features. I will list them here shortly:
- Actionscript3.0 and the AVM2 (Actionscript Virtual Machine 2)
- Runtime error-reporting and improved debuging features
- Binary sockets
- Regular expressions
- E4X
I won’t talk about the AVM2 and error-reporting here. You can read about this on lots of other blogs. Of course ActionScript3.0 offers more performance but this nothing new. Imagine all the other releases and the performance increase was very poor in my eyes. Now with the completly rewritten virutal machine and strict datatyping it might be more powerfull like Java is. I am not sure if I get the message but strict datatyping means to me an integer is something different from a float. This could speed up all the bitwise operators. Not sure about this – I think Macromedia does not introduce really strict datatyping. The Number is currently a native object which covers all kinds of numbers like a float, integer or byte. Same thing with Arrays and Strings. Strict datatyping would cause some Pascal/Delphi syntax like data:ARRAY[1..100] OF INTEGER (which is very ugly) or C like int data[100].
Next improvement are binary sockets. A quote from this site says:
“It includes binary socket support, allowing developers to extend the player to work with any binary protocol.”
Now how can we interpret that? UDP for example is a binary protocol. TCP/IP is also a binary protocol. Binary sockets are such a relative term. What is special about binary sockets?
Imagine the following word “telekinesis”. The binary representation would be 116 101 108 101 107 105 110 101 115 105 115. Every byte goes from 0 to 0xFF which means you can also read things like the byte 0. Imagine you have a multiplayer game and you want to submit the position and scores with every package. Using ASCII would create something like 110;234;0. Where x-Pos is 110, y-Pos is 234 and score is 0. The same information using binary data becomes nĂȘ[ZERO BYTE]. Now you were able to reduce your data from nine to three bytes. Because the 0-byte got no ASCII-representation I have to write [ZERO BYTE]. The ASCII-Data in binary representation means 110 234 0. You get the idea?
This is the special thing about binary sockets. Now what can be done with sockets and what does Macromedia mean with “any binary protocol”? Any binary protocol like HTTP, FTP, POP? Or TCP/IP, UDP etc.
Well, everything is nice! Imagine your personal site which can google for you using the HTT-protocol with a pop3 client that browses through your inbox. All that done in Flash. UDP would be so nice for multiplayer games or server-browsers for example.
And peer-2-peer games. Direct data exchange between the clients. Wow, that would be marvelous!
The regular expressions really assist the sockets. For example downloading a website and searching for information is so easy using RegExps. I hope they will be fast and easy to use.
And last but not least E4X (ECMAScript for XML). This makes the use of XML very easy and hopefully fast. Some examples can be found here. If you are firm with XML it is easy to understand and great for a lot of applications (e.g. shops).

0 Responses to “Flash8.5 – Binary sockets and E4X”