Reference static variable : Static : Class Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Class » Static »

 

Reference static variable


 


class Bicycle
    {
        static public var wheels:Number = 2;

        private var _gears:Number;
        public function get gears():Number
        {
            return _gears;
        }

        public function Bicycle(numberOfGears:Number)
        {
            this._gears = numberOfGears;
            for (var i:int 0; i < Bicycle.wheels; i++)
            {
                //Prepare a wheel.
            }
        }
    }

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Class
» Static