View Full Version : root syntaxes are driving me nuts!
screeg
July 20th, 2009, 03:06 PM
Okay, so far I've got MovieClip(root) to target an MC at the root, and Object(root) to target an Object at the root.
How do I target a function defined on the main timeline from the timeline of a movie clip?
BoppreH
July 20th, 2009, 03:11 PM
MovieClip(root) should work for all three cases.
MovieClip(root).myMc
MovieClip(root).myObject
MovieClip(root).myFunction()
screeg
July 20th, 2009, 03:22 PM
I see what the problem is now: The function required a parameter which didn't exist until a millisecond until after the MC loaded.
Thanks for the reply!
453.0
July 20th, 2009, 03:53 PM
Okay, so far I've got MovieClip(root) to target an MC at the root, and Object(root) to target an Object at the root.What you wrote here is not correct. You are not accessing an "MC" or "Object" by doing that. You are casting the "root" to a certain type. This is used to tell the player that root is of type X and is not a generic something. In many cases, you'll need to cast your data in order to avoid exceptions, using root is such a case.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.