# createEmptyMovieClip + alpha?

**URL:** https://forum.kirupa.com/t/createemptymovieclip-alpha/61686
**Category:** Uncategorized
**Created:** [August 20, 2004, 4:21pm UTC](https://forum.kirupa.com/t/createemptymovieclip-alpha/61686 "2004-08-20T16:21:12Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Ferdi](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ferdi/32/689_2.png) [@Ferdi](https://forum.kirupa.com/u/Ferdi)
#### Post date: [August 20, 2004, 4:21pm UTC](https://forum.kirupa.com/t/createemptymovieclip-alpha/61686/1 "2004-08-20T16:21:12Z")

</div>

Hey people!  
I’ve searched quite some forums and browsed a lot of pages but I can’t figure out what I’m doing wrong here.

I want to create a new MC with a textfield inside. Once created I want the text to fade out with the use of MC.\_alpha–;

The problem is that I can’t figure out how to set the alpha of either the MC or the textfield inside of it.

The textfield uses an embedded font as some pages recommended, but it doesn’t matter if I embed it or not, it just doesn’t work.

This is the script I wrote:

```auto
_root.createEmptyMovieClip("clip",1);
_root.clip.createTextField("sText",2,20,20,150,30);
 
newFont = new TextFormat();
newFont.embedFonts = true;
newFont.font = "Font 1";
newFont.textColor = 0xFFFFFF;
 
_root.clip.sText.setTextFormat(newFont)
_root.clip.sText.text="test";
_root.clip.sText._alpha = 50;
_root.clip._alpha=50;

```

ANY help would be very much appreciated!!  
Thanks in advance!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 20, 2004, 4:50pm UTC](https://forum.kirupa.com/t/createemptymovieclip-alpha/61686/2 "2004-08-20T16:50:27Z")

</div>

for 1, embedFonts is a property of a textField, not a textFormat. So that would need to go on \_root.clip.sText. Same applies to textColor, though textFormats do have their own color property, its just color though, not textColor:

newFont.color = 0xFFFFFF

Also, when using a font, you should name it by its actual font name, and not by its symbol name which I assume you’re doing with “Font 1” ? And if you don’t have a symbol, make one, a font symbol that represents the font you want to use. Furthermore, since you’re using actionscript to define this text, you would want to change the linkage properties of the font symbol so that it is exported for actionscript and within the first frame. This way, Flash will know enough to use it with your dynamically created textfield.

Put that all together and your text should fade fine.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 20, 2004, 7:44pm UTC](https://forum.kirupa.com/t/createemptymovieclip-alpha/61686/3 "2004-08-20T19:44:36Z")

</div>

Thanks, Senocular, but it still doesn’t work.

I did exactly what you described. Everything works except for the alpha. I think it has something to do with the fact that the textfield is a dynamic field when using the createTextField() command. Cause the fact is that it does work on static textfields. So is there maybe a possibility to convert the dynamic textfield to a static textfield through actionscript?

My script is as follows:

```auto
_root.createEmptyMovieClip("clip",1);
_root.clip.createTextField("sText",2,20,20,150,30);
_root.clip.sText.text = "yooo";
_root.clip.sText.textColor = 0x000000;
_root.clip.embedFonts = true;
 
newFont = new TextFormat();
newFont.font = "verdana";
_root.clip.sText.setTextFormat(newFont);
 
_root.clip.sText._alpha = 50;
_root.clip._alpha = 50;

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 20, 2004, 9:38pm UTC](https://forum.kirupa.com/t/createemptymovieclip-alpha/61686/4 "2004-08-20T21:38:42Z")

</div>

ok now you’re using embed fonts on the movieclip

THE TEXTFIELD I SAY, THE TEXTFIELD!

🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 20, 2004, 9:46pm UTC](https://forum.kirupa.com/t/createemptymovieclip-alpha/61686/5 "2004-08-20T21:46:27Z")

</div>

Sorry, that went wrong with pasting and retyped it wrong :s  
Anyway, with \_root.clip.sText.embedFonts = true; it won’t work either 😉

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 20, 2004, 9:48pm UTC](https://forum.kirupa.com/t/createemptymovieclip-alpha/61686/6 "2004-08-20T21:48:24Z")

</div>

are you sure you exported the font in the library?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 21, 2004, 12:49pm UTC](https://forum.kirupa.com/t/createemptymovieclip-alpha/61686/7 "2004-08-21T12:49:54Z")

</div>

> [@Ferdi](#):
>
> Hey people!  
> I’ve searched quite some forums and browsed a lot of pages but I can’t figure out what I’m doing wrong here.
> 
> I want to create a new MC with a textfield inside. Once created I want the text to fade out with the use of MC.\_alpha–;
> 
> The problem is that I can’t figure out how to set the alpha of either the MC or the textfield inside of it.
> 
> The textfield uses an embedded font as some pages recommended, but it doesn’t matter if I embed it or not, it just doesn’t work.
> 
> This is the script I wrote:
> 
> ```auto
> _root.createEmptyMovieClip("clip",1);
> _root.clip.createTextField("sText",2,20,20,150,30);
>  
> newFont = new TextFormat();
> newFont.embedFonts = true;
> newFont.font = "Font 1";
> newFont.textColor = 0xFFFFFF;
>  
> _root.clip.sText.setTextFormat(newFont)
> _root.clip.sText.text="test";
> _root.clip.sText._alpha = 50;
> _root.clip._alpha=50;
> 
> ```
> 
> ANY help would be very much appreciated!!  
> Thanks in advance!

you could break apart (ctrl+B) that text, than convert it into a symbol. for the first keyframe setProperty,alpha,100. in the last keyrame you set it at 50 (motion Twain).

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 21, 2004, 12:54pm UTC](https://forum.kirupa.com/t/createemptymovieclip-alpha/61686/8 "2004-08-21T12:54:51Z")

</div>

you cant break it apart because its being created dynamically - thats kind of the point of the question 😉
