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 159239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:49:25+00:00 2026-05-11T10:49:25+00:00

When I create a TextField in AS3 with multiline set to true and equate

  • 0

When I create a TextField in AS3 with multiline set to true and equate the text to say:

‘Hola \r hola’

I am unable to retrieve the index position of \r using indexOf function, it always returns -1

Does anyone know what I’m doing wrong?

var txt:TextField; txt.multiline = true;  txt.text = 'Hola \r hola';  //txt now renders fine with the line break  trace(txt.indexOf('\r')); //Returns -1, should return the valid index of \r in txt 
  • 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. 2026-05-11T10:49:26+00:00Added an answer on May 11, 2026 at 10:49 am

    Following Mikko’s answer I gave it a try :

    var textField:TextField = addChild(new TextField()) as TextField; textField.multiline = true;  textField.text = 'test \r test';  trace('result>' + textField.text.indexOf('\r')); 

    This code traces :

    result>5 

    … Just as expected.

    If it still doesn’t work for you, first try to search for another character than \r, if this works also try to search for \n. Maybe the line feed gets transformed somehow. (which OS are you on?)

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

Sidebar

Related Questions

I create an AS3 TextField set to Input mode dynamically through code, but when
I want to create textfields based on user input. Let's say 5 textfield are
This is the class text.as3 private function showTextArea():void{ textField = new TextArea(); canvas.addChild(textField); }
How can I create the textfield that can accept image and text like the
I don't know how to create a textfield with a camera button like the
I'm new to actionscript 3. I want to create a textfield that is either
I'd like to create a text field with a dropdown list that lets the
I am trying to create a text field in objective-c with a big corner
i've got the following request: create a plain text field that transforms into an
Is it possible to do the following using AS3 and Flash CS3 IDE? The

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.