• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Passing Variable to another Movieclip

Contributor ,
Apr 19, 2012 Apr 19, 2012

Copy link to clipboard

Copied

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 ;] ?

TOPICS
ActionScript

Views

945

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Apr 19, 2012 Apr 19, 2012

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);

Votes

Translate

Translate
Guest
Apr 19, 2012 Apr 19, 2012

Copy link to clipboard

Copied

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);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 19, 2012 Apr 19, 2012

Copy link to clipboard

Copied

Thanks! that worked

(I did need to use MovieClip(parent) instead of just parent for as3 if anyone else views this)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 19, 2012 Apr 19, 2012

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 19, 2012 Apr 19, 2012

Copy link to clipboard

Copied

You answered that so quickly it gave me an opportunity to experiment. I was trying to take it a step further now and trying to use similar logic to pass it just as a variable, (Learning more ticks) not into a text box, but a trace (in the parent MC). Not having any luck still experimenting. any suggestions?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 19, 2012 Apr 19, 2012

Copy link to clipboard

Copied

LATEST

Looking into it on some other web sites. I'm probably going to need global variables (hoping I could sneak around it. looks like I'm learning about classes ;]

Thanks again for the previous help

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines