[mx] Path to dynamic textfield in loaded movie

I’m trying to access the dynamic textfield of a swf loaded into an empty movie clip created in the main timeline.

I understand how to manipulate a dynamic textfield in the main timeline, but trying to access the dynamic textfield of an external swf loaded into an empty movie clip results in failure. I guess I’m mainly having problems understanding the path structure involved.

createEmptyMovieClip(‘menu0’,1);
menu0.loadMovie(‘menubg.swf’);
menu0.kitten.text=“hello”; //where kitten is the instance name of the dynamic textfield in the external swf

Am I required to reference the created instance name? The instance name of the symbol that happens to contain the dynamic textfield of the external swf? Just the instance name of the textfield?

Some pointers would be appreciated.

If you loaded your external SWF on an empty movie clip you can access you dynamic textfield inside that SWF using the instance name of your empty movie clip. So basically it goes like this…

[name of your empty MC].menu0.kitten.text = “hello world!”;

This is assuming of course that the empty movie clip where you loaded your external SWF is in the _root timeline!

Hope this helps! Cheers!

:slight_smile:

[name of your empty MC].menu0.kitten.text = “hello world!”;

Isn’t the instance name of the empty movie clip already “menu0” ?
createEmptyMovieClip(‘menu0’,1);

Where is the “name of the empty MC” derived? The controling SWF, or the loaded SWF?

hmmm… yeah. Hey can you post your file so I can take a whack at it?

I was eventually able to get it to work by changing tacts – loading the swf from the internal library via attachMovie. Here’s the FLA.

It still seems like there should be a potential use for accessing the field in an external swf loaded via loadMovie. I’ve tried just about every path structure I can think of, but once the attachMovie technique started working – I kind of gave up.

Hey man that file didn’t open but i managed to make something similar to your problem. See attached.

Sorry about that i forgot to attach the file.

Thanks comicGeek! I took a look at your code to see what I was doing differently. Apparently, the creation of the empty clip and the loading of the movie can’t be encased within a function.

I reposted my FLA (MX Format) as a zip, so it might work for you now. Here’s the swf in case it doesn’t. http://www.howardesign.com/exp/mx/menu/

What I’m trying to do is iterate the emptymovieclip/load in a loop to create items in a dropdown menu. But that means the generation can’t be done upfront, given an unknown number of menu items (they’re being pulled from an array currently, but potentially from an XML File).

I’m glad to see that it is possible to load text into an external swf. I appreciate your help.