MACROMEDIA FLASH 8-EXTENDING FLASH Manual page 352

Extending flash
Table of Contents

Advertisement

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
project.canPublishProject()
Availability
Flash 8.
Usage
project.canPublishProject()
Parameters
None.
352
Objects
,
ProjectItem object

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-EXTENDING FLASH and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash 8

Table of Contents