Actionscript:
-
var Pnt:Function = function(xp:Number, yp:Number){
-
-
var x:Number = xp;
-
var y:Number = yp
-
-
this.setX = function(v:int):void{
-
x = v;
-
}
-
this.setY = function(v:int):void{
-
y = v;
-
}
-
this.getX = function():int {
-
return x;
-
}
-
this.getY = function():int {
-
return y;
-
}
-
}
-
-
var p:Object = new Pnt(10,10);
-
-
trace(p.getX(), p.getY());
-
p.setX(100);
-
trace(p.getX());
-
-
/*
-
outputs:
-
10, 10
-
100
-
*/
Another way to define and instantiate Objects on the timeline. Interesting, but I don't recommend it over actual classes...