Does anyone have the Flex 4 Example code for: http://www.objecthandles.com/static/FinishingTouches/FinishingTouches.html

57 views
Skip to first unread message

Craig McLeod

unread,
Aug 31, 2011, 4:31:09 AM8/31/11
to Flex ObjectHandles
Hi,

I paid for the examples but they never arrived. So I was wondering if
anyone had the sample for "Finishing Touches".

http://www.objecthandles.com/static/FinishingTouches/FinishingTouches.html

I am looking for the code to:

1) Delete Selected Object. (since the typical add child and find child
by name cant be used on mainGroup).
2) Add Scroller to Canvas. ( get an ilayout related error when I try
this.)
3) Have Canvas Constraints dynamically change with the screen size.
(live binding does not work here. So I presume 4) everytime the canvas
shifts I need to "re-contrain" the elements.)

Also I would like to fix the error that any time you click an arrow
key with nothing selected an exception is raised.

For those looking to do dynamic Add's you can check out my previous
post, I posted my solution.
its probably not the cleanest approach and I tampered the model to my
needs. But it works well.

Please and thank you for any help anyone can give.
Regards
Craig



Craig McLeod

unread,
Aug 31, 2011, 8:32:38 AM8/31/11
to Flex ObjectHandles
I achieved the remove as follows:

public function removeSelected():void {
if (objectHandles.selectionManager.currentlySelected[0])
{
var elementToRemove:IVisualElement =
this[objectHandles.selectionManager.currentlySelected[0].CanvasItemID];
objectHandles.unregisterComponent(elementToRemove);
mainGroup.removeElement(elementToRemove)
} else {
Alert.show('Please select an object to remove from the
canvas','Oops');
}
}


Still need a little help on the rest, please and thank you in advance
to anyone who can help.

Craig McLeod

unread,
Aug 31, 2011, 10:16:37 AM8/31/11
to Flex ObjectHandles
Turns out my code only works with objects created at init, any objects
created progmaitcally after fail to delete, even though they are the
same object path.
#fail... :(
Reply all
Reply to author
Forward
0 new messages