Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Accessing a child movie in Flash

Posted on 2002-06-18
5
Medium Priority
?
253 Views
Last Modified: 2010-04-03
Hi,

I have a Flash movie built using Flash MX (Windows version) that contains a blank movie clip called movStage.
When the parent movie is run it loads an SWF into this blank movie using the line:

loadMovie("myStage.swf", "movStage");

Inside the SWF I have a dynamic textfield called lblText. I want to be able to set the text on this textfield from the parent movie but I haven't been able to work out how this is done.
I tried using the following code:

movStage.lblText.text = "My text";

When I run a trace(movStage.lblText); I get 'undefined' as a result.

To further complicate the issue the child movie (movStage) has full access to the parent.
Knowing this I leave the child running in a loop constantly checking a variable in the parent movie and updating accordingly, but this option uses more processor time than is necessary.

If anyone has any ideas I'll be most grateful.

PyroMyst
0
Comment
Question by:pyromyst
  • 3
5 Comments
 
LVL 6

Expert Comment

by:rootdir
ID: 7090024
use following code

_parent.movStage.lblText.text = "My text";

or

_root.movStage.lblText.text = "My text";

or

_level0.movStage.lblText.text = "My text";

Give complete path from main movie. You will get what you are looking for. Still if you find diffculty send me your fla files and txt file, I will fix it for you. My email is rotdir@hotmail.com

Cheers
RootDir
0
 
LVL 1

Author Comment

by:pyromyst
ID: 7685949
I have requested that this question been deleted.

RootDir gave me a number of suggestions both here and via email.
However none of the suggestions helped me around my particular problem. I have yet to find the solution.

PyroMyst
0
 
LVL 6

Expert Comment

by:rootdir
ID: 7686449
Send me your fla files in zip format I will solve.

rotdir@hotmail.com

RootDir
0
 
LVL 6

Expert Comment

by:rootdir
ID: 7686455
Or post your email I will send example created for you.

RootDir
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 7737593
PAQ'd and 100 points refunded

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question