• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to extract sections of text from textfield

New Here ,
Jul 03, 2012 Jul 03, 2012

Copy link to clipboard

Copied

Hello,

I have been able to extract the full HTML text from a webpage using the URLLoader and URLRequest classes and place this inside a textfield.

What I want to do however is to search the HTML for specific pieces of text (actually HTML tags) and then extract all the text between two specific tags, and then put that extracted text into a texfield.

How should I go about this? Should I manipulate the full HTML text that is already within the textfield? Or should I save this full text into a different kind of format within AS3 (i.e. not a textfield) that is more suited to searching and extracting pieces of text? Or is a textfield perfectly suited to this kind of thing?

I'm reasonably new to AS3 so I'm not quite sure where to start, but all I need is a nudge in the right direction.

Cheers,

Joe

TOPICS
ActionScript

Views

859

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 03, 2012 Jul 03, 2012

Copy link to clipboard

Copied

AS3 has the methods, used in the majority of languages, for string handling.

You will have to create an algorithm with indexOf and substring

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/String.html

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 03, 2012 Jul 03, 2012

Copy link to clipboard

Copied

Using a TextField is not going to do anything to help except to display the result of your manipulations that you wish to display. 

You need to look into using the String class and its various methods to deal with text manipulations such as you are after. 

You should also be able to make use of the RegExp class (regular expressions) who's job in life is to deal with examining String entities for patterns.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 03, 2012 Jul 03, 2012

Copy link to clipboard

Copied

Thanks guys, thats exactly what I was after.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 03, 2012 Jul 03, 2012

Copy link to clipboard

Copied

you're welcome

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 03, 2012 Jul 03, 2012

Copy link to clipboard

Copied

LATEST

You're welcome Joe

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines