This content has been marked as final. Show 2 replies
Hi Pat, and welcome to the list.
As for your question, I'd suggest you work with a single cast in general,
unless it really helps organizing your project.
Creating members on the fly -as it seems you are doing- is a much cleaner
Why don't you create a handler that would accept as arguments the formatting
options and the member they should be applied to?
Or e.g. two handlers that each would apply some fixed formatting to a member
that is passed to it.
The less the members, the smaller the project, btw.
> It could also be useful to do this since I could attach a behavior to the
> existing cast member
I suppose you are talking about cast member scripts, not behaviors. Another
thing you'd better avoid, since behaviors (scripts attached to sprites) are
more flexible, receive notifications that script members don't (like e.g. on
beginSprite), and are designed for oop (a reference to the script
object -me- is passed as the first argument by the system when calling
"PDiLalla" <firstname.lastname@example.org> wrote in message
> I need to create a dynamic menu for an application. Right now I am
> every item as a new cast member:
> newMember = new(#text)
> member(newMember).name = "Item1"
> member(newMember).text = "Blabla"
> What I would like to do, is have an existing cast member with the good
> font size, color, etc... and in my lingo script, create all my new cast
> based on the existing one, so I would only need to change the text it
> and not the color, size....
> It could also be usefull to do this since I could attach a behavior to the
> existing cast member and then all my new ones would have the same behavior
> attached to them.
> I hope this can be done, sorry if it is obvious, I'm in the process of
> learning Director and Lingo.
You can create a copy of an existing text member, and then set its text as follows:
vMemberNum = member("Existing Text Member Name").duplicate()
vNewMember = member(vMemberNum)
vNewMember.text = "New text"