Prev | Current Page 626 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

Note that haXe comes with an integrated and feature -
rich API to create communications between the different layers of an application; Chapter 14 is entirely
dedicated to that.
Part II: Server Side, JavaScript, and Flash: Oh My!
326
Loading Variables
To test the Flash - to - server communication and to load a set of variables from it, a file variables.txt is
created with the following contents:
message=Hello%20World & to=everyone
The content of the file must be encoded like the parameters of an HTTP GET request.
In the previous examples of loading images and sounds, there was no need to test the conclusion of the
operation before using them; this is because they already have a place on the scene and they are automatically
displayed or played as soon as they are available. However, variables cannot be used until they
are fully loaded; there is no placeholder for the loading variables. For that reason, the following examples
use a load event to monitor the availability of the requested data and to use them once they arrive.


Pages:
614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638