Adobe 38039336 - Flash CS3 Professional User Manual page 506

User guide
Hide thumbs Also See for 38039336 - Flash CS3 Professional:
Table of Contents

Advertisement

// 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 can't use the
Instead, set the variable reference to
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
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.
statement to free memory that a local function variable uses.
delete
, which has the same effect as using
null
XML.load
.
delete
), the device's operating system may generate
FLASH CS3
500
User Guide

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash cs3 professional

Table of Contents