352
Objects
Example
The following example illustrates several ways to use this command. In this case, the open
project file is in the c:\Projects directory, and the only files currently in the project have been
added at the root level.
// Get the project object
var myProject = fl.getProject();
// The following command creates a folder named "files" below the root level
in the project, and places myFile.fla in that folder.
var newFile = myProject.addFile("file:///C|Projects/files/myFile.fla",
true)
fl.trace(newFile.isMissing); // false
// The following two commands have the same effect: placing myFile_02.fla in
the root level of the project.
var newFile = myProject.addFile("file:///C|Projects/files/myFile_02.fla" ,
false)
var newFile = myProject.addFile("file:///C|Projects/files/myFile_02.fla")
fl.trace(newFile.isMissing); // false
// The following command places myFile_03 in the root level of the project
as a missing file.
var newFile = myProject.addFile("file:///C|myFile_03.fla")
fl.trace(newFile.isMissing); // true
The following example attempts to add a new file to the project, and displays a message in the
Output panel indicating whether the file was added.
var myProject = fl.getProject();
var newItem = myProject.addFile("file:///C|Projects/files/Integra.fla",
true);
fl.trace( "Item " + ( newItem ? "was" : "was not" ) + " added!" );
See also
fl.getProject()
,
project.items
,
ProjectItem object
project.canPublishProject()
Availability
Flash 8.
Usage
project.canPublishProject()
Parameters
None.
Summary of Contents for FLASH 8-EXTENDING FLASH
Page 1: ...Extending Flash...
Page 38: ...38 Top Level Functions and Methods...
Page 532: ...532 Objects...
Page 554: ...554 C Level Extensibility...