2013-05-17 42 views
1

我的編譯器向我顯示此錯誤: 行408 1046:未找到類型或不是編譯時常量:_switch_antennaData。 行414 1046:類型未找到或不是編譯時常量:_switch_antenna0Data。 Line 420 1046:類型未找到或不是編譯時常量:_switch_antenna1Data。 426行1046:類型未找到或不是編譯時常量:_switch_antenna2Data。Flash/Actionscript錯誤1046:未找到類型或不是編譯時常量:_switch_antennaData

我檢查了我的文件和這是我有:

407 antenna_a.subMeshes[0].material = getMaterialFromID("EXT252"); 
408 var _switch_antenna2Data:_switch_antenna2Data = new _switch_antenna2Data(); 
409 var geom_switch_antenna2:Geometry = _switch_antenna2Data.geometryData; 
410 var _switch_antenna2_rd:Vector.<Number> = Vector.<Number>([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]); 
411 var _switch_antenna2:Mesh = buildMesh(geom_switch_antenna2, _switch_antenna2_rd, "_switch_antenna2", getMaterialFromID("EXT252"), cont); 

413 _switch_antenna2.subMeshes[0].material = getMaterialFromID("EXT252"); 
414 var _switch_antenna1Data:_switch_antenna1Data = new _switch_antenna1Data(); 
415 var geom_switch_antenna1:Geometry = _switch_antenna1Data.geometryData; 
416 var _switch_antenna1_rd:Vector.<Number> = Vector.<Number>([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]); 
417 var _switch_antenna1:Mesh = buildMesh(geom_switch_antenna1, _switch_antenna1_rd, "_switch_antenna1", getMaterialFromID("EXT252"), cont); 

419 _switch_antenna1.subMeshes[0].material = getMaterialFromID("EXT252"); 
420 var _switch_antenna0Data:_switch_antenna0Data = new _switch_antenna0Data(); 
421 var geom_switch_antenna0:Geometry = _switch_antenna0Data.geometryData; 
422 var _switch_antenna0_rd:Vector.<Number> = Vector.<Number>([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]); 
423 var _switch_antenna0:Mesh = buildMesh(geom_switch_antenna0, _switch_antenna0_rd, "_switch_antenna0", getMaterialFromID("EXT252"), cont); 

425 _switch_antenna0.subMeshes[0].material = getMaterialFromID("EXT252"); 
426 var _switch_antennaData:_switch_antennaData = new _switch_antennaData(); 
427 var geom_switch_antenna:Geometry = _switch_antennaData.geometryData; 
428 var _switch_antenna_rd:Vector.<Number> = Vector.<Number>([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]); 
429 var _switch_antenna:Mesh = buildMesh(geom_switch_antenna, _switch_antenna_rd,"_switch_antenna", getMaterialFromID("EXT252"), cont); 

什麼是連_switch_antennaData?我是新的ActionScript和Flash Professional,有人可以幫我擺脫這個錯誤嗎?

+0

找出這個代碼的開發人員運行時錯誤,並捶他刻苦的,直到他會告訴你什麼是這些類型。 – Vesper

+0

這是一些真正惡魔般的代碼。 –

回答

0

此代碼從哪裏來?你的還是來自教程?

編譯器抱怨的代碼行不通;

var _switch_antenna0Data:_switch_antenna0Data = new _switch_antenna0Data();

兩個變量名和變量類型是相同的,而據我所記得的,你不能做到這一點與AS。無論如何,這可能不是你想要的。

您需要找出應該是什麼類型,並在編譯器抱怨的四行中進行相應替換。

之後,你可能會得到上線409,415,421和427 :)

相關問題