Copy link to clipboard
Copied
CP9
HTML5 only
My Question
How to I get the names of all the objects in a Group using Javascript.
(The Java will be used in an external library, not in the little window provided by captivate.)
Why I want this
I want to Hide/Show a Group using Java.
However, after reading the forum I am aware that this cannot be done using java.
But, a solution would be to individually Hide/Show each item in the Group.
If this was for a single Group I could hard code it, but it will be for many different Groups, so the Java will need to be flexible.
What I think I need
I think I need something like this, but I'm not sure of the syntax.
for x = each group('my_group_name').object {
cp.show(x);
next x
}
(As you can see, I doubt I will get a job programming at NASA!)
Thank you.
Peter
Copy link to clipboard
Copied
I have found this code in the forum.
I thought it would identify all objects on the slide with the word 'doctor' in their name, and then hide them, but it did not work.
Any help much appreciated.
var slideElems = e.Data.si;
for ( var i = 0; i < slideElems.length; i++ )
{
if ( cp.model.data[ slideElems[ i ].n ].mdi.indexOf( 'doctor' ) != -1 )
{
cp.hide(cp.model.data[ slideElems[ i ].n ].mdi)
}
}
Peter