ActionScript - Read Only Property and Private Set Method? -


One thing I have never really understood about AS3 is that you do not get a personal set method and a public method

myNumber = 22

But I want to make that number function Will have to pass as the parameter of

  myNumber (22); For example:   

For example:

  package {// import import flash. Display.Sprite // class public class number class sprite extended {// property private Var myNumberProperty: Number // Constructor Public Function Number Class (myNumber: number): zero {this.myNumber = myNumber; in this(); } // start private function init (): zero {trace (myNumber); } // My number setter sets a personal function myNumber (value: number): zero {myNumberProperty = Math.max (0, Math minutes (value, 100)); } // Get my number (my number) public function my number (): number {myNumberProperty return; }}}   

Is there no way to use fixed keywords on a personal function?

MXML Compiler does not support gator and seters with mixed scope / namespace, something about it Tickets are open:

  • It is quite upset, but at least Adobe knows about it. There is a way of completing composite namespace recipients and sets using custom namespaces and references to the gestetter or setter completely.

      package {use namespace my_namespace public class MyClass {personal var_name: String; Get the name of the public function (): string {return _name; } My_namespace function set name (value: string): zero {_name = value; }} Public class MySubClass expands MyClass {public function MySubClass (name: string) {super.my_namespace :: name = name; }}}}    

Comments