A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [AS3] Super Simple Custom Component in CS4

Threaded View

  1. #3
    Thanks so much! This works great!

    Code:
    package {
    
    	import flash.display.MovieClip;
    
    	[Inspectable(name = "myNum",type = uint,defaultValue = 0)]
    
    	public class Component extends MovieClip {
    
    		private var _myNum:uint;
    
    		public function Component() {
    			trace(myNum);
    			_myNum = myNum;
    			trace(_myNum);
    		}
    
    		public function set myNum(num:uint):void {
    			_myNum = num;
    		}
    		
    		public function get myNum():uint {
    			return _myNum;
    		}
    
    	}
    
    }
    Note to others if using this for reference: You may need to use int, Number, String... instead of uint for your purposes.
    Last edited by sirzooass; 11-21-2009 at 11:37 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center