as3 Vector with init values

梦想的初衷 提交于 2019-12-21 09:16:14

问题


I want to instantiate a Vector.<Number> with two values of 1.0

You might think I would do Vector.<Number>(1.0, 1.0); but that only traces 0

Is what I'm trying to do possible? If so, how? Or am I stapled to the routine of using .push ?


回答1:


This one is even shorter:

var vec:Vector.<Number> = new <Number>[1.0, 1.0];


来源:https://stackoverflow.com/questions/8864773/as3-vector-with-init-values

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!