Prev | Current Page 295 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

This is the case for anonymous objects
defined in the foreign library or also for classes as far as they are not instantiated using the new
constructor.
Each platform deals with compiled external libraries in a very different way. The following sections will
try to cover every possibility, even if some of them are very rare.
151
Chapter 6: Organizing Your Code
Flash External Libraries
There are two ways to link external libraries in the Flash platform: dynamically and statically. In the
former solution, the external library is loaded at run time, while the latter uses the - swf - lib switch to
embed the external library directly in the output file at compile time. The first solution makes it possible
to load dynamically portions of code just when and if they are needed; the biggest disadvantage is that
there is more code to write to manage the code loading and that things can go wrong if some
synchronization fails. The second solution is easier to implement and will of course increase the size of
the output binary.


Pages:
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307