Duplicate an element on stage and position it next to the previous element


#1

Duplicate an element on stage and position it next to the previous element

Hi guys,

I’m trying to duplicate an element (like a simple square expanding) on stage and then set it to appear beside the previous element
I could do it in Flash but haven’t got a clue in Adobe Edge. It had to be done dynamically as each child will then produce another child, creating a tile pattern.

This is the code I was using in flash which was in the middle of a movieclip

for ( var k:uint = 0; k < 1; k++ )
{
var b:MovieClip = new gridsquares();
b.x = 90;
b.y = 0;
addChild(b);
}

Any ideas please…? I’m using Adobe Edge, but can enter the Javascript / jQuery code directly…


(Mark Hunte) #2

For javascript you need to look a cloning (cloneNode ) the element. You will then need to position it and set up any other properties.
You will not be able to duplicate it’s animations…

Also importantly you will need to remove the HYPE_element class from the cloned element or Hype will barf.