Ldoc+ Lingo Group:
[CAST] MEMBERsinfo D5/601: media of member rect of member 6 MANY elements new in Director 6.0, ! MANY contain Dictionary fixes 601 & 501, + MANY miss from the 'Appendix' 6.0 for CAST MEMBERS. Member Lingo (12): member nameOrNumber !+ member nameOrNumber of castLib nameOrNumber !+ member of sprite !+ memberNum of sprite 6 + mouseMember name of member ! number of member !+ number of members !+ number of members of castLib ! type of member + preLoadMember + unLoadMember General Member Properties (16): 6 + castLibNum of member (test only) height of member (test only) hilite of member (no effect, only #button) + loaded of member (test only) media of member + mediaReady of member (test only) name of member modified of member (test only) ! number of member (test only) + purgePriority of member rect of member (test only, set #field) regPoint of member (test only, set #bitmap) + scriptText of member (authoring <> runtime) + size of member (test only) ! type of member (test only, or: new(#type) ) + width of member (test only) -- 1. #bitmap Member Properties (6): depth of member (test only) fileName of member (takes URLs) palette of member paletteRef of member regPoint of member (settable) ! picture of member (settable) 2. #btned Button Editor Member Properties (4): 6 behavesLikeToggle of member 6 enabled of member 6 initialToggleState of member 6 labelString of member (test only) 3. #button Toolbox Member Properties (3): buttonType of member hilite of member text of member 4. #digitalVideo Member Properties (16): center of member controller of member crop of member 6 cuePointNames of member (QuickTime, test only) 6 cuePointTimes of member (QuickTime, test only) 6 digitalVideoType of member (test only) directToStage of member duration of member (test only) fileName of member (takes URLs) frameRate of member loop of member pausedAtStart of member preLoad of member sound of member timeScale of member (test only) video of member 5. #empty Member Properties (3): 6 castLibNum of member (test only) ! number of member (test only) type of member (test only: #empty) 6. #field Member Properties (21): alignment of member autoTab of member backColor of member border of member boxDropShadow of member boxType of member dropShadow of member editable of member ! font of member ! fontSize of member ! fontStyle of member ! foreColor of member lineCount of member (test only) lineHeight of member margin of member pageHeight of member (test only) ! picture of member (test only) rect of member (settable) scrollTop of member text of member wordWrap of member 7. #filmLoop Member Properties (2): loop of member sound of member 8. #movie Member Properties (6): border of member center of member fileName of member (takes URLs) loop of member scriptsEnabled of member sound of member 9. #ole Member Properties (?): ... 10. #palette Member Properties (?): 11. #picture Member Properties (?): ... 12. #richText Member Properties (3): ! picture of member (test only) scrollTop of member text of member (authoring only) 13. #script Member Properties (2): scriptText of member (authoring <> runtime) scriptType of member 14. #shape Member Properties (4): filled of member lineSize of member pattern of member shapeType of member 15. #sound AIFF & WAVE Properties (8): channelCount of member (test only) 6 cuePointNames of member (AIFF, test only) 6 cuePointTimes of member (AIFF, test only) duration of member (test only) fileName of member (takes URLs) loop of member sampleRate of member (test only) sampleSize of member (test only) 16. #SWA Shockwave Audio Properties (16): 6 bitsPerSample of member (test only) 6 bitRate of member (test only) 6 cuePointNames of member (test only) 6 cuePointTimes of member (test only) 6 copyrightInfo of member (test only) 6 duration of member (test only) 6 numChannels of member (test only) 6 percentPlayed of member (test only) 6 percentStreamed of member (test only) 6 preLoadTime of member 6 sampleRate of member (test only) 6 soundChannel of member 6 state of member (test only) 6 streamName of member (takes URLs) 6 URL of member (takes URLs) 6 volume of member 17. #transition Member Properties (4): changeArea of member chunkSize of member duration of member (settable) transitionType of member -- Member Editing & Saving (27): + fileName of castLib (takes URLs) + name of castLib (internal name) fileName of member (takes URLs) media of member modified of member (test only) picture of member (#field,#richText, set #bitmap) palette of member (#bitmap) paletteRef of member (#bitmap) rect of member (test only, set #field) regPoint of member (test only, set #bitmap) + text of member (#field, #button) + ...plus many #field member and CHUNK properties! 6 URL of member (#SWA) + copyToClipBoard(member) dublicate(member) erase(member) + findEmpty(member) + ilk(x) = #media, ilk(x) = #member, ilk(x, #picture) importFileInto(member) (takes URLs) + move(member) new(#memberType) + pasteClipBoardInto(member) + pictureP() save castLib + saveMovie + score !+ updateMovieEnabled -- New MEMBER Lingo (10): 4 A11 -> member nameOrNumber 5 cast -> member 5 castmembers -> number of members 5 castType of cast -> type of member 5 number of castmembers -> number of members 5 preLoadCast -> preLoadMember 5 unLoadCast -> unLoadMember 6 cast of sprite -> member of sprite 6 castNum of sprite -> member/memberNum of sprite 6 mouseCast -> mouseMember
[index] _ 601 in 1/97:
media of member
member content pointer property
1. TIP: You can test AND set the 'media of member', it returns the address of the pointer to the content of the member in RAM in the form of an object expression: '(media 95b32a)'. It tests TRUE on 'ilk(mediaExpression) = #media', or 'string(mediaExpression) contains "media" '.
2. TIP: All castMembers have their 'media' (as opposed to the 'picture of member'), even if they are empty slots (up to the last member in a castLib). By setting the media of an empty cast slot to another 'media', you can create a new castMember.
3. TIP: No stage update or puppet is needed when changing the 'media of member', because all SPRITE appearances of that MEMBER in your movie update immediately and persistently, and you CANNOT use a transition effect for the change. But all 'media' changes to a member will be saved with your movie, unless you reset them manually or in your 'on stopMovie' handler.
4. TIP: You can store the 'media of member' into a variable (and multiple 'media' into a list), and test 'if ilk(aVariable) = #media'. But you CANNOT compare the variable with the 'media of member' of the original member you put into it. Handle with care, it's like with objects: copies of 'media', picture', child objects and other objects are neither equal nor different to each other. Testing 'objectCopy1 = objectCopy2' results in FALSE, but so does 'objectCopy1 <> objectCopy2'.
5. TIP: To reset a changed castMember to its original 'media', you need to first save into a global variable the 'media of member' of a castMember that you're going to change, or have a second copy at hand.
6. TIP: Use the 'ilk()' function to test if 'the media of member' or a variable contains a valid 'media': 'if (ilk(x) = #media) then...'.
7. TIP: The 'media' of a member includes its registration point, so when you set a member to another member's media, it will possibly acquire a different 'regPoint'.
8. TIP: Remember: All 'media' copies that a member has ever used, will stay in RAM, unless you find a way to unLoad them.
9. TIP: You can store 'the media of member' (as well as 'the picture of member') into a global variable, it takes the form of '(media 91800e)' and can be tested with 'objectP()'. Later on you can use the 'media' in that variable on the stage of a different movie than the one that originally had the castMember. By using this technique, you can create child objects that carry along their own media in their internal properties... ;)
10. TIP: 3/97: Tyson Norris from Macromedia Tech Support on differences between the 'media of member' and the 'picture of member': "...would suggest that the 'media' is a static location in the file (in memory?) that a cast member looks to find what to display (maybe like a pointer to a pointer). The 'picture', on the other hand is the dynamic location where that media actually lives, which can change (the pointer pointed to by the 'media')."
11. TIP: See 'picture of member'.
EXAMPLEs:
put the media of member 122 -- -- (media 91800e) set x = the media of member 122 put x -- (media c39c60) put ilk(x) -- #media put (ilk(x) = #media) -- 1 -- put (x = the media of member 122) -- 0 put (x <> the media of member 122) -- 0 put (x < the media of member 122) -- 0 put (x > the media of member 122) -- 0 -- set the media of member 5 = x put the media of member 5 -- -- (media 218c39 put objectP(x) -- 1
[index] _ 601 in 1/97:
modified of member
member changing property
TIP: The 'modified of member' can be tested, but NOT set, and its default setting is FALSE. The 'modified of member' property indicates if a castMember has been modified (changed, edited) from its original state.
[index] _ 601 in 1/97:
name of member
member string property
TIP: In earlier versions of Director the 'name of cast' property was 0 for a member without a name, or for an empty castMember slot before the last member. In Director 5, 'the name of member castMemberNumber' returns an EMPTY string ("") for a member without a name or an empty castMember slot before the last member in a 'castLib'. It produces a 'Script error: Error' if you test an empty castMember slot number behind the last member in a castLib. To avoid this, first get 'the number of members of castLib castLibNameOrNumber'.
[index] _ D5/601 _ 971212:
new(#memberType)
member creating command
6.0 Dictionary Errors, partly the same in 5.0:
"...specify the cast member slot and Cast window where the new..." = Should read: "...specify the castMember slot number and CASTLIB where the new..." ...I'd suggest using the term 'castLib' instead of 'cast' throughout the docs! "...the first empty slot is used." = Missing: "...the first empty slot in 'the activeCastLib' or the first internal castLib is used." = Missing: "The 'new(#memberType)' function returns the member ID of the newly created castMember, in the form of '(member x of castLib y)'. = Missing: "See Also: ... copyToClipBoard(member), dublicate(member), erase(member), findEmpty(member), importFileInto(member), move(member), pasteClipBoardInto(member), save castLib, saveMovie, updateMovieEnabled." --TIP: If you call 'new(#memberType)' from inside a child object's handler, it will NOT call Director's 'new()' function, but will call the parent script's 'on new me' handler instead. To avoid this, either call a handler in a global movieScript which will then issue the 'new(#memberType)' command, or rename the 'on new me' handler in the parent script to 'on birth me' (like in Director 3), and create the child object by calling that handler: 'set x = birth(script parentScriptNameOrNumber)'. Actually, you can use any name you want for the birthing handler, as long as it returns the 'me' parameter (the scripts ID) to the caller...
[index] _ 601 in 1/97:
number of member
castMember property
5.0 Dictionary Errors:
a) The Dictionary's example uses 'set the memberNum of sprite 1 to the number of member...'
Should read: 'set the MEMBER of sprite 1 = member...', as is mentioned in the '501 ReadMe' and Macromedia TechNote TN#3184 'Member vs. MemberNum' (see member of sprite' and 'memberNum of sprite').
b) The Dictionary: "When 'whichcastMember' is an integer..."
Should read: "The parameter 'whichcastMember' must be a castMember's name." If you use integer numbers, you don't get a useful result, try: 'put the number of member 884735 -- 884735', and add one more: 'put the number of member 884736 -- -32768'.
c) The Dictionary lists this property in the wrong order: It belongs to be listed after the doc entry 'the number of lines in'.
d) The Dictionary forgets to mention that this property reports -1 if the member by the given name does NOT exist.
1. TIP: Instead of an integer, you can 'put the number of (member 2 of castLib 6) -- 393218', which will give you the overall number of that member -- if it exists, otherwise you'll get an alert 'Script error: Error' alert!
2. TIP: You can use 'the number of cast memberName' (earlier Lingo version) for 'the number of member memberName'.
3. TIP: It is a good habbit to address castMembers by 'the number of member', which internally works with an overall integer number of the member, because the other plain property 'member' will return an object expression of '(member x of castLib y)', which is not compatible with all according Lingo commands.
[index] _ 601 in 1/97:
picture of member
graphic member content pointer property
5.0 Dictionary Errors:
a) The Dictionary's example will NOT work: it has the words 'member' missing twice.
Should read: 'set the picture of MEMBER whichcastMember = the picture of MEMBER whichcastMember'.
b) "See Also" mentions 'the type of sprite property', but what does a sprite have to do with the 'picture of member', except displaying it on stage? I guess, if the type of the 'picture of member' changes (e.g. from bitmap to rich text), the 'type of sprite' will too. But then again, according to the Dictionary the different types of sprites are no longer used in Director 5 Lingo, only during score recording to delete an existing sprite by setting its 'type of sprite = 0' (see 'type of sprite').
1. TIP: You can test AND set 'the picture of member' of a graphical member like bitmap, pict, field, richText, shape or button, film loop, digital video, or even a movie member; it returns a pointer to the address in RAM of the picture of the member in the form of an object string: '<Picture:c39c4c>'. It is similar to the 'media of member' property: '(media 95aa2e)', but which works for ALL castMembers, even if they are empty (see 'media').
2. TIP: No stage update or puppet is needed when changing 'the picture' of a graphic castMember, because all SPRITE appearances of that MEMBER in your movie update immediately and persistently, and you CANNOT use a transition effect for the change. But all 'picture' changes to a member will be saved with your movie, unless you reset them manually or in your 'on stopMovie' handler.
3. TIP: You can store 'the picture of member' into a variable (and multiple 'pictures' into a list), but you CANNOT compare the variable with 'the picture' of the member you put into it. Handle with care; it's like with objects: copies of 'media', picture', child objects and other objects are neither equal to nor different from each other. Testing 'objectCopy1 = objectCopy2' results in FALSE, but so does 'objectCopy1 <> objectCopy2'.
4. TIP: To reset a changed castMember to its original 'picture', you need to first save into a global variable 'the picture of member' of a castMember that you're going to change, or have a second copy at hand.
5. TIP: You can test if something is a 'picture' with 'pictureP(x)' or 'ilk(x, #picture)', but that produces an error alert if you test a castMember that has no picture. For a workaround, see 'pictureP()'.
6. TIP: The 'picture' of a graphic member includes its registration point, so when you set a member to another member's picture, it will possibly acquire a different 'regPoint'.
7. TIP: Remember: All picture copies that a member has ever used will stay in RAM, unless you find a way to unLoad them... ;)
8. TIP: You can store 'the picture of member' (as well as 'the media of member') into a global variable; it takes the form of '<Picture:b5a8f2>' and can be tested with 'pictureP()'. Later on you can use the 'picture' in that variable on the stage of a different movie than the one that originally had the picture castMember. To do this you'll have to set a castMember of the current movie to the variable that contains the 'picture' or 'media' of the old movie. By using this technique, you can create child objects that carry along their own pictures in their internal properties... ;)
9. TIP: Daniel Devolder (Barcelona) came up with the following possibility to change a field or a richText into a bitmap, works in author-time and run-time: 'set the picture of member aBitMap = the picture of member aTextField/aRichText'.
10. TIP: See 'the media of member'.
EXAMPLEs:
The following works for all graphical members:
set x = the picture of member 122 put x -- <Picture:c39c4c> put pictureP(x) -- 1 put ilk(x) -- #picture put ilk(x, #picture) -- 1 put (ilk(x) = #picture) -- 1If you have a project with different movies, where each one is supposed to show the same background, but you want to change that background across all movies with Lingo during run-time, then use the 'media of member' or 'picture of member' property to do that: Put the identical 'shared' background member from an external linked castLib into all movie scores. Then by assigning this 'shared member' a new picture, all movies will show the new background when playing. Remember: you CANNOT reset the picture of the 'shared' member to its original, unless you have it in a variable or a copy of it, and every new picture change will chew up RAM. Given your overall background member is named 'Shared Backgr', then:
set the picture of member 'Shared Backgr' = the picture of member 'Backgr.23' -- --> ...now it changed to a different picture on stage. --> To have it fixed, possibly use the updating of the member's --> new picture which is mentioned in the Dictionary: -- set the picture of member 'Shared Backgr' = the picture of member 'Shared Backgr'
[index] _ D5/601 _ 970726:
rect of member
graphic member size property
6.0 Dictionary Errors:
a) "The 'rect of member' property can be tested and set."
...should read:
"The 'rect of member' property can be tested, and set only for fixed or scrolling #field members." I can't get it to work with bitmaps on Win95 (produces error alerts), and so will the Dictionary's example 2 NOT work. Then "See Also" should also mention 'field'. I will have to further investigate this in 6.0, like: Registration points move? Possible to set a member rect(100,150,300,400)? Move masks? Stretch vectors? Fit #field members into rect(-1,-1,0,0)? Two in one? Stuff like that... ;)b) The Dictionary: "...differs from Director 5, which returned a rect whose registration point was at (0,0)." What's this about? More work! Anyway:
Remember the '501 ReadMe':
The 'rect of member' property of a bitmap, a pict, a field, a richText, a shape or button, a film loop, a digital video, or even for a movie member starts with position (0,0) at the left top corner of the graphic member's bounding rectangle. This used to be different in Director 4, where the starting position (0,0) of 'the rect of cast' was in the left top corner of the Paint window easle.
1. TIP: The 'rect of member' of non-graphical castMembers is 'rect(0,0,0,0)'. You can test if a member has a 'picture' with 'if NOT (the rect of member x = rect(0,0,0,0) )', because using 'if pictureP(the picture of member x)' will produce an error alert if the tested member has no picture property. An empty member slot BEFORE the last member in a castLib might return a 'rect of member x = rect(0,0,0,0)', or strange values, like 'rect(373, -29664, 180, 22346)'. Testing the 'rect of member' of an empty member slot AFTER 'the number of members of castLib' produces an error alert.
2. TIP: You can (only) test the 4 values of a member's graphic bounding box rectangle like 'rect(0,0,32,32)' by using 'the left/top/right/bottom of the rect of member x', and also test 'the height/width of the rect of member x'; or use a variable as shortcut: 'set oldRect = the rect of member x .. put the left of oldRect .. set newRect = oldRect + rect(0,0,+2,+2)'.
3. TIP: You CAN set 'the rect of member' of a field castMember to adjust its size on stage instantly and persistently, without its sprite being a 'puppet'. So it's possible to change the width and the height of a (fixed size) #field castMember with: 'set the rect of member "myField" = rect(l,t,r,b)'. But this technique is said to not be reliable on all platforms; problems also with scrolling fields; and Macromedia Tech Support comments on this with a warning that it works but might not be stabil, and might not work in future versions of Director. On the other side: With #field castMembers, you CANNOT set 'the rect of sprite', which will only change if you change 'the rect' of its #field castMember...
4. TIP: For EXAMPLEs, see 'picture of member' and 'rect()'.
[index] _ D5/601 _ 971201:
shapeType of member
shape member type property
6.0 Dictionary Errors, partly the same in 5.0:
- 1. The Dictionary misses the standard, but basic statement:
- " This property can be tested and set, and its default for a newly created shape castMember is #rect. "
- 2. The Dictionary misses a distinction:
- " The possible types #rect and #roundRect differ from Director's Shape Cast Members Properties dialog box, where these two settings are named 'Rectangle' and 'Round Rect'. "
- 3. Error in the Example:
- ' set shapeType of member 100 = #oval '
...small typo, and better avoid absolute member numbers:
' set THE shapeType of member "shapeMemberName" = #oval '
...also it's not a good habit to use absolute castMember numbers (100) instead of their name!
1. TIP: Beware of using absolute member numbers, better to adress castMembers by their name 'member "memberName" ', or use the 'number of member', because during authoring, castMembers might be moved around in their 'castLib' or even between different castLibs.
2. TIP: Up to Director 3.0, castMember numbers were expressed hexadecimal, starting with 'A11' as the first castMember in the one and only internal castLib; remember this when converting old Director files. Always use 'Update Movies...' to externally convert old Director movies through each higher version before finally updating them to Director 6.01 and after that opening them: 3.0 -> 4.04 -> 5.01 -> 6.01...
[index] _ D5/601 _ 971206:
type of member
member validation property
- 6.0 Dictionary Error, same in 5.0
- " The 'type of member'...can be tested but not set "
...might add:
" ...except when using 'new(#memberType)' "
Missing types: #btned for Button Editor (xtra) castMembers, #SWA for Shockwave Audio. The 5.0 Dictionary also misses #empty and #ole.
- From the '501 ReadMe':
- For movies created in Director 5, the 'type of member' returns #field for fields, and #richText for richText members. However, fields originally created in Director 4 still return #text for their 'type of member'. Take this into consideration when working with updated Director 4 movies.
TIP: The 'type of member' is indicated by a symbol (like #bitmap), the 'type of sprite' is indicated by an integer number between 0 (no sprite member) and 16 (some other type). If you test 'the type of member nameOrNumber [of castLib libNameOrNumber]', and there's no member with the given name or number, its type will return #empty. All 16 possible 'type of member' symbols are listed in the top [index]...
EXAMPLEs:
put the type of member "MyField" -- #field put the type of member "myRichText" -- #richtext put the type of member "A field created in 4.04" -- #text put the type of member 32000 -- #empty put (the type of member 32000 = #empty) -- 1
|