Search code examples
flashactionscriptactionscript-2

Load a html file inside Flash


Can I use loadClip() method of MovieClipLoader class to load a html file inside a Flash?, like swf or .jpg or similar files?. If not, there are some other method that I can do it?


Solution

  • You can't really use that as that is meant for loading media (such as images and other movie clips). Since html files are generally text, you can load in the data using the classes for loading in text files.

    It's been quite awhile since I've had to think in AS2, but looking back, I believe you can use LoadVars object and for AS3 you can use a URLLoader (I'd always recommend moving to AS3).

    As for displaying them, you could try sticking it in to a TextField/TextArea and setting the htmlText property, but you will have to do some work from here to see what tags and css are supported or you can always try parsing the data and displaying it in your own way.