Find extension of a file

/** * * find extension of a file */ private function findExtension(str : String) : String { return String(str.split(“.”)[1]).toLowerCase(); }

adminFind extension of a file

Resize image to fit in a rectangle

/** * resize image to fit in a rectangle */ public function resizeToFit(mc : MovieClip, width : Number, height : Number) : void { var largeWidth : Number = mc.width; var largeHeight : Number = mc.height; initialContainerWidth = largeWidth; initialContainerHeight = largeHeight; mc.width = int((fitPercent / 100) * largeWidth); mc.height = int((fitPercent / 100) * largeHeight); mc.x = Math.round((componentWidth – …

adminResize image to fit in a rectangle

Set the movieclip color

/*** set the movie clip color */ public function setColor(mc : MovieClip, color : Number) : void { var colorTransform : ColorTransform = mc.transform.colorTransform; colorTransform.color = color; mc.transform.colorTransform = colorTransform; }

adminSet the movieclip color

Cube with different color faces

public class away3DBasico_v003 extends Sprite { public var view:View3D = new View3D();   public var plano1:PlaneGeometry = new PlaneGeometry(100,100,1,1,true);//false indica si el plano esta acostado o parado   public var plano2:PlaneGeometry = new PlaneGeometry(100,100,1,1,true);//estos dos estaran de huevones acostados   public var plano3:PlaneGeometry = new PlaneGeometry(100,100,1,1,false);   public var plano4:PlaneGeometry = new PlaneGeometry(100,100,1,1,false);   public var plano5:PlaneGeometry = new PlaneGeometry(100,100,1,1,false); …

adminCube with different color faces

Away3d 4 Beta: Bitmap texture with loaded image

// 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; }

adminAway3d 4 Beta: Bitmap texture with loaded image