this.clonedel.register( this.mask , "on" + this._sizes[ this.axis ] ); this.clonedel.register( this.container , "on" + this.axis ); super.init(); newstart ) newstart = 0; var oldptr = 0; var oldlength = this.clones.length; var offset = newstart - this.clonesoffset; var remainder = ( newstart * this.replicatedsize ) + this.container[ this.axis ]; var newlength= Math.ceil( Math.min( (this.mask[ sizeAxis ] - remainder )/this.replicatedsize , this.container[ sizeAxis ] /this.replicatedsize ) ); //newstart is the new absolute lowerbound of the data window //newlength is the new length of the data window if ( newlength + newstart > this.nodes.length ) { newlength = this.nodes.length - newstart; } //no change if ( offset == 0 && newlength == oldlength ) return; //_root.lz.Instantiator.enableDataReplicationQueuing( ); var oldclones = this.clones; //TODO: instead of allocating a new array, use two arrays and //ping-pong this.clones = this.__emptyArray; for ( var i = 0 ; i < newlength; i++ ){ //before the new beginning var cl = null; if ( i + offset < 0 ){ //this comes before the old data window if ( newlength + offset < oldlength && oldlength > 0){ //pull the clone off the end cl = oldclones[ --oldlength ]; } else { cl = this.getClone(); } } else if ( i + offset >= oldlength ){ //this comes after the old data window if ( oldptr < offset && oldptr < oldlength ){ //pull the clone off the end cl = oldclones[ oldptr++ ]; } else { cl = this.getClone(); } } if ( cl ){ this.clones[ i ] = cl; var val = ( i + newstart ) * this.replicatedsize ; cl.setAttribute( this.axis , val); this.unbind( cl ); this.bind( cl, newstart + i ); } else { //otherwise, the oldclone and the newclone match this.clones[ i ] = oldclones[ i + offset ]; } } while ( oldptr < offset && oldptr < oldlength ){ var v = oldclones[ oldptr++ ]; this.poolClone( v ); } while ( oldlength > newlength + offset && oldlength > 0 ){ var v = oldclones[ --oldlength ]; this.poolClone( v ); } this.clonesoffset = newstart; while ( oldclones.length ) oldclones.pop(); this.__emptyArray = oldclones; //_root.lz.Instantiator.clearDataReplicationQueue( ); ]]> var cl = super.getClone(); cl.setOption( 'ignorelayout', true ); return cl; var c = this.getClone(); this.setAttribute( "replicatedsize", c[ this._sizes[ this.axis ] ] ); this.poolClone( c ); = 0 && off < this.clones.length ) return this.clones[ off ]; else return null; ]]> this.ensureInView( n ); return this.clones[ n-this.clonesoffset];