レス数:6 / 状態:解決済み / No:100 / ATOM
1
名前:ACE
日付:2012/11/09(金)01:13:39
ID:HFOQZVaq8Xrd
開発環境はFlashCS6.0 Actionscript3.0で開発しています。
現在マップチップを並べて背景を描画しようとしているのですが、
RangeError: Error #1125: インデックス 0 は 0 の範囲外です。
と表示されて実行することができません。
Arrayを使うと問題なく実行することはできます。
調べてもわからなかったのでどなたかよろしくお願いします。
______________________________________
//マップデータ
var mapData:Vector.<Vector.<Number>> = new Vector.<Vector.<Number>>([
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]),
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
]);
//マップチップの高さ、幅
var mapWidth:int = 48;
var mapHeight:int = 48;
//マップチップを格納する為の配列
var array:Array = new Array();
for (var i:int = 0; i < 26; i++)
{
array[i] = new Array();
}
for (var i:int = 0; i < x; i++)
{
for (var j:int = 0; j < y; j++)
{
switch(mapData[j][i])
{
case 0:
array[i][j] = new mapButton01();
break;
case 1:
array[i][j] = new mapButton02();
break;
default:
break;
}
array[i][j].x = i * mapWidth;
array[i][j].y = j * mapHeight;
stage.addChild(array[i][j]);
}
}
現在マップチップを並べて背景を描画しようとしているのですが、
RangeError: Error #1125: インデックス 0 は 0 の範囲外です。
と表示されて実行することができません。
Arrayを使うと問題なく実行することはできます。
調べてもわからなかったのでどなたかよろしくお願いします。
______________________________________
//マップデータ
var mapData:Vector.<Vector.<Number>> = new Vector.<Vector.<Number>>([
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]),
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
]);
//マップチップの高さ、幅
var mapWidth:int = 48;
var mapHeight:int = 48;
//マップチップを格納する為の配列
var array:Array = new Array();
for (var i:int = 0; i < 26; i++)
{
array[i] = new Array();
}
for (var i:int = 0; i < x; i++)
{
for (var j:int = 0; j < y; j++)
{
switch(mapData[j][i])
{
case 0:
array[i][j] = new mapButton01();
break;
case 1:
array[i][j] = new mapButton02();
break;
default:
break;
}
array[i][j].x = i * mapWidth;
array[i][j].y = j * mapHeight;
stage.addChild(array[i][j]);
}
}
2
名前:ACE
日付:2012/11/09(金)01:17:35
ID:HFOQZVaq8Xrd
すいません、ずれていたので修正版です。
_________________________________________
var mapData:Vector.<Vector.<Number>> = new Vector.<Vector.<Number>>([
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]),
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
]);
//マップチップの高さ、幅
var mapWidth:int = 48;
var mapHeight:int = 48;
//マップチップを格納する為の配列
var array:Array = new Array();
for (var i:int = 0; i < 26; i++)
{
array[i] = new Array();
}
for (var i:int = 0; i < x; i++)
{
for (var j:int = 0; j < y; j++)
{
switch(mapData[j][i])
{
case 0:
array[i][j] = new mapButton01();
break;
case 1:
array[i][j] = new mapButton02();
break;
default:
break;
}
array[i][j].x = i * mapWidth;
array[i][j].y = j * mapHeight;
stage.addChild(array[i][j]);
}
}
_________________________________________
var mapData:Vector.<Vector.<Number>> = new Vector.<Vector.<Number>>([
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]),
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
]);
//マップチップの高さ、幅
var mapWidth:int = 48;
var mapHeight:int = 48;
//マップチップを格納する為の配列
var array:Array = new Array();
for (var i:int = 0; i < 26; i++)
{
array[i] = new Array();
}
for (var i:int = 0; i < x; i++)
{
for (var j:int = 0; j < y; j++)
{
switch(mapData[j][i])
{
case 0:
array[i][j] = new mapButton01();
break;
case 1:
array[i][j] = new mapButton02();
break;
default:
break;
}
array[i][j].x = i * mapWidth;
array[i][j].y = j * mapHeight;
stage.addChild(array[i][j]);
}
}
3
名前:ACE
日付:2012/11/09(金)01:53:50
ID:HFOQZVaq8Xrd
たびたびすいません。
___________________________________________
var mapData:Vector.<Vector.<Number>> = new Vector.<Vector.<Number>>([
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]),
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
]);
//マップチップの高さ、幅
var mapWidth:int = 48;
var mapHeight:int = 48;
//マップチップを格納する為の配列
var array:Array = new Array();
for (var i:int = 0; i < 26; i++)
{
array[i] = new Array();
}
for (var i:int = 0; i < 26; i++)
{
for (var j:int = 0; j < 15; j++)
{
switch(mapData[j][i])
{
case 0:
array[i][j] = new mapButton01();
break;
case 1:
array[i][j] = new mapButton02();
break;
default:
break;
}
array[i][j].x = i * mapWidth;
array[i][j].y = j * mapHeight;
stage.addChild(array[i][j]);
}
}
___________________________________________
var mapData:Vector.<Vector.<Number>> = new Vector.<Vector.<Number>>([
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
new Vector.<Number>([1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]),
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
new Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
]);
//マップチップの高さ、幅
var mapWidth:int = 48;
var mapHeight:int = 48;
//マップチップを格納する為の配列
var array:Array = new Array();
for (var i:int = 0; i < 26; i++)
{
array[i] = new Array();
}
for (var i:int = 0; i < 26; i++)
{
for (var j:int = 0; j < 15; j++)
{
switch(mapData[j][i])
{
case 0:
array[i][j] = new mapButton01();
break;
case 1:
array[i][j] = new mapButton02();
break;
default:
break;
}
array[i][j].x = i * mapWidth;
array[i][j].y = j * mapHeight;
stage.addChild(array[i][j]);
}
}
4
日付:2012/11/09(金)21:31:46
ID:uqGvQ4UrzKin
Vector クラスのコンストラクタを使って、初期値を指定することはできません。
配列を渡すことで初期値を指定しつつ Vector オブジェクトを作成したい場合は、Vector 関数を使用します。
────────────────────────────────────
var v:Vector.<Number> = Vector.<Number>([1,5,9]);
trace(v);
────────────────────────────────────
…という事で、new が不要となります。
────────────────────────────────────
var mapData:Vector.<Vector.<Number>> = Vector.<Vector.<Number>>([
Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
Vector.<Number>([1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]),
Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
]);
trace(mapData);
────────────────────────────────────
Flash Professional CS5 以降であれば、このような記述も可能です。
────────────────────────────────────
var v:Vector.<Number> = new <Number>[1,5,9];
trace(v);
────────────────────────────────────
リファレンスです。
http://help.adobe.com/ja_JP/FlashPlatform/reference/actionscript/3/Vector.html#Vector()
配列を渡すことで初期値を指定しつつ Vector オブジェクトを作成したい場合は、Vector 関数を使用します。
────────────────────────────────────
var v:Vector.<Number> = Vector.<Number>([1,5,9]);
trace(v);
────────────────────────────────────
…という事で、new が不要となります。
────────────────────────────────────
var mapData:Vector.<Vector.<Number>> = Vector.<Vector.<Number>>([
Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]),
Vector.<Number>([1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]),
Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
Vector.<Number>([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
]);
trace(mapData);
────────────────────────────────────
Flash Professional CS5 以降であれば、このような記述も可能です。
────────────────────────────────────
var v:Vector.<Number> = new <Number>[1,5,9];
trace(v);
────────────────────────────────────
リファレンスです。
http://help.adobe.com/ja_JP/FlashPlatform/reference/actionscript/3/Vector.html#Vector()
5
名前:ACE
日付:2012/11/10(土)00:30:45
ID:HFOQZVaq8Xrd
迅速なお答えありがとうございます。
確かにnewを消したら動作しました。ありがとうございます。
リファレンスページを見落とすという初歩的なミスで質問してしまいすいませんでした。
確かにnewを消したら動作しました。ありがとうございます。
リファレンスページを見落とすという初歩的なミスで質問してしまいすいませんでした。
6
名前:状態変更
日付:2012/11/10(土)00:32:44
ID:HFOQZVaq8Xrd
この質問の状態を『解決』に変更しました。
このスレッドについて
質問の状態 : | 解決済み |
投稿開始日 : | 2012/11/09(金)01:13:39 |
投稿終了日 : | 2012/11/17(土)00:32:45 |
投稿者 : | ACE |
レス総数 : | 6 |
スレッド番号 : | 100 |