Results 1 to 6 of 6

Thread: Support for new Vector type?

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

    Default Support for new Vector type?

    Hello Christophe,

    I haven't had time to test it yet, but I;m pretty sure it won't work, so therefore my question:
    Will there be support for the new Vector type in Spring AS?
    I can imagine something like this:

    <property name="myProp">
    <vector type="IMyInterface">
    <value type="ref">MyIinstance</value>
    </vector>
    </property>

    As Flex 4 is right around the corner I guess demand for this will be high in a very short time, what do you think?

    thanks a lot in advance, I love Spring AS and am glad to see it taking on momentum!

    Roland

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

    Default hmm, might be problems

    Hm, you might run into some problems with this Vector type though.
    I've been fooling around with trying to instantiate one dynamically, but the compiler keeps on kicking me in the teeth.

    Apparently this is not legal:

    new Vector.<cls>();

    where cls is a variable of type Class. I guess it's impossible to instantiate a Vector dynamically because the compiler needs to now the type at compile-time.

    So much for generics in actionscript I guess. I hope I'm wrong on this one, otherwise it'll throw quite the spanner in the works...

    any thoughts anyone?

    cheers,

    Roland

    P.S. Then again, I'm working with the beta version of the flex 4 compiler, it just might work by the time its finished...
    Last edited by 666shooter; Dec 19th, 2008 at 07:09 AM. Reason: forgot something to say

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

    Default workaround

    there's an ugly workaround I guess. You can populate an untyped array through the Spring configuration and feed it to your object instance, in the instance you can convert the array to a vector like this:

    var v:Vector.<String> = Vector.<String>(untypedArray);

    not very elegant I guess...

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

    Default

    Hi Roland,

    thanks for looking into this. I would definitely be interested in supporting this, but as you can see it doesn't really make sense since you can't create typed vectors at runtime.

    Perhaps you should file a features request in the Adobe Jira. If you do so, post the link so we can all vote.

    regards,
    Christophe
    Christophe Herreman
    Spring ActionScript Founder
    http://www.herrodius.com

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

    Default

    Hey Christophe,

    I'd already asked the question over here:

    Adobe Help

    But it seems they're not very responsive on that site, so I'll file a JIRA bug and post the link here as you suggested.

    -Roland
    Last edited by 666shooter; Dec 28th, 2008 at 01:27 PM. Reason: typo...

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

    Default feature request added

    I've decided to add it as a feature request, I wasn't sure if I should classify this as a bug. Its more of a limitation of the compiler I guess.

    But I filed it over here, so if as many people would like to vote for it, please do:

    http://bugs.adobe.com/jira/browse/FP-1282

    I hope I phrased the request correctly, if anybody has a better way of putting it to words, please help me out here

    cheers,

    Roland
    Last edited by 666shooter; Jan 7th, 2009 at 02:40 AM. Reason: Bug was moved from flex compiler to flash player, so URL was updated

Posting Permissions

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