Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently September 28th, 2024, 11:26 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: ILMObject object reference
PostPosted: July 21st, 2005, 4:24 pm 
Offline

Joined: November 11th, 2004, 1:43 pm
Posts: 172
Location: Buckinghamshire, UK
From the following trace commands, I am getting an output as below


commands
-------------
Debug.trace("GetName(): " + this.GetName() + "\n")
Debug.trace("GetParent(): " + this.GetParent() + "\n")
Debug.trace("GetNumberChildren(): " + this.GetNumberChildren() + "\n")

Output
--------
GetName(): Sunday
GetParent(): [ILMObject Chapter 1: Basics]
GetNumberChildren(): 6


Why is the GetParent returning "[ILMObject Chapter 1: Basics]"? I was expecting "Chapter 1: Basics" to be returned?

Elsewhere in the forum a mention of a duplicate variable name would result in this, but I haven't got variables set as per .imp file....


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


Top
 Profile  
 
 Post subject:
PostPosted: July 21st, 2005, 4:43 pm 
Offline

Joined: November 28th, 2004, 6:05 am
Posts: 141
Location: USA
Hi eomc40

The code this.GetParent() is returning as it should

To get the name of the parent object, use this

this.GetParent().GetName()

HTH
Chris

_________________
Opus Resources and Services


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 21st, 2005, 4:47 pm 
Offline

Joined: November 11th, 2004, 1:43 pm
Posts: 172
Location: Buckinghamshire, UK
Thanks Chris,
Was not aware of that construct...


Top
 Profile  
 
 Post subject:
PostPosted: July 21st, 2005, 4:59 pm 
Offline

Joined: October 26th, 2004, 10:23 am
Posts: 666
Location: Digital Workshop
GetObject() returns a reference to the object - if you attempt to "print" a reference OpusScript is forced to do an implicit toString() call - which in most cases returns the class of the object.
To get the name of an object you need to call GetName(), as Chris has pointed out.
Adding some imaginary brackets can help clarify what is happening:

[this.GetParent()].GetName()

this.GetParent() gets a reference to the object, and then GetParent() is called on that reference to find the object's name.

_________________
ddww Opus Developer


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 21st, 2005, 5:09 pm 
Offline

Joined: November 11th, 2004, 1:43 pm
Posts: 172
Location: Buckinghamshire, UK
Duncan,
Going through the basic objects commands to see which does require GetName() to return the actual name as opposed to the object reference.

following requiring GetName() to return actual name
------------------------------------------------------------
GetParent()
GetChild()


The following commands returns a count value hence not affected.
------------------
GetNumberChildren()

Thanks..


Last edited by eomc40 on July 21st, 2005, 5:18 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: July 21st, 2005, 5:11 pm 
Offline

Joined: October 26th, 2004, 10:23 am
Posts: 666
Location: Digital Workshop
Sorry - not sure what you're trying to say.

_________________
ddww Opus Developer


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 21st, 2005, 5:23 pm 
Offline

Joined: November 11th, 2004, 1:43 pm
Posts: 172
Location: Buckinghamshire, UK
Duncan,
I have updated my post...


Top
 Profile  
 
 Post subject:
PostPosted: July 21st, 2005, 5:43 pm 
Offline

Joined: November 28th, 2004, 6:05 am
Posts: 141
Location: USA
GetParent()
GetChild()
GetNextChild()
GetFirstChild()
GetPage()

Require GetName()

Chris

_________________
Opus Resources and Services


Top
 Profile Visit website  
 
 Post subject: Opus 04.5
PostPosted: July 22nd, 2005, 9:46 am 
Offline

Joined: November 11th, 2004, 1:43 pm
Posts: 172
Location: Buckinghamshire, UK
Thanks All...
One more query on this...

I have a trigger action "Left Mouse Click" that has been associate/created for the page and objects within the page i.e. the buttons in the .imp file.

My initial assumption was that, the button will be the only item running actions based on the "Left Mouse Click" when clicked, but it does appear that the page action are also being run. Should this be happening?

With this trigger, I have tried to use trigger modifiers i.e. "shift", "Ctrl" and "Alt" which only works for objects and not the page itself. SHould I be able to use the Mouse click modifiers on the page itself?


Top
 Profile  
 
 Post subject:
PostPosted: July 22nd, 2005, 3:51 pm 
Offline

Joined: November 28th, 2004, 6:05 am
Posts: 141
Location: USA
Executing the page action when the button is clicked is normal
You can prevent this by setting the buttons Properties >> Gereral
to "Stop mouse clicks passing through"

Chris

_________________
Opus Resources and Services


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 7 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group