AS 3.0 (Casting de objetos)
Posted by Administrador | Filed under Actionscript 3.0
Para los que han programado alguna vez en Java estaran más que acostumbrados al casting de objetos, un ejemplo en java seria este:
Object miObjeto = "esto es un objeto";
String cadena = (String)miObjeto; // casting del objeto
y ahora en Actionscript 3.0 el casting se hace de la siguiente forma, usando un “as“:
var objeto:Object = new Object();
var articulo:Articulo = objeto as Articulo; // Articulo es una clase simulada
Octubre 6th, 2006 at 1:05 pm
[...] As 3.0 (Detectar cursor fuera swf) As 3.0 (Cambiar fps dinámicamente) As 3.0 (Adiós al attachMovie) As 3.0 (Casting de objetos) As 3.0 (TimerEvent.TIMER) As 3.0 (flash.display.Sprite) As 3.0 (flash.utils.Dictionary) [...]