Guida di riferimento di ActionScript® 3.0 per la piattaforma Adobe® Flash®
Home  |  Nascondi elenco pacchetti e classi |  Pacchetti  |  Classi  |  Novità  |  Indice  |  Appendici  |  Perché in inglese?
Filtri: AIR 30.0 e versioni precedenti, Flash Player 30.0 e versioni precedenti, Flash Lite 4
Flex 4.6 e versioni precedenti, Flash Pro CS6 e versioni precedenti
Nascondi filtri
mx.charts.chartClasses 

InstanceCache  - AS3 Flex

Pacchettomx.charts.chartClasses
Classepublic class InstanceCache
EreditarietàInstanceCache Inheritance Object

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

InstanceCache is a utility that governs the task of creating and managing a set of n object instances, where n changes frequently.



Proprietà pubbliche
 ProprietàDefinito da
 Inheritedconstructor : Object
Un riferimento all'oggetto classe o alla funzione di costruzione per una determinata istanza di oggetto.
Object
  count : int
The number of items currently required in the cache.
InstanceCache
  creationCallback : Function
A callback invoked when new instances are created.
InstanceCache
  discard : Boolean = false
Determines if unneeded instances are discarded.
InstanceCache
  factory : IFactory
A factory that generates the type of object to cache.
InstanceCache
  format : flash.text:TextFormat
A TextFormat to apply to any instances created.
InstanceCache
  hide : Boolean = true
Determines if unneeded instances should be hidden.
InstanceCache
  insertPosition : int
[sola scrittura] The position of the instance in the parent's child list.
InstanceCache
  instances : Array
[sola lettura] The Array of cached instances.
InstanceCache
  properties : Object
A hashmap of properties to assign to new instances.
InstanceCache
  remove : Boolean = false
Determines if unneeded instances should be removed from their parent.
InstanceCache
Metodi pubblici
 MetodoDefinito da
  
InstanceCache(type:Object, parent:Object = null, insertPosition:int = -1, moduleFactory:IFlexModuleFactory = null)
Constructor.
InstanceCache
 Inherited
Indica se per un oggetto è definita una proprietà specifica.
Object
 Inherited
Indica se un'istanza della classe Object si trova nella catena di prototipi dell'oggetto specificato come parametro.
Object
 Inherited
Indica se la proprietà specificata esiste ed è enumerabile.
Object
 Inherited
Imposta la disponibilità di una proprietà dinamica per le operazioni cicliche.
Object
 Inherited
Restituisce la rappresentazione in formato stringa di questo oggetto, formattato in base alle convenzioni specifiche per le versioni localizzate.
Object
 Inherited
Restituisce la rappresentazione in formato stringa dell'oggetto specificato.
Object
 Inherited
Restituisce il valore di base dell'oggetto specificato.
Object
Descrizione delle proprietà

count

proprietà
count:int

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

The number of items currently required in the cache.



Implementazione
    public function get count():int
    public function set count(value:int):void

creationCallback

proprietà 
public var creationCallback:Function

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

A callback invoked when new instances are created. This callback has the following signature:

      function creationCallback(newInstance:Object, cache:InstanceCache):void;
      

discard

proprietà 
public var discard:Boolean = false

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

Determines if unneeded instances are discarded. If set to true, extra elements are discarded when the cache count is reduced. Otherwise, extra elements are kept in a separate cache and reused when the count is increased.

factory

proprietà 
factory:IFactory

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

A factory that generates the type of object to cache. Assigning to this discards all current instances and recreate new instances of the correct type.



Implementazione
    public function get factory():IFactory
    public function set factory(value:IFactory):void

format

proprietà 
format:flash.text:TextFormat

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

A TextFormat to apply to any instances created. If set, this format is applied as the current and default format for the contents of any instances created. This property is only relevant if the factory generates TextField instances.



Implementazione
    public function get format():flash.text:TextFormat
    public function set format(value:flash.text:TextFormat):void

hide

proprietà 
public var hide:Boolean = true

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

Determines if unneeded instances should be hidden. If true, the visible property is set to false on each extra element when the cache count is reduced, and set to true when the count is increased.

This property is only relevant when the factory generates DisplayObjects. Setting this property to true for other factory types generates a run-time error.

insertPosition

proprietà 
insertPosition:int  [sola scrittura]

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

The position of the instance in the parent's child list.



Implementazione
    public function set insertPosition(value:int):void

instances

proprietà 
instances:Array  [sola lettura]

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

The Array of cached instances. There may be more instances in this Array than currently requested. You should rely on the count property of the instance cache rather than the length of this Array.



Implementazione
    public function get instances():Array

properties

proprietà 
properties:Object

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

A hashmap of properties to assign to new instances. Each key/value pair in this hashmap is assigned to each new instance created. The property hashmap is assigned to any existing instances when set.

The values in the hashmap are not cloned; object values are shared by all instances.



Implementazione
    public function get properties():Object
    public function set properties(value:Object):void

remove

proprietà 
public var remove:Boolean = false

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

Determines if unneeded instances should be removed from their parent. If true, the removeChild() method is called on the parent for each extra element when the cache count is reduced.

This property is only relevant when the factory generates DisplayObjects. Setting this property to true for other factory types generates a run-time error.

Descrizione della funzione di costruzione

InstanceCache

()Funzione di costruzione
public function InstanceCache(type:Object, parent:Object = null, insertPosition:int = -1, moduleFactory:IFlexModuleFactory = null)

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

Constructor.

Parametri
type:Object — The type of object to construct. This can be either a Class or an IFactory.
 
parent:Object (default = null) — An optional DisplayObject to add new instances to.
 
insertPosition:int (default = -1) — Where in the parent's child list to insert instances. Set to -1 to add the children to the end of the child list.
 
moduleFactory:IFlexModuleFactory (default = null) — The context for using embedded fonts and for finding the style manager that controls the styles for this component.




[ X ]Perché in inglese?
Il contenuto della Guida di riferimento di ActionScript 3.0 appare in inglese

Non tutte le parti della Guida di riferimento di ActionScript 3.0 sono tradotte in tutte le lingue. Quando un elemento del linguaggio non è tradotto, viene riportato in inglese. Ad esempio, la classe ga.controls.HelpBox non è tradotta in nessuna lingua. Pertanto, nella versione italiana della guida di riferimento, la descrizione della classe ga.controls.HelpBox è riportata in inglese.