[Embed(source="assets/earthmap.jpg")] public var earthMap:Class; private var moonMaterial:BitmapMaterial;
Create a new BitmapAsset variable cad cast the image class to it.
var earthAsset:BitmapAsset = new earthMap() as BitmapAsset;
Finally assign the new variable as a material.
earthMaterial = new BitmapMaterial(earthAsset.bitmapData);
No comments:
Post a Comment