Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently October 11th, 2024, 12:29 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Variable in SHOW and HIDE function
PostPosted: April 3rd, 2006, 3:24 pm 
Offline

Joined: November 22nd, 2004, 7:26 pm
Posts: 119
Location: Austria
Hi !
Can anyone help me out on this one ?
If I use a variable in a SHOW or HIDE function I get an error message : Object Not Found : The called object is not a valid object type (undefined? null?).

My script is like this :

var obj2=this.GetName();
Debug.trace(obj2);
obj2.Hide();



The Debug.trace command returns the correct name of the object, but it doesn't hide a line later. Is using variable possible for objects or am I missing something :?:

_________________
Klaus Rosmanitz
Austria


________
XP Home , Opus Pro 5.5


Top
 Profile  
 
 Post subject:
PostPosted: April 3rd, 2006, 5:04 pm 
Offline

Joined: October 25th, 2004, 12:32 pm
Posts: 397
Location: Digital Workshop
To Hide the current object you would use:

Code:
this.Hide();


All your script is doing is creating a string called obj2.

You are then trying to hide a string.

Hope this help

Brenden Knifton ddww


Top
 Profile Visit website  
 
 Post subject:
PostPosted: April 3rd, 2006, 5:33 pm 
Offline

Joined: November 22nd, 2004, 7:26 pm
Posts: 119
Location: Austria
Thanks for your quick reply Brenden !

I'm trying to create a small memory game. If you click on the first cover card the value 1 is added to the counter and the name of the object is written into the variable obj1 which I need to hide later on.

When the variable counter hits 2 the result is evaluated and if the cards are the same they stay open but if the cards don't match the two covers obj1 and obj2 will show again.

I've attached an imp so that you can see what I'm trying. I am not that good at scripting so if you could help me along on this I would be very grateful.


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

_________________
Klaus Rosmanitz
Austria


________
XP Home , Opus Pro 5.5


Top
 Profile  
 
 Post subject:
PostPosted: April 4th, 2006, 1:59 am 
Offline

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

the script you posted won't work because your asking it
to hide the string contained in the variable obj2

However if you store the object in obj2 like this, it will work

var obj2=this
Debug.trace(obj2)
obj2.Hide()

HTH
Chris

_________________
Opus Resources and Services


Top
 Profile Visit website  
 
 Post subject:
PostPosted: April 4th, 2006, 6:51 pm 
Offline

Joined: November 22nd, 2004, 7:26 pm
Posts: 119
Location: Austria
Thanks Chris!

I think that will help.

_________________
Klaus Rosmanitz
Austria


________
XP Home , Opus Pro 5.5


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 8 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