3.0 build 2039
MovieClip._draggable = Boolean
Boolean.
Property; SWF Studio-only. Provides a simple method for making your application window draggable. Setting this property to true means that when a user clicks and drags the movieclip they are actually dragging the entire application, not the movieclip.
The mouse events for any movieclips on top of the target movieclip (the one where this property is set to true) will continue to work. When the mouse is over a movieclip/button that has a mouse event (onPress, etc.) the application will not be draggable. This ensures that buttons and other movieclip functionality continue to work even if they are on top of the target movieclip.
Code that performed this functionality was posted in the Northcode forums for SWF Studio V2 as a replacement for drag regions.
Note: If you write an onRollOver and/or onRollOut function for your movieclip, make sure to set this property again.
myMovieClip._draggable = true;
3.0 build 2039
Object.copy()
None.
Object.
Method; use to make a copy of an object, not just a reference.
var originalObj = new Object(); originalObj.param1 = 'some text'; originalObj.param2 = 'blah'; var newObj = originalObj.copy(); trace(newObj.param1); // outputs: 'some text'
3.0 build 2039
Object.copyTo(ReceivingObject)
ReceivingObject - Object - The object to which the members of the original object are copied.
Object.
Method; use to copy members of an object to an existing object.
var myObj = new Object(); myObj.param1 = 'something'; var originalObj = new Object(); originalObj.param1 = 'some text'; originalObj.param2 = 'blah'; myObj.copyTo(originalObj); trace(originalObj.param1); // outputs: 'something'
3.0 build 2039
Object.isArray()
None.
Boolean.
Method; provides a simple way to test an unknown object to see if it's an Array rather than a generic object. The typeof Flash method will return 'object' for generic objects and arrays.
var myObj = new Object(); trace(typeof(myObj)); // outputs: 'object' trace(myObj.isArray()); // outputs: false var myArr = new Array(); trace(typeof(myArr)); // outputs: 'object' trace(myArr.isArray()); // outputs: true
3.0 build 2039
Array.copy()
None.
Array.
Method; use to make a copy of an array, not just a reference.
var myArr = new Array(); myArr[0] = 'item 0 of myArr'; var newArr = myArr; newArr[0] = 'item 0 of newArr'; trace(myArr[0]); // outputs: 'item 0 of newArr' trace(newArr[0]); // outputs: 'item 0 of newArr' // Instead, use the copy command. var myArr = new Array(); myArr[0] = 'item 0 of myArr'; var newArr = myArr.copy(); newArr[0] = 'item 0 of newArr'; trace(myArr[0]); // outputs: 'item 0 of myArr' trace(newArr[0]); // outputs: 'item 0 of newArr'
3.0 build 2039
String.parentPath([delimiter])
delimiter - String - Optional - Use to specify the delimiter in the path. The default is a backslash \.
String.
Method; returns a string that is the path of the parent folder. If you provide a folder path, without a filename and extension, the parent folder path of the folder specified is returned.
If you are providing a folder path, always specify the path without an ending \ (or specified delimiter) otherwise the returned path will simply be the same folder path without the ending delimiter.
var pathToSWF = 'C:\\Folder\\file.swf'; var folderSWFIsIn = pathToSWF.parentPath(); ssDebug.trace(folderSWFIsIn); // outputs: 'C:\\Folder'
var pathToFolder = 'C:\\Folder\\Child Folder'; var parentFolderPath = pathToFolder.parentPath(); ssDebug.trace(parentFolderPath); // outputs: 'C:\\Folder'
var pathToFolder = 'C:\\Folder\\Child Folder\\'; var parentFolderPath = pathToFolder.parentPath(); ssDebug.trace(parentFolderPath); // outputs: 'C:\\Folder\\Child Folder'
var pathToSWF = '/Folder/file.swf';
var folderSWFIsIn = pathToSWF.parentFolder('/');
ssDebug.trace(folderSWFIsIn); // outputs: '/Folder'
3.0 build 2039
String.parentFolder([delimiter])
delimiter - String - Optional - Use to specify the delimiter in the path. The default is a backslash \.
String.
Method; returns a string that is the name of the parent folder. If you provide a folder path, without a filename and extension, the parent folder name of the folder specified is returned.
If you are providing a folder path, always specify the path without an ending \ (or specified delimiter).
var pathToSWF = 'C:\\Folder\\file.swf'; var folderSWFIsIn = pathToSWF.parentFolder(); ssDebug.trace(folderSWFIsIn); // outputs: 'Folder'
var pathToFolder = 'C:\\Folder\\Child Folder'; var parentFolderName = pathToFolder.parentFolder(); ssDebug.trace(parentFolderName); // outputs: 'Folder'
var pathToFolder = 'C:\\Folder\\Child Folder\\'; var parentFolderName = pathToFolder.parentFolder(); ssDebug.trace(parentFolderName); // outputs: 'Child Folder'
var pathToSWF = '/Folder/file.swf';
var folderSWFIsIn = pathToSWF.parentFolder('/');
ssDebug.trace(folderSWFIsIn); // outputs: 'Folder'
3.0 build 2039
String.relativePath(dotDotSlash [, delimiter])
dotDotSlash - String - Specify the depth of the path to return. The value should consist of any number of "../".
delimiter - String - Optional - Use to specify the delimiter in the path. The default is a backslash \.
String.
Method; each ../ specified will go back one level in the path provided. This gives an easy way to return a folder path using ../ notation similar to URL paths.
// The SWF in _level0 has a URL of: 'C:\Folder1\Folder2\Folder3\file.swf'
var pathToSWF = _level0._url;
var projectFolderPath = pathToSWF.relativePath('../../');
ssDebug.trace(projectFolderPath); // outputs: 'C:\Folder1\Folder2'