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
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
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.
Copy link to clipboard
Copied
Thanks guys, thats exactly what I was after.
Copy link to clipboard
Copied
you're welcome
Copy link to clipboard
Copied
You're welcome Joe