[ObjectHandles] How to count objecthandles's object in a canvas

5 views
Skip to first unread message

Abhi

unread,
Oct 29, 2009, 1:52:13 AM10/29/09
to Flex ObjectHandles
HI All

Please help me
How to count all objecthandles's object in a canvas.

Jameel Khan

unread,
Oct 29, 2009, 2:05:51 AM10/29/09
to object...@googlegroups.com
Hi Guys,

How can I get the handle of the selected object? I am basically having a text area where user can  type some text.  As user types text into the text area, the same text will appear in the selected control.

So lets say, I have two texts in the canvas as follows :

        <mx:Canvas id="myCanvas" borderColor="#6B7881" backgroundColor="#F5C5C5" width="100%" height="60%">
            <oh:ObjectHandles id="test" mouseCursors="{null}" allowRotate="false" x="10" y="10" width="307" height="30" minHeight="30" minWidth="130" >
                    <mx:Text text="AAA" width="100%" height="100%"  x="0"/>
            </oh:ObjectHandles>

<oh:ObjectHandles id="test" mouseCursors="{null}" allowRotate="false" x="10" y="10" width="307" height="30" minHeight="30" minWidth="130" >
                    <mx:Text text="BBBB" width="100%" height="100%"  x="0"/>
            </oh:ObjectHandles>

        </mx:Canvas>

User can type text (as this control is non-editable) through a text area. when user types text in text area, same characters will be typed in text also. This can easily be done. But before I can do this I need to get handle of the selected control so that, text can be typed in appropriate handles. The requirement is : The text should be typed in the selected control. If user selects the other control and tries to type the text in the text area, then text should be typed in the other control.

Can anybody tell me how to do this?

Thanks
Jameel

Tami Wright

unread,
Oct 29, 2009, 2:21:11 AM10/29/09
to object...@googlegroups.com
Look at http://code.google.com/p/mate-examples/.  I'm using a concept from this code base called "document-based" to manage ObjectHandles children on a canvas.  I then edit the currently selected ObjectHandles object from a separate editing panel.  The canvas parent of all the ObjectHandles children and the editing panel are both bound to the same object.
--
>>>>>>>>><<<<<<<<<
Tami Thompson Wright
tami....@excentrixweb.com
tamit...@thompson-technical.com
tami....@computer.org
(801) 709-4401 (Cell)
(801) 615-5298 (Land line)
(801) 515-8818 (Fax)
*Chief Executive Officer and Owner
Thompson Technical Services, Inc. & Excentrix Web, Inc.

"If devotion to the truth is the hallmark of morality, then there is no greater, nobler, more heroic form of devotion than the act of a man who assumes the responsibility of thinking. "
~Ayn Rand (my hero)

Chetan Sachdev [www.riageeks.com]

unread,
Nov 12, 2009, 3:19:39 PM11/12/09
to Flex ObjectHandles
If your canvas have only object handles, then use canvas.numChildren
method to know number of objects, other way is to count it by using
getChildren, it will return an array of children then you test each
object e.g.
obj is ObjectHandles or obj is FixedObjectHandles and count them. Hope
this helps

--
Best Regards;
Chetan Sachdev
http://www.riageeks.com
Reply all
Reply to author
Forward
0 new messages