Konstantin's BLog
Function Viewer
home top contents previous up next

package
{
	import mx.core.UIComponent;
	
	public class UserInterAction extends UIComponent
	{
		public var rotator:ImageTransformatorUserControl;
  	    public var rotatorBase:ImageTransformatorUserControl;
		private var title:ImageTransformatorUserControl;
		private var about:ImageTransformatorUserControl;
		private var status:ImageTransformatorUserControl;
		public var fun:DrawFunction;
		public var sizeX:int;
		public var sizeY:int;
		
		
		
		public function UserInterAction()
		{
			//We cannot overcome this problem: we cannot find out what size of the screen is:
			//None of the following attemps succeed:
			//var st:mx.core.IFlexDisplayObject.Stage = mx.core.IFlexDisplayObject.stage;
			//base = new ImageTransformatorUserControl(st.stageWidth, mx.core.IFlexDisplayObject.stage.stageHeight);
			//We have to dictate the size manually:
			//base = new ImageTransformatorUserControl(sizeX/3, sizeY*10/12);
			
            sizeX = 500;
		    sizeY = 500;
		    title = new ImageTransformatorUserControl( 100,0,"Welcome to Function Viewer", 20, 0xFFFFFF, false,false,null,false,"" );
		    addChild(title);
		    
		    about = new ImageTransformatorUserControl(100,20,"", 
		                      10, 0xFFFFFF, true, false,null,true,"Copyright (C) 2008 Konstantin Kirillov, Landkey Computers." );
		    addChild(about);
		    
		    status = new ImageTransformatorUserControl( 100,40,"Use your mouse to experiment with all responding controls on this page.", 
		                                                10, 0xFFFFFF, true, false,null,true,"" );
		    addChild(status);
		    
			fun = new DrawFunction(100,100,sizeX, sizeY);
			addChild(fun);
			
            rotatorBase = new ImageTransformatorUserControl(100,70,"", 9, 0xFFFFFF, true,true,fun,false,"");
			addChild(rotatorBase);
			rotator = new ImageTransformatorUserControl(100,70,"Drag Circle Handle to Rotate the Function", 9, 0xFFFFFF, true,true,fun,true,"");
			addChild(rotator);

			
			//base.x = stage.stageHeight*10/12;
			//base.y = stage.stageWidth/2;
		}		
		
	}
}

Copyright (C) 2008 Landkey Computers