// creating the mesh var geometry:SphereGeometry = new SphereGeometry (100); var sphere:Mesh = new Mesh(geometry); scene.addChild(sphere); // loading texture var url:String = 'image.jpg'; var Ldr:Loader = new Loader(); Ldr.load(new URLRequest(url)); Ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete); function onComplete(e:Event):void { var bitmap:Bitmap = Bitmap(Ldr.content); var bitmapData:BitmapData = bitmap.bitmapData; var texture:BitmapTexture = new BitmapTexture(bitmapData); var material:TextureMaterial = new TextureMaterial(); material.texture = texture; sun.material = material; }