Copy link to clipboard
Copied
Gotta another action script puzzle im trying to figure out.
My program has two rows of text, stacked on top of each other.
they adjust to each other, to match when text is entered so it stays a nice square.
the problem is I cant seem to get the text bars on top to resize to the text bars on bottom.
Worth mentioning, it works the other way around, the bottom text resizes to the top text.
any help would be apperciated.
//here is my code
addEventListener(Event.ENTER_FRAME,strehrows, false, 0, true);
function strehrows(event:Event)
{
if (MovieClip(parent.parent).textSelect == textArray100["pair1"],false,0,true)
{
textArray100["pair1"].autoSize = TextFieldAutoSize.LEFT;
textArray100["pair13"].autoSize = TextFieldAutoSize.NONE;
textArray100["pair13"].width = textArray100["pair1"].width;
}else
if (MovieClip(parent.parent).textSelect == textArray100["pair13"],false,0,true)
{
textArray100["pair13"].autoSize = TextFieldAutoSize.RIGHT;
textArray100["pair1"].autoSize = TextFieldAutoSize.NONE;
textArray100["pair1"].width = textArray100["pair13"].width;
}
}
copy and paste the code you're using. i can't debug code that's related but not the same as the code you use.
also, use the trace() function to check the values that you're checking and copy and paste that output too.
for example,
addEventListener(Event.ENTER_FRAME,strehrows, false, 0, true);
function strehrows(event:Event)
{
trace(MovieClip(parent.parent).textSelect.name,textArray100["pair1"].name,textArray100["pair13"].name);
if (MovieClip(parent.parent).textSelect == textArray100["pai
...Copy link to clipboard
Copied
if you're not seeing any error messages, what is:
MovieClip(parent.parent).textSelect
and what is
textArray100["pair1"],false,0,true
Copy link to clipboard
Copied
no errors.
Awnsers
Text select is a var on the main time line, that tells the current text bar you're on,
and textArray100["pair1"] is one of the text fields
Copy link to clipboard
Copied
what's all that false,0,true stuff in your if-statement. those look like event listener parameters, not something that belongs in an if-statement.
Copy link to clipboard
Copied
Just experimenting, was getting some errors and screwed around. Lol
Okay I removed all that garbage.
Copy link to clipboard
Copied
thats not what was messing with it though. I could use a push in the right direction
Copy link to clipboard
Copied
copy and paste the code you're using. i can't debug code that's related but not the same as the code you use.
also, use the trace() function to check the values that you're checking and copy and paste that output too.
for example,
addEventListener(Event.ENTER_FRAME,strehrows, false, 0, true);
function strehrows(event:Event)
{
trace(MovieClip(parent.parent).textSelect.name,textArray100["pair1"].name,textArray100["pair13"].name);
if (MovieClip(parent.parent).textSelect == textArray100["pair1"])
{
textArray100["pair1"].autoSize = TextFieldAutoSize.LEFT;
textArray100["pair13"].autoSize = TextFieldAutoSize.NONE;
textArray100["pair13"].width = textArray100["pair1"].width;
}else
if (MovieClip(parent.parent).textSelect == textArray100["pair13"],false,0,true)
{
textArray100["pair13"].autoSize = TextFieldAutoSize.RIGHT;
textArray100["pair1"].autoSize = TextFieldAutoSize.NONE;
textArray100["pair1"].width = textArray100["pair13"].width;
}
}