EasyManua.ls Logo

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING - Page 388

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING
1130 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
388 Chapter 12: Methods
end if
return parsedList
end
// JavaScript syntax
function ConvertToList(xmlString) {
parserObject = new Xtra("xmlparser"); // check syntax
errorCode = parserObject.parseString(xmlString);
errorString = parserObject.getError();
if (voidP(errorString)) {
parsedList = parserObject.makeList();
} else {
alert("Sorry, there was an error" + errorString);
return false;
}
return parsedList;
}
See also
makeSubList()
makeScriptedSprite()
Usage
-- Lingo syntax
spriteChannelObjRef.makeScriptedSprite({memberObjRef, loc})
// JavaScript syntax
spriteChannelObjRef.makeScriptedSprite({memberObjRef, loc});
Description
Sprite Channel method; switches control of a sprite channel from the Score to script, and
optionally places a sprite from a specified cast member at a specified location on the Stage.
Call
removeScriptedSprite() to switch control of the sprite channel back to the Score.
Parameters
memberObjRef
Optional. A reference to the cast member from which a scripted sprite is created.
Providing only this parameter places the sprite in the center of the Stage.
loc Optional. A point that specifies the location on the Stage at which the scripted sprite
is placed.
Example
The following statement creates a scripted sprite in sprite channel 5 from the cast member named
kite, and places it at a specific point on the Stage:
-- Lingo syntax
channel(5).makeScriptedSprite(member("kite"), point(35, 70))
// JavaScript syntax
channel(5).makeScriptedSprite(member("kite"), point(35, 70));
See also
removeScriptedSprite(), Sprite Channel