Example
The following statement stores the normalized value of the vector MyVec in the variable Norm.
The value of Norm is vector (-0.1199, 0.9928, 0.0000) and the magnitude of Norm is 1.
MyVec = vector(-209.9019, 1737.5126, 0.0000)
Norm = MyVec.getNormalized()
put Norm
-- vector( -0.1199, 0.9928, 0.0000 )
put Norm.magnitude
-- 1.0000
See also
normalize
getNthFileNameInFolder()
Usage
getNthFileNameInFolder(folderPath, fileNumber)
Description
Movie method; returns a filename from the directory folder based on the specified path and
number within the folder. To be found by the
movies must be set to visible in the folder structure. (On the Macintosh, other types of files are
found whether they are visible or invisible.) If this function returns an empty string, you have
specified a number greater than the number of files in the folder.
The
getNthFileNameInFolder
To specify other folder names, use the
for the specific platform on which the movie is running. For example:
•
In Windows, use a directory path such as C:/Director/Movies.
•
On the Macintosh, use a pathname such as HardDisk:Director:Movies
Macintosh desktop, use the path HardDisk:Desktop Folder
•
This function is not available in Shockwave Player.
Parameters
Required. Specifies the path to the folder that contains the file.
folderPath
Required. Specifies the index position of the file in the folder.
fileNumber
Example
The following handler returns a list of filenames in the folder on the current path. To call the
function, use parentheses, as in
on currentFolder
fileList = [ ]
repeat with i = 1 to 100
n = getNthFileNameInFolder(the moviePath, i)
if n = EMPTY then exit repeat
fileList.append(n)
end repeat
return fileList
end currentFolder
See also
@
(pathname),
function doesn't work with URLs.
@ pathname
put currentFolder()
Movie
getNthFileNameInFolder
operator or the full path defined in the format
.
getNthFileNameInFolder()
function, Director
.
To look for files on the
337
Need help?
Do you have a question about the DIRECTOR MX 2004-DIRECTOR SCRIPTING and is the answer not in the manual?