This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var description:XML = describeType(miObjeto); | |
trace(description); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function map(value:Number, low1:Number, high1:Number, low2:Number = 0, high2:Number = 1):Number { | |
//El valor, valor min del original, valor máx del original, valor min, valor max | |
//myBox.x = map(mouseX, 0, 550, 100, 200);v | |
//http://lab.joelgillman.com/archives/87_map-function | |
//if the value and the 1st range low are equal to | |
// the new value must be low2 | |
if (value == low1){ | |
return low2; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function extractFileType(fileName:String):String { | |
var extensionIndex:Number = fileName.lastIndexOf("."); | |
if (extensionIndex == -1) { | |
return ""; | |
} else { | |
return "." + fileName.substr(extensionIndex + 1, fileName.length); | |
} | |
} | |
//Thanks to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Créditos | |
//http://labs.grupow.com/index.php/2009/05/random-points-inside-a-triangle/ | |
function getRandomPointInTriangle (A:Point,B:Point,C:Point):Point { | |
//P = aA + bB + cC | |
//@see http://www.cgafaq.info/wiki/Random_Point_In_Triangle | |
var a:Number = Math.random(); | |
var b:Number = Math.random(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal function rangoRandom(low:Number,high:Number):Number { | |
var numeroRandom:Number = Math.floor(Math.random() * (high - low)) + low; | |
//trace("Numero Random: " + numeroRandom); | |
return numeroRandom; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var url:String="ruta.html"; | |
navigateToURL(new URLRequest(url), "_blank"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CFIndex rc = CFGetRetainCount((__bridge CFTypeRef)myObject); | |
NSLog(@"%li",rc); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public var sb:ScrollBar = new ScrollBar; | |
public var mcContenido:MovieClip; | |
public var mcMask:MovieClip; | |
private function configScroll():void { | |
//Config Scroll | |
//trace("Configurar Scroll"); | |
sb.x = 20+mcContenido.x + mcContenido.width; | |
sb.y = mcContenido.y; | |
sb.height = mcMask.height; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float r; float g; float b; float a; | |
[UIColor colorWithRed:r/255.f | |
green:g/255.f | |
blue:b/255.f | |
alpha:a/255.f]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Vaciar el contenedor | |
private function vaciarContenedor(contenedor:MovieClip):void { | |
//Borrar todos los objetos en el contenedor | |
for (var i:int = contenedor.numChildren - 1; i >= 0; i--){ | |
contenedor.removeChildAt(i); | |
} | |
} |
OlderNewer