Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 10:50 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Clone problem (or script problem) V6
PostPosted: February 23rd, 2010, 8:11 pm 
Offline

Joined: May 24th, 2005, 2:07 pm
Posts: 9
Location: Netherlands
Hi peeps,

I'm currently working on an interactive map. It takes coordinates from a database and displays dots on a map grid.

All of this works fine in setting the dots.... but i've hit a snag when i delete a record from the database. I'll have to find a way to destroy the cloned dot that represents that coordinate and more or less reset the whole shebang.

The dots on the map are clones that are selectable. If you select one, you can delete the associated record, update it... etc. But if you select one and you try to make it vanish, there is no way to get the DestroyClonedObject function to work. I' have a this.GetName on it and tried to make that work if it's written to a variable, and then make a script *var*.DestroyClonedObject. But it gives the following error:
Action (1, 0) : Function Not Found : Check spelling and capitalisation

Can anyone help me with this?

_________________
Opus 9.6 - Win7 pro - i7-970CXI - 8GB


For this message veragodspiel has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: February 23rd, 2010, 10:50 pm 
Offline

Joined: November 11th, 2004, 4:05 am
Posts: 636
Location: Christchurch, NZ
Look at this example to see one way of getting DestroyClonedObject to work....
I use an array to keep track of the cloned objects so I can delete them individually...

cheers
Paul


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


For this message Paul has been thanked by : mackavi


Last edited by Paul on February 24th, 2010, 7:13 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: February 23rd, 2010, 11:39 pm 
Offline

Joined: May 24th, 2005, 2:07 pm
Posts: 9
Location: Netherlands
Thanx Paul,

I think this could be usefull. I'm not that much of a scripter though. I might need some time to decypher this :)

_________________
Opus 9.6 - Win7 pro - i7-970CXI - 8GB


For this message veragodspiel has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: February 24th, 2010, 12:27 am 
Offline

Joined: May 24th, 2005, 2:07 pm
Posts: 9
Location: Netherlands
Thanx a million for the effort Paul, but I can't seem to make it work.

I've posted the program for as far as it's completed. There is still some testbutton and control variable in there. (I usually try to test things out before I implement them in the buttons :) )

Anyhow. The problem is: I read the database for coordinates, calculate the place where this shows on the map and then create a dot there. Every dot has a record in the DB and when one of these records is deleted, the associated dot should be destroyed to.

..... Wheeeeelp...... :D


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

_________________
Opus 9.6 - Win7 pro - i7-970CXI - 8GB


For this message veragodspiel has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: February 24th, 2010, 3:51 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
May I suggest you try to troubleshoot this using either Debug.trace() or force a launch of the debug pane and use the "watch" feature there. ('Watch' is a Tab in debug pane... Right Click and then set it to monitor several of your Publication and Page variables. The purpose is to see what is happening with your actions.

for the
Quote:
*var*.DestroyClonedObject
you want to confirm that that variable actually contains the ILM Object, and not just a textual name. Use the Debug.trace command. This has always been a tricky area for me. In some cases you can get to the Object directly. At other times (when I think I have the Object), I have just the name. In that case, you may have to construct a concatenating expression and then use eval() command. [continue here/link, or Search Forum: viewtopic.php?t=2102&highlight=clone+name ]

Rather than detail that here, please search the Forum for 'clone' AND 'name' (w/o quotes etc). There you will find not only explanation but downloadable examples... there are many variations in how to approach this (depending on your 'up-front' strategy in creating and naming the Clones).

I'd offer 'more', but I have limited experience in this area. Something I want to build upon, but not yet there.

Bottomline: the xxvarxx before the .DestroyClonedObject() needs to be an Object. Otherwise, the eval() command is often used to force this recognition. At other times, the keyword 'this' can be used to pick up the object itself and your variable may be able to carry it over as an object. (Whew! isn't that confusing? If I have not said it correctly, at least it may serve as a 'heads up' what to look for). Another way to think on it: if you have myVar02 = VectorDOT.CloneObject(x,y,vis) ... you are referencing the Object itself. If however you have set myVar02 = SomeObjectName ... you are only storing a text string/name. So this is another hint to 'capture' the Object_Clone at time of cloning and possibly even write that to the DB (??) (you will see examples of people here using Arrays to store "object").

Cheers,
Larry
ps. I viewed your Pub, but did not get too far. Mostly the DB path was not vaild for me and I did not want to hassle with managing an ODBC connection set-up etc etc. But from what I viewed, I think the above should help.

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


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: February 25th, 2010, 1:48 pm 
Offline

Joined: May 24th, 2005, 2:07 pm
Posts: 9
Location: Netherlands
hi Lar,

Thanx for the feedback. I've been working on it, but still it doesn't produce the results i'm after. For one or another reason the eval() function works a bit, but it does produce an error that i can't seem to get rid of.
It does the trick of deleting a dot, but when i load my dbase files, after it's done it gives an error. I think it wants to make another clone that has no coordinates. But even if i get the loop i built in to not even load all data from the db it still gives this error. (I used the city names from the database as naming for the clones.)
The debug.trace doesn't find anything wrong. And unfortunately i don't have the programming knowledge yet to work with arrays. I'm really a noob if it comes to scripting.
And last, but not least... When i publish the pub, my cities don't get the player colour when they get cloned. It works fine from a preview, but after compiling, they take the default as it is. All dots turn up red while the "clone template" does get the changes through. Very weird......

By the way.. to get the dbase to work, you just have to input the path. There's only 5 or 6 queries in the pub. And using the var. SYSTEM_PUBLICATION_DIR works like a peach to instantly get the path right.

_________________
Opus 9.6 - Win7 pro - i7-970CXI - 8GB


For this message veragodspiel has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: February 25th, 2010, 4:22 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
@Paul - wicked example. I've published as a screen saver and now have a spewing volcano of hot ships :-) Should that be chips?

@V - Using arrays is by far the most flexible method of working with clones and eliminates the need for eval. Your database records should have a UID which can be used as the array index thus tying a specific record to a specific clone.

Have a look at the function example on our site for some basic scripting including arrays:

http://www.live.interaktiv.co.uk/index. ... &Itemid=19

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 30 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