Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 11:43 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: How to identify which Object a User clicks on?
PostPosted: May 4th, 2008, 10:00 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
I am lazy. I wondered if there was an easy way to track and use the name of the object a User clicks on.

I know I could add a MouseClick trigger w/ a "GetName()" action/script. But doesn't that require action be created for each object (or call a function from each object)? What if I later modify the pub and add an object and 'forget' I had to make it conform to that approach?

So I played around and came up with one method. Thanks to Mackavi and his 'Click and Grab' function page for pointing the way.

The attached sample illustrates this. The idea being... once I have the name of the User's selection, I can operate on it... or the User can do things to it. It builds-in some logic to ignore if User clicks on whitespace and not an object.

If there are simply ways or something I missed, please post.
Also, this covers regular objects... what has to be changed to handle clones ( instead of Page1.GetChild()...)?

Cheers
Larry


You do not have the required permissions to view the files attached to this post.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: May 16th, 2008, 12:08 am 
Offline

Joined: October 26th, 2004, 10:23 am
Posts: 666
Location: Digital Workshop
You could use a loop and RegisterEventHandler() to attach a callback function to objects which calls another function with this.GetName() as a parameter. This has the same efect as your first suggestion but by scripting it you can automate the process and add objects in the furture.

So if you named your object "ClickMe1", "ClickMe2" etc and wrote a loop that eumerated those objects if you add another one in the future it would get the callback added. Or put them all in a frame and just do a GetNextChild() loop.

_________________
ddww Opus Developer


For this message Duncan Lilly has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: May 16th, 2008, 12:21 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Thanks, Duncan

Coming up for a breather are we?
Glad to hear things are progressing well there.

I'll look into your alternate method... it'll have to be some time later. I am not quite tuned-in. I'm off that right now and working out some other 'challenges'. What you outlined is a bit abstract for me at the moment... but am sure it will clear up when I come back to it. Thanks.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 23 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group