Be a Supporter!

AS2 getting a var from another clip

  • 312 Views
  • 2 Replies
New Topic Respond to this Topic
ronk
ronk
  • Member since: Dec. 23, 2007
  • Offline.
Forum Stats
Member
Level 13
Programmer
AS2 getting a var from another clip Oct. 16th, 2011 @ 08:52 PM Reply

im trying to set a variable in a movie clip, by pressing a button.
(calculator)
how would one change a variable from another movie clip?

K-Guare
K-Guare
  • Member since: May. 23, 2008
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
Response to AS2 getting a var from another clip Oct. 16th, 2011 @ 10:34 PM Reply

Say you have two objects on the stage named firstObj and secondObj.
And, say, that inside secondObj is a variable named magicWords
that for some god-forsaken reason you want to change.

Inside firstObj, the code would be:

_root.secondObj.magicWords = "pretty please";

May I just suggest, though, that this is a piece of delicious cake in AS3,
as it requires you to program from the top-level.

:3


what

BBS Signature
ronk
ronk
  • Member since: Dec. 23, 2007
  • Offline.
Forum Stats
Member
Level 13
Programmer
Response to AS2 getting a var from another clip Oct. 17th, 2011 @ 12:09 AM Reply

At 10/16/11 10:34 PM, K-Guare wrote: May I just suggest, though, that this is a piece of delicious cake in AS3,

thanks dude, big help

(i fucking love cake)