kingyiren / flex-object-handles

Automatically exported from code.google.com/p/flex-object-handles
0 stars 0 forks source link

how to create dyanmic moveble textarea #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
dear sir, 
this is my code. i try to create dynamic MoveableTextArea. textarea
successfully created but bounding box not create please help.   

<?xml version="1.0" encoding="utf-8"?>
<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml" 
    xmlns:example="com.roguedevelopment_new.objecthandles.example.*"
                horizontalScrollPolicy="off"
                verticalScrollPolicy="off"
                backgroundColor="#FFFFFF" borderStyle="solid" borderColor="#000000"
borderThickness="2"
                creationComplete="init()"
                click="if( event.target == this )
objectHandles.selectionManager.clearSelection();" >

    <mx:Script>
        <![CDATA[
            import com.roguedevelopment_new.objecthandles.example.MoveableTextArea;
            import com.roguedevelopment_new.objecthandles.example.TextDataModel;
            import com.roguedevelopment_new.objecthandles.HandleRoles;
            import com.roguedevelopment_new.objecthandles.HandleDescription;
            import
com.roguedevelopment_new.objecthandles.constraints.MovementConstraint;
            import com.roguedevelopment_new.objecthandles.constraints.SizeConstraint;
            import com.roguedevelopment_new.objecthandles.Handle;
            import com.roguedevelopment_new.objecthandles.ObjectHandles;
            import mx.effects.Tween;
            import mx.effects.Move;
            import com.roguedevelopment_new.objecthandles.example.SimpleSpriteShape;
            import com.roguedevelopment_new.objecthandles.example.SimpleDataModel;
            import com.roguedevelopment_new.objecthandles.example.SimpleFlexShape;

            protected var objectHandles:ObjectHandles;

            [Bindable] protected var dataModel:TextDataModel;
            [Bindable] protected var dataModel2:TextDataModel;

            [Bindable] protected var exam:MoveableTextArea;

            private function init() : void
            {

                 objectHandles = new ObjectHandles( this );
                var handles:Array = objectHandles.defaultHandles.concat();

                handles.push( new HandleDescription( HandleRoles.MOVE,
                                                            new Point(50,50) , 
                                                            new Point(0,0) ) ); 

                dataModel = new TextDataModel();
                dataModel.x = 10;
                dataModel.y = 150;
                dataModel.width = 100;
                dataModel.height = 100;
                dataModel.text = "Hello World!";

                exam = new MoveableTextArea();
                exam.model=dataModel;
                exam.id="movess";
                exam.setStyle("fontSize","18");  
                exam.setStyle("fontFamily","myVerdana");

                objectHandles.registerComponent(dataModel, exam, handles);  

                tryone.addChild(exam);

            } 

        ]]>
    </mx:Script>

    <mx:Canvas id="tryone" width="100%" height="100%">

    </mx:Canvas>

    <example:Example4>
    </example:Example4>

</mx:Application>

Original issue reported on code.google.com by abidr...@gmail.com on 30 Jul 2009 at 7:18

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by marc.hug...@gmail.com on 22 Dec 2009 at 3:55