Sorry for reviving this topic, but yes, there’s a way to do this that I just realized!
To start with, you can have two frames for instance. Both in the same layer, and the first frame is empty, while the second frame has objects.
Just like how project.activeFrame
refers to the active frame, project.activeLayer
refers to the active layer.
So, project.activeLayer.frames
gave me an array of all the frames in the active layer.
I was able to refer to the children in frame 2 using this array:
project.activeLayer.frames[1]._children
// Note: The first object in an array is numbered 0,
// so frames[1] would be frame 2
Now with the code above, you should have an array of the children in frame 2 without needing to be in frame 2.
All you have to do now is move the object from the array of objects from the other frame to the current frames children array.
project.activeLayer.frames[0]._children.push(project.activeLayer.frames[1]._children[0]);
Use the function, “addClip()
,” instead of “push()
”
project.activeFrame.addClip(project.activeLayer.frames[1]._children[0]);
Hopefully this helps with reducing lag