Not able to get it working ... the objecthandles

55 views
Skip to first unread message

Arif Ali Saiyed

unread,
Oct 17, 2012, 11:28:30 AM10/17/12
to Flex ObjectHandles
Hi There,
I tried using Objecthandles by creating an independent
sample app.
I tried the approach that's mention in the example 2. the spirit
approach.
but it dint work for me.

.These are the steps i followed

1. created empty flex project- desktop app
2. added one UIComponent
3. created spirite and model class.
4. tried adding the object handles to it..

Here is the link to my tiny sample app ( flex project)
https://www.dropbox.com/s/gf01e99d0crtq4i/ObjectResize.fxp

Marc Hughes

unread,
Oct 17, 2012, 1:45:07 PM10/17/12
to object...@googlegroups.com
Your display and model objects aren't connected in any way.

Perhaps something like this?

flexShape.model = flexModel;

or

objectHandles.registerComponent( flexShape.model, flexShape,handles,true);

-Marc



--
You received this message because you are subscribed to the Google Groups "Flex ObjectHandles" group.
To post to this group, send email to object...@googlegroups.com.
To unsubscribe from this group, send email to objecthandle...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/objecthandles?hl=en.


Arif Ali Saiyed

unread,
Oct 17, 2012, 2:19:17 PM10/17/12
to object...@googlegroups.com
Hi Marc,
             Thanks you very much or this useful utility and thanks for responding so quickly. 
As you see in my attached project, I have two appraoch.

approach 1 :  makes uses of Sprit approach. 
approach 2:    makes uses of flex component approach.

Regarding you were correct  about  no conection between flexShape.  &  flexModel,  I made that change still approach 2 dint work. 
Did you check my appraoch 1 ? In that i already had the connection between spirit and the model but still it did not work.

Am i not suppose to add it to UIComponent ? Am is suppose to add display object ( Spirit or flexshape ) and object handles to canvas or something ? 

-Arif  
ObjectResize.fxp

Maurice Mullens

unread,
Oct 18, 2012, 10:08:09 AM10/18/12
to object...@googlegroups.com
HI

you have to register not the object itself but the parent in which it is placed.

so registerComponent(flexShape.parent, etc)

Bye
Maurice

2012/10/17 Arif Ali Saiyed <arif.a...@gmail.com>

Maurice Mullens

unread,
Oct 18, 2012, 10:11:42 AM10/18/12
to object...@googlegroups.com
I am sorry, that was no good! :-(

This is how i have my script working:

var p:photo = new photo;

var dataModel:SimpleDataModel = new SimpleDataModel;

dataModel.x = e.@objectx;

dataModel.y = e.@objecty;

dataModel.width = e.@objectwidth;

dataModel.height = e.@objectheight;

dataModel.rotation = e.@objectrotation

p.model = dataModel; (in my photo class i have a model object and a oh (objecthandles) object

p.oh.registerComponent(dataModel, p, hd);

etc 

Also i added a custom event to clear the handles that were active when you click on a photo object.

Hope this helps!

Maurice




2012/10/18 Maurice Mullens <maurice...@gmail.com>

Arif Ali Saiyed

unread,
Oct 18, 2012, 3:12:06 PM10/18/12
to object...@googlegroups.com
Hi There,
             Thanks for your response, Hye i got it working myself , it did work  when i changed UIComponent to Canvas ...( strage but still it worked) 
so now in my mxml i have one canvas.... which is the container for objecthandles and displayobject aka flexshape. 


Thanks 
-Arif 
Reply all
Reply to author
Forward
0 new messages