Skip navigation
Currently Being Moderated

Passing Variable to another Movieclip

Apr 19, 2012 1:16 PM

I have a movie clip that is tracking the horizontal location of the mouse. Id like to pass the location from the movieclip (track_mc)  to a text box on the parent movieclip. Any simple way to do that or am I going to need to dig and really learn about classes ;] ?

 
Replies
  • Currently Being Moderated
    Apr 19, 2012 1:35 PM   in reply to JonnyDL

    There are other ways to do it, but you should be able to something like so within your track_mc clip:

     

    parent.textBox.text = String(mouseX);

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 19, 2012 2:06 PM   in reply to JonnyDL

    Well, you don't actually have to cast parent to MovieClip - but you'd have to turn off strict mode, and that's not a good idea. You need to cast to MC, because the compiler only knows .parent as a DisplayObjectContainer

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points