07.12.2012 Views

Adobe Director Basics

Adobe Director Basics

Adobe Director Basics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ADOBE DIRECTOR BASICS<br />

3D: Controlling appearance<br />

To access a particular group, you can use its name (Lingo only) or its index number.<br />

-- Lingo<br />

put member("3D").group[1]<br />

-- group("World")<br />

put member("3D").group(1)<br />

-- group("World")<br />

put member("3D").group("hug")<br />

-- group("Hug")<br />

// JavaScript<br />

trace(member("3D").getPropRef("group", 1));<br />

// <br />

If a group with the given name or index number does not exist, <strong>Director</strong> will return VOID (Lingo) or undefined<br />

(JavaScript); no error occurs.<br />

Creating a group<br />

Use the member3D.newGroup() function to create a new group with a given unique name.<br />

-- Lingo syntax<br />

vGroup = member("3D").newGroup("Musicians")<br />

put vGroup<br />

-- group("Musicians")<br />

// JavaScript<br />

vGroup = member("3D").newGroup("Musicians");<br />

<br />

Ensure that the name is unique, which means that the name is not already used by any other node (model, light, group<br />

or camera). If you try to create a new group with the same name as an existing node, a script error occurs: “Object with<br />

duplicate name already exists”.<br />

See “3D namespace” on page 85 for more details and a script that ensures that you have a unique name for the group<br />

that you are about to create.<br />

Deleting a group<br />

To delete a group, use the member3D.deleteGroup() function. You can identify the group either by its name or its<br />

index number. Deleting a group may change the index number of other groups. If you attempt to delete a non-existent<br />

group, no error occurs.<br />

-- Lingo syntax<br />

put member("3D").deleteGroup("Disbanded")<br />

-- 1<br />

put member("3D").deleteGroup("Disbanded")<br />

-- 0<br />

put member("3D").deleteGroup(2)<br />

-- 1<br />

// JavaScript syntax<br />

trace(member("3D").deleteGroup("Disbanded"));<br />

// 1<br />

member("3D").deleteGroup("Disbanded");<br />

0<br />

member("3D").deleteGroup(2);<br />

1<br />

Last updated 8/26/2011<br />

89

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!