Results 1 to 4 of 4

Thread: hm. I'm checking the examples. so, what's the point?

  1. #1

    Default hm. I'm checking the examples. so, what's the point?

    so, I found this line in one of examples
    private var _includeClasses:Array = [StaticMovieSource, CSVMovieSource];
    so, what's the point? if I need to recompile it anyway if I change classes.

    why not load these classes dynamically from external swfs during runtime?
    otherwise there's no point in doing this.

    am I wrong?

  2. #2
    Join Date
    Oct 2008
    Location
    Belgium
    Posts
    160

    Default

    Hi Valentin,

    you are absolutely correct. We have already been talking with the developers about adding class loading support by loading swf's that contain extra classes. The main issue is that class loading will happen asynchronously and that this will have a big impact on the internals of the IoC container.

    Here's a snippet from our previous discussion. Please let me know your thoughts on this.

    My take on this is that to keep things simple, we should probably by default preload the swf's that contain extra classes, add them to the application domain and then dispatch the complete event of the application context. That means that the loading will take longer, but we won't have to deal with async issues in the object factory.

    The swf's could be defined in the context:

    Code:
    <objects>
      <swf id="swf_a" file="path/to/my/swf_a.swf"/>
    </objects>
    regards,
    Christophe
    Christophe Herreman
    Spring ActionScript Founder
    http://www.herrodius.com

  3. #3

    Default

    I need to develop an ioc container with classes loading from external libraries, there may be many classes in one library or just single ones, not all classes might be needed at some particular section of the site.

    That's why I started researching what is already available for AS3 and was surprised to see that people don't load classes dynamically during runtime.

    My task is a bit different from a general ioc container, but in a simple case of course preload all classes from swfs, fire an event and start application. That's the easiest way.

  4. #4
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    407

    Default simple solution for class including

    I've been using a simple XSLT ANT Task to include the class names in my configuration file. I've written a short PDF tutorial that sort of outlines what I do.
    This solution might not be for everybody, but maybe it'll help somebody out, I've attached a zip file with the PDF to this message. Have a look and see if it is of use to you...

    Cheers,

    Roland
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •