DX Script : How to access variable of another object
Friday, October 21, 2005 by cyril_lemerle | Discussion: DesktopX Wishlist
I'm going through some issue while building independent objects. And my biggest issue is to access variable (public or not) defined in the script of an object from an external object.
For example:
I'm building a simple scrollbar where I defined a variable called "progress".
My variable is updated whenever onMove happens, blablabla ... Anyway...
How do I access this "progress" variable from another object ? (ie: vitesse parameter)
How do I do that with group ?
My progress bar is a group of 2 objects. How can I access the variable defined in the group and not defined in any specific object in the group ? This group is consistent entity that is a unique interface for a better modularity.
I didnt check the concept of controller.
Can a controller help me ? if yes, how does it work ?
Thanks
Cyril
Reply #2 Saturday, October 22, 2005 8:23 AM
like this: Public myVar
and then you'd be able to access it like DesktopX.ScriptObject("someObject").myVar
Reply #3 Saturday, October 22, 2005 9:47 AM
Reply #4 Sunday, October 23, 2005 6:29 AM
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Friday, October 21, 2005 7:53 PM
Anyway, if the variable is Dim-med outside of any subs in an object's script, then it can be accessed.
DesktopX.ScriptObject("TheObjectWhoseScriptDefinesTheVariable").variablename