Cloning/duplicate action

For the 'Journal' sample I needed dynamic elements. For example.. the list of avatars on the right ... no fixed order, no fixed number, so I needed to build that dynamically depending on users choices.

In javascript I now fixed that by using 'clone/cloneNode' to duplicate the needed elements.

In the ancient past in Actionscript you could use duplicateMovieclip to copy a MC and all of its contents.

With clone I can do the same in JS, but I do need to get all elements separately and construct it the way I want.

Would it not be nice if I could define a 'group' inside Lectora and have a Action 'duplicateGroup' ?

Further there is a small bug in Lectora when using this like described above. An image in Lectora with a name with a capital in it... myImage.png will be renamed when published and zipped to myimage.png

Breaking the dynamic setup because when you call myImage.png in your code..it wont find it. No biggie, but good to know...

Discussion (2)

As you mentioned you can do this with clone(). I am curious as to what you would use something like this for in a lesson. Wouldn't it be easier to have all necessary copies made and initially hidden? Why would you want to add something to the DOM at runtime?

To do something like this:

http://community.trivantis.com/shared-content/online-journal-proof-of-concept-v2/

Diving in this technique more now.. imaging multi-user applications and games... ;-)

Discussions have been disabled for this post