Posted by Riccardo on March 8, 2010 12:54 pm under Actionscript 3, Snippets
var array : Array = ["a", "b", "c"]; var vector : Vector.<String> = Vector.<String>(array);
Tags: Actionscript 3, as3, Flash, Snippets
4 Tweets
I get an error (in FDT) with that syntax.
Shouldn’t line 2 really be: var vector : Vector. = Vector.(array);
Ah, I see what may have happened. I think the comment field seems to have stripped out the $lt; and > symbols when trying to write Vector.<String> I’m guessing it did that with your source above?
Hi Ben, That’s exactly what has happened in my post…Fixed it escaping the symbols.
Thanks for that
[AS3 SNIPPET] Convert Array to Vector: var array : Array = ["a", "b", "c"]; var vector : Vector. = Vector.(array); http://is.gd/9XyjO
This comment was originally posted on Twitter
[AS3 SNIPPET] Convert Array to Vector http://bit.ly/bUpJUi
[AS3 SNIPPET] Convert Array to Vector http://bit.ly/bUpJUi /via @gillesguillemin #flash #flashdev
Trackback URI | Subscribe to the comments through RSS Feed
name (required)
email ( will not be shown ) (required)
website
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Additional comments powered by BackType
Actionscript 3 adobe AIR as3 bug Eclipse FDT Flash Flash Catalyst Flex ide logging Snippets
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.
I get an error (in FDT) with that syntax.
Shouldn’t line 2 really be:
var vector : Vector. = Vector.(array);
Ah, I see what may have happened. I think the comment field seems to have stripped out the $lt; and > symbols when trying to write Vector.<String>
I’m guessing it did that with your source above?
Hi Ben,
That’s exactly what has happened in my post…Fixed it escaping the symbols.
Thanks for that
[AS3 SNIPPET] Convert Array to Vector: var array : Array = ["a", "b", "c"];
var vector : Vector. = Vector.(array); http://is.gd/9XyjO
This comment was originally posted on Twitter
[AS3 SNIPPET] Convert Array to Vector http://bit.ly/bUpJUi
This comment was originally posted on Twitter
[AS3 SNIPPET] Convert Array to Vector http://bit.ly/bUpJUi /via @gillesguillemin #flash #flashdev
This comment was originally posted on Twitter