flash on 2012-9-1
♥0 |
Line 44 |
Modified 2012-09-01 20:49:16 |
MIT License
archived:2017-03-20 03:50:04
ActionScript3 source code
/**
* Copyright TmskSt ( http://wonderfl.net/user/TmskSt )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/dKjN
*/
package {
import flash.display.Sprite;
import com.actionscriptbible.Example;
public class FlashTest extends Example {
private var p:P = new P(1578);
public function FlashTest() {
// write as3 code here..
var v:V = new V(p);
trace("---");
trace(v.toString());
v.p.color = 432;
trace("---");
trace(v.toString());
p.color = 32;
trace("---");
trace(v.toString());
}
}
}
import flash.display.Sprite;
class V {
public function get p():P { return _p; }
public function set p(value:P):void {
this._p = value;
}
private var _p:P;
public function V(p:P) {
this._p = p;
}
public function toString():String {
return this._p.color.toString();
}
}
class P {
private var _color:int;
public function get color():int {
return _color;
}
public function set color(value:int):void {
_color = value;
}
public function P(color:int) {
this._color = color;
}
}