My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 31: How can i restruct object handle in canvas ?
2 people starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


 
Reported by naresh....@gmail.com, Dec 22, 2009
What steps will reproduce the problem?
1.I have to restrict Object handle in canvas container.
2.after applying restiction it should work well on resizing and move etc.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.
Please give any idea or sample of code to restrict object handle in canvas
container.

I was restricted Object Handle. It restricted around the bounds but when i
resize the OH and size exceed the canvas container boundaries it not
working fine. It giving ugly output.
Please provide some tips or code realted it.






Jul 13, 2011
#1 b.vijayv...@gmail.com
Hai Naresh ...!!! Try This one
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600" xmlns:objecthandles="com.roguedevelopment.objecthandles.*">
	<mx:Script>
		<![CDATA[
			import mx.controls.Alert;
			import mx.events.MoveEvent;
			protected function objecthandles1_moveHandler(event:Event):void
			{    
				can.x
				var canvasW:Number=can.width;
				var canvasH:Number=can.height;
				if(obj.x+obj.width>canvasW)
				{
					obj.x=canvasW-obj.width;
				}
				if(obj.x<0)
				{
					obj.x=0;
				}
				if(obj.y+obj.height>canvasH)
				{
					obj.y=canvasH-obj.height;
				}
				if(obj.y<0)
				{
					obj.y=0;
				}    
			}
			

			
			
			protected function obj_clickHandler(event:MouseEvent):void
			{
				obj.select()
			}
			
		]]>
	</mx:Script>
	
	<mx:Canvas id="can" x="50" y="50" width="600" height="500" borderStyle="solid" toolTip="{can.x,can.y}" horizontalScrollPolicy="off" verticalScrollPolicy="off">
		
		<objecthandles:ObjectHandles id="obj" height="100" width="100" move="objecthandles1_moveHandler(event)"  
									 
									 click="obj_clickHandler(event)"  toolTip="{obj.x,obj.y}" >
			<mx:Image source="Desktopb.jpg" maintainAspectRatio="false" height="100%" width="100%">
				
			</mx:Image>
		</objecthandles:ObjectHandles>
	</mx:Canvas>
</mx:Application>

Powered by Google Project Hosting