0
가 i를 Game.as에 다음 코드가 포함 :찌르레기 비트 맵 참조 오류
package
{
import flash.display.Bitmap;
import starling.display.Image;
import starling.display.Sprite;
import starling.events.Event;
import starling.textures.Texture;
import starling.utils.deg2rad;
public class Game extends Sprite
{
private const NUM_SAUSAGES: uint = 400;
private var sausagesVector: Vector.<Image> = new Vector.<Image>(NUM_SAUSAGES, true);
[Embed(source = "../media/textures/sausage.png")]
private static const Sausage: Class;
public function Game()
{
addEventListener(Event.ADDED_TO_STAGE, onAdded);
}
private function onAdded(e: Event): void
{
var sausageBitmap: Bitmap = new Sausage();
var texture: Texture = Texture.fromBitmap(sausageBitmap);
for (var i: int = 0; i < NUM_SAUSAGES; ++i)
{
var image: Image = new Image(texture);
image.alpha = Math.random();
image.x = Math.random() * stage.stageWidth;
image.y = Math.random() * stage.stageHeight;
image.rotation = deg2rad(Math.random() * 360);
addChild(image);
sausagesVector[i] = image;
}
}
}
}
을하지만 코드를 실행할 때 나에게 다음과 같은 오류 제공 : ReferenceError가 : 오류 # 1065 : 변수 Game_Sausage가 아닌 한정된.
잘 모르기 때문에 코드의 문제점은 무엇입니까?
그것은 나에게 또 다른 오류를 bives :( –
사랑의 게재 문제의 숫자가 있었다 인터넷 검색을합니다. 오류 번호, 일부는 매우 모호했습니다 (플래시 버전) 제안을 좋아해요, 리소스를 찾을 수 없습니다. 올바른 임베디드 경로가 맞습니까? 다른 리소스가 올바르게로드되고 있거나 텍스처가 될 수 있습니다. ./etc.? 대신 ./? 소스 폴더 조직은 컴파일 된/패키지 된 아티팩트와 다를 수 있습니다. – Joeblade
경로는 다음과 같습니다. 100 % 정확함. –