Skip to main content
vlceversa
Known Participant
June 4, 2013
Answered

Reading of a dynamic html page with AS3 possible?

  • June 4, 2013
  • 1 reply
  • 1398 views

Hi,

I have a short question, I have this html page which contains a chat, the chat is built out of html. Thats one chatline:

<li class="chat_from_duplin line" data-sender="duplin">

<p><span class="small">10:39 </span>

<a class="mod_button timeout" title="Timeout duplin"><img alt="Timeout" src="http://www-cdn.jtvnw.net/images/xarth/g/g18_clock-00000080.png"></a>

<a class="mod_button ban" title="Ban duplin"><img alt="Ban" src="http://www-cdn.jtvnw.net/images/xarth/g/g18_ban-00000080.png"></a>

<a class="mod_button unban" style="display:none;" title="Unban duplin"><img alt="Unban" src="http://www-cdn.jtvnw.net/images/xarth/g/g18_unban-00000080.png"></a>

<a class="nick" href="/duplin" id="chat-line-883893694" style="color:#FF4500">duplin</a>:

<span class="chat_line">There should be a ravage Icon, do you know if she is planning to do any suscriber icons?</span></p>

</li>

So, would it be possible to have a standalone swf file opened with Flash to read this content? Considering the chat is scrolling, and only a part of the chat is visible in the html of the page.

Regards

This topic has been closed for replies.
Correct answer kglad

Ah, ok thanks for the explanation, another question then, JavaScript is able to read html pages right, and AS3 is capable of calling JavaScript functions with the ExternalInterface, so that might be a solution then?


you don't need javascript if you just want to "read" the html code. 

reading the html code in flash isn't difficult.  you can use the urlloader class to load an html page.

the hard part is displaying what is encoded in the html page.  you'd have to manually parse the html code (using the flash string/array methods) and take the appropriate steps to desplay the content encoded in the html page.

1 reply

kglad
Community Expert
Community Expert
June 5, 2013

possibly with an air app.  otherwise, no.

vlceversa
vlceversaAuthor
Known Participant
June 5, 2013

Could you please explain a little bit more, why it is not possible and why it is maybe possible with Air?

kglad
Community Expert
Community Expert
June 5, 2013

an air app can use the htmlloader class or stagewebview and one of those is needed to load and display general html pages.  otherwise, flash has a very limited ability to handle html tags.