Просто жутко грузит флешку! Есть идеи как уменьшить объём занимаемой памяти?
P.S. earth1.jpeg - цилиндрическая карта.

Код AS3:
package GameObjects {
import flash.display.Graphics;
import flash.display.Shape;
import flash.geom.Matrix;
import flash.display.Loader;
import flash.net.URLRequest;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.events.Event;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.events.MouseEvent;
import flash.system.System;
import flash.filters.DropShadowFilter;
public class _3D extends Shape{
public var radius:Number;
public var sectorsPerQuarter:uint;
public var vertices:Vector.<Number>=new Vector.<Number>();
public var indices:Vector.<int>=new Vector.<int>();
public var uvtData:Vector.<Number>=new Vector.<Number>();
public var matrix:Matrix=new Matrix();
public var image:BitmapData;
public function _3D():void {
}
public function drawSphere3(radius:Number=10,sectorsPerQuarter:uint=10):_3D{
this.radius=radius;
this.sectorsPerQuarter=sectorsPerQuarter;
var loader:Loader=new Loader();
var request1:URLRequest=new URLRequest("earth1.jpeg");
loader.load(request1);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadComplete);
return this;
}
private function loadComplete(e:Event):void{
graphics.beginBitmapFill(e.target.content.bitmapData);
image=e.target.content.bitmapData;
var simpleAngle:Number=((180/(2*sectorsPerQuarter))*(Math.PI/180));
var currentRadius:Number;
radius*=20;
var angle:Number;
var line:Number=0;
var point:Point=new Point();
var yCount:uint=0;
e.target.removeEventListener(Event.COMPLETE,loadComplete);
for(var i:Number=-(simpleAngle*sectorsPerQuarter);i<=(simpleAngle*sectorsPerQuarter);i+=simpleAngle){
line=Math.sin(i)*radius;
currentRadius=Math.cos(i)*radius;
var xCount:uint=0;
for (var j:Number=-(simpleAngle*sectorsPerQuarter);j<=(simpleAngle*sectorsPerQuarter);j+=simpleAngle){
point.x=Math.sin(j)*currentRadius;
point.y=line;
vertices.push(point.x,point.y);
uvtData.push(xCount/(4*sectorsPerQuarter),yCount/(2*radius)-.05,1);
xCount++;
yCount++;
}
}
for (i=0;i<(vertices.length-(sectorsPerQuarter*2+1));i++){
if(i%(sectorsPerQuarter*2+1)!=20 && (i+1)%(sectorsPerQuarter*2+1)!=0){
indices.push(i,i+1,i+(sectorsPerQuarter*2+1), i+1,i+(sectorsPerQuarter*2+1),i+(sectorsPerQuarter*2+2));
}
}
graphics.drawTriangles(vertices,indices,uvtData);
this.shadowPlanet();
addEventListener(Event.ENTER_FRAME,rotate);
}
public function shadowPlanet(image:BitmapData=null):void{
var filter:DropShadowFilter=new DropShadowFilter();
var filter2:DropShadowFilter=new DropShadowFilter();
filter.distance=50;
filter2.distance=100;
filter.angle=0;
filter2.angle=180;
filter.alpha=.7;
filter2.alpha=.4;
filter.color=0x000000;
filter2.color=0xffffff;
filter.blurX=50;
filter2.blurX=100;
filter.inner=true;
filter2.inner=true;
this.filters=[filter,filter2];
}
private function rotate(e:Event):void{
graphics.clear();
graphics.beginBitmapFill(image/*,matrix*/);
for(var i:uint=0;i<uvtData.length;i+=3){
uvtData[i]+=.01;
}
graphics.drawTriangles(vertices,indices,uvtData);
graphics.endFill();
}
}
}
P.S.S. Вызов:

Код AS3:
var planet:_3D=new _3D();
planet.drawSphere3();
var k=addChild(planet);