Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6615403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:27:26+00:00 2026-05-25T20:27:26+00:00

(lord help me for programming in AS2) i’m itterating thru an array of text

  • 0

(lord help me for programming in AS2)

i’m itterating thru an array of text field objects and tracing the selected focus field when pressing tab, as well as each object.

i’m trying to equate these object, but while they trace the exact same they are not.

m_InputFieldsArray = new Array(m_TitleTextInput, m_CommentsTextArea, m_EmailTextInput);

for (var i:Number = 0; i < m_InputFieldsArray.length; i++)
{
    trace("Get Focus: " + Selection.getFocus());
    trace("Arr Index: " + m_InputFieldsArray[i].textField);

    if (Selection.getFocus() == m_InputFieldsArray[i].textField) 
    {
        trace("Match!");
        return;
    }
    else
    {
        trace("NO Match!");
    }
}

the output:

Get Focus: _level0.m_Window.form.m_TitleTextInput.textField
Arr Index: _level0.m_Window.form.m_TitleTextInput.textField
NO Match!
Get Focus: _level0.m_Window.form.m_TitleTextInput.textField
Arr Index: _level0.m_Window.form.m_CommentsTextArea.textField
NO Match!
Get Focus: _level0.m_Window.form.m_TitleTextInput.textField
Arr Index: _level0.m_Window.form.m_EmailTextInput.textField
NO Match!

the first group traces the same, but apparently they do not match. Selection.getFocus() returns a string, while the array index is tracing the text field object. if i add toString() to the text field object it will trace as [Object object]

how can i accomplish a match?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:27:26+00:00Added an answer on May 25, 2026 at 8:27 pm

    Use eval() for the Selection.getFocus()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Eg :a=[[hello, world], [good, lord], [hello, lord]] I need to find and record the
The following code breaks when the XML has data like Lord & Hogan. Any
I got the following xml: <categories> <category> <id>1</id> <name>aaa</name> <url>lord</url> <categories> <category> <id>2</id> <name>bbb</name>
How much space does a java string array take up? More specifically, how much
Supposedly I have this line in my text file which has the following format.
How do you pass Array dimensions along with the Array in java? I invision
I'm looping a two-dimensional array like this: if (!empty($aka)) { foreach ($aka as $ak)
good lord, man, why would you want to do that? don't you know that
I am calling an API function in the Lord of the Rings Online (LOTRO)
I'm using some regexes to parse wiki-styled text. <?php function wikiParser($data){ $data = preg_replace('/\[\[Youtube:([a-zA-Z0-9_]+)\]\]/',

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.