Copy link to clipboard
Copied
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
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.
Copy link to clipboard
Copied
possibly with an air app. otherwise, no.
Copy link to clipboard
Copied
Could you please explain a little bit more, why it is not possible and why it is maybe possible with Air?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Ok, so it is possible, it is just hard to accomplish in Flash, and I just need the above part to be read. I will try and see if I can work it out thanks for your answer
Copy link to clipboard
Copied
you're welcome.
it doesn't take much. this will load an html file:
var urlL:URLLoader=new URLLoader();
urlL.addEventListener(Event.COMPLETE,completeF);
urlL.load(new URLRequest("http://www.adobe.com"));
function completeF(e:Event):void{
trace(e.target.data);
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now