View Full Version : Calling code to instances

01 January 2004, 07:12 AM
Hey all, I've got a large segment of code, that is currently on many instances. Is there a way I can have all the code stored in say, a keyframe, and then call it from the instance? like say 'call movement()' or something like that? is that the function thing?! i really dont know how to apply it. can someone help me?

many thanks!!

Ian Jones
01 January 2004, 01:46 PM
certainly is a good use for functions or perhaps even classes. Check for more info.

01 January 2004, 04:30 PM
The way I usually set it up is as such - in your main timeline (usually frame 1), create the function that includes the code you need to run from each instance. On each instance, use a "_root.function(variable);" call. This will direct the code to look in the main timeline for the "function" function and pass it the "variable" variable, if necessary. And, to second Ian Jones's thought - hit It rocks over there, what with the snippets and tuts and forums.


CGTalk Moderation
01 January 2006, 05:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.