Solved

Accessing a child movie in Flash

Posted on 2002-06-18
5
236 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now