# Accessing entities in an embeded MovieClip - Problems

**URL:** https://forum.kirupa.com/t/accessing-entities-in-an-embeded-movieclip-problems/268256
**Category:** flash
**Created:** [August 11, 2008, 11:01pm UTC](https://forum.kirupa.com/t/accessing-entities-in-an-embeded-movieclip-problems/268256 "2008-08-11T23:01:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![NateDog](https://avatars.discourse-cdn.com/v4/letter/n/91b2a8/32.png) [@NateDog](https://forum.kirupa.com/u/NateDog)
#### Post date: [August 11, 2008, 11:01pm UTC](https://forum.kirupa.com/t/accessing-entities-in-an-embeded-movieclip-problems/268256/1 "2008-08-11T23:01:01Z")

</div>

Hi.

I’m new to Flex and am trying to do simple experiments to make sure I’ll be comfortable making the switch from Flash to Flex for my next project.

I have many .fla’s for UI controls that I want to continue to use and so I want to make sure I can easily access and control the ui components in their .swf’s from flex. I don’t have code in these ui components, but I need to be able to do simple things like play, stop, modify properties, etc.

The following code works great when I want to access a MovieClip inside my .swf:

```auto

[Embed(source = "ui.swf", symbol = "uiobj")] var UIObj:Class;

var newObj:Sprite = new UIObj();

addChild(newObj);
            
var misc_mc:MovieClip = MovieClip(newObj.getChildByName("misc_mc"));

// now with misc_mc I can do stuff like set properties and call methods, etc.
misc_mc.width = 100;
misc_mc.gotoAndStop(100);

// THE PROBLEM ....
// When I have a text field as a child of the uiobj MovieClip, I can't seem to get a handle to it

var misc_txt:TextField = TextField(newObj.getChildByName("misc_txt"));

name_txt.width = 20;
name_txt.text = "Change the text";

// NOPE ... either line above fails

```

Anyone see what I’m doing wrong? Or anyone have a more simple way to get a handle to the textfield components inside an embedded .swf?

Thanks in advance!
