Adobe Flash Professional CS3 Manual de usuario Pagina 506

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 527
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 505
FLASH CS3
User Guide
500
// First case: variable attached to a movie or
// movie clip timeline
//
// Create the Date object.
var mcDateObject = new Date();
// Returns the current date as a string.
trace(mcDateObject);
// Delete the object.
delete mcDateObject;
// Returns undefined.
trace(mcDateObject);
//
// Second case: global variable attached to a movie or
// movie clip timeline
//
// Create the Date object.
_global.gDateObject = new Date();
// Returns the current date as a string.
trace(_global.gDateObject);
// Delete the object.
delete _global.gDateObject;
// Returns undefined.
trace(_global.gDateObject);
As mentioned previously, you cant use the delete statement to free memory that a local function variable uses.
Instead, set the variable reference to
null, which has the same effect as using delete.
function func()
{
// Create the Date object.
var funcDateObject = new Date();
// Returns the current date as a string.
trace(funcDateObject);
// Delete has no effect.
delete funcDateObject;
// Still returns the current date.
trace(funcDateObject);
// Set the object reference to null.
funcDateObject = null;
// Returns null.
trace(funcDateObject);
}
// Call func() function.
func();
For more tips and techniques for creating content for mobile phones and devices, see
www.adobe.com/go/learn_cs_mobilewiki_en.
Loading data for mobile devices in Flash Lite
When developing files for mobile devices, minimize the amount of data you attempt to load at one time. If you are
loading external data into a Flash Lite file (for example, using
XML.load), the devices operating system may generate
a “memory failure” error if insufficient memory is allocated for the incoming data. This situation can occur even if
the total amount of remaining memory is sufficient.
Vista de pagina 505
1 2 ... 501 502 503 504 505 506 507 508 509 510 511 ... 526 527

Comentarios a estos manuales

Sin comentarios