timescale of object

To get dt of instance, use
var dt = this.runtime.getDt(inst);

But only plugin which has "type" to "world" would have my_timescale property. So my_timescale need to be added manually for other case.
For example:
this.my_timescale = -1

Reorder z order of layer

Step1. Get layer
var layer = inst.layer;
or
var layer = (typeof layerparam == "number")?
            this.runtime.getLayerByNumber(layerparam):
            this.runtime.getLayerByName(layerparam);


Step2. Sort the list layer.instances
layer.instances(SORTFN);
for example
function sortInstanceByZIndex(a, b)
{

    return a.zindex - b.zindex;
}

Step3. reassign zindex of instances in this layer.
layer.zindices_stale = true;


Reference

Get timeline instance

instanceProto._timeline_get = function ()
{
    if (this.timeline != null)
        return this.timeline;

    assert2(cr.plugins_.Rex_TimeLine, "Scenario: Can not find timeline oject.");
    var plugins = this.runtime.types;
    var name, inst;
    for (name in plugins)
    {
        inst = plugins[name].instances[0];
        if (inst instanceof cr.plugins_.Rex_TimeLine.prototype.Instance)
        {
            this.timeline = inst;
            return this.timeline;
        }
    }
    assert2(this.timeline, "Scenario: Can not find timeline oject.");
    return null; 

};

Reference