# \[Flash8\] Can't even set the text in a simple Label component

**URL:** <https://forum.kirupa.com/t/flash8-cant-even-set-the-text-in-a-simple-label-component/216004>\
**Category:** flash\
**Created:** [February 12, 2007, 9:08pm UTC](https://forum.kirupa.com/t/flash8-cant-even-set-the-text-in-a-simple-label-component/216004 "2007-02-12T21:08:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dalewb](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/dalewb/32/3029_2.png) [@dalewb](https://forum.kirupa.com/u/dalewb)\
**Post date:** [February 12, 2007, 9:08pm UTC](https://forum.kirupa.com/t/flash8-cant-even-set-the-text-in-a-simple-label-component/216004/1 "2007-02-12T21:08:50Z")

</div>

The following code _should_ work fine, but I’ve grown to realize that when working with flash components, things often don’t work like you think they should. All I am trying to do at the moment is make the stupid thing visible (set the text for the label, because I know that with no label they will not be visible): ActionScript Code:  
[FONT=Courier New][LEFT][COLOR=#0000ff]import[/COLOR] mx.[COLOR=#000080]controls[/COLOR].\*;  
mx.[COLOR=#0000ff]accessibility[/COLOR].[COLOR=#000080]LabelAccImpl[/COLOR].[COLOR=#000080]enableAccessibility[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]createEmptyMovieClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]“george”[/COLOR], [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR], [COLOR=#000000]{[/COLOR][COLOR=#0000ff]\_x[/COLOR]: [COLOR=#000080]0[/COLOR], [COLOR=#0000ff]\_y[/COLOR]: [COLOR=#000080]0[/COLOR][COLOR=#000000]}[/COLOR][COLOR=#000000])[/COLOR];

[COLOR=#808080]_//Labels_[/COLOR]  
[COLOR=#0000ff]this[/COLOR].[COLOR=#000080]george[/COLOR].[COLOR=#000080]createClassObject[/COLOR][COLOR=#000000]([/COLOR]Label, [COLOR=#ff0000]“labelName”[/COLOR], [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR], [COLOR=#000000]{[/COLOR][COLOR=#0000ff]\_x[/COLOR]: [COLOR=#000080]1721[/COLOR], [COLOR=#0000ff]\_y[/COLOR]: [COLOR=#000080]1000[/COLOR][COLOR=#000000]}[/COLOR][COLOR=#000000])[/COLOR];  
[COLOR=#0000ff]this[/COLOR].[COLOR=#000080]george[/COLOR].[COLOR=#000080]labelName[/COLOR].[COLOR=#0000ff]\_x[/COLOR] = [COLOR=#000080]1721[/COLOR];  
[COLOR=#0000ff]this[/COLOR].[COLOR=#000080]george[/COLOR].[COLOR=#000080]labelName[/COLOR].[COLOR=#0000ff]\_y[/COLOR] = [COLOR=#000080]1000[/COLOR];  
[COLOR=#0000ff]this[/COLOR].[COLOR=#000080]george[/COLOR].[COLOR=#000080]labelName[/COLOR].[COLOR=#0000ff]text[/COLOR] = [COLOR=#ff0000]“Card Name”[/COLOR];  
[COLOR=#0000ff]this[/COLOR].[COLOR=#000080]george[/COLOR].[COLOR=#000080]labelName[/COLOR].[COLOR=#000080]setLabel[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]“Card Name”[/COLOR][COLOR=#000000])[/COLOR];

[COLOR=#808080]_//Name & Keyword_[/COLOR]  
[COLOR=#808080]_[//george.createClassObject](https://george.createClassObject)(_[/COLOR]  
george.[COLOR=#000080]createClassObject[/COLOR][COLOR=#000000]([/COLOR]TextInput, [COLOR=#ff0000]“tiName”[/COLOR], [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR], [COLOR=#000000]{[/COLOR][COLOR=#0000ff]\_x[/COLOR]: [COLOR=#000080]1821[/COLOR], [COLOR=#0000ff]\_y[/COLOR]: [COLOR=#000080]1000[/COLOR][COLOR=#000000]}[/COLOR][COLOR=#000000])[/COLOR];  
[/LEFT]  
[/FONT]

I’m just a _tad_ bit frustrated 😉

[COLOR=Orange]\*\* UPDATE:\*\*[/COLOR]  
I replaced all of the "getNextHighestDepth"s with numbers (starting the numbering at 0) and everything showed up. Turns out the label code was working, but the label was getting replaced by the next component called in the code because they were all at the same depth. I thought getNextHighestDepth() was supposed to prevent this!
