A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Load HTML trough flash, Is this possible?

  1. #1

    Load HTML trough flash, Is this possible?

    I was wondering, is it possible to load a html file trough flash?
    Let me clarify, lets say I have a flash movie and I only want to use this as a background for a website. Is there a way in flash to call the html file with text and images? This way all I have to do is to edit the html files.

    I hope this makes sense, if something is unclear just ask me.

    Thanks in advance.

  2. #2
    Member
    Join Date
    Jul 2005
    Posts
    72
    Yep, just use a textfield, set it to dynamic. Then click Render Text as HTML in properties or set the .html property to true. Then use Loadvars to load the html file and assign the variable into the textfield.htmlText property. Here's an example:
    Code:
    loadText = new LoadVars();
    loadText.onLoad = function()
    {
    	_root.helpText_txt.html = true;
    	_root.helpText_txt.htmlText = this.testText;
    }
    loadText.load("text.htm");
    Just remember the following: You don't need all that header junk like <html> tags and such. At the beginning of your html file, above everything else put something like:
    testText= where testText can be any variable name you choose. You can only use jpg and swf's for graphics embedded in the html. And the jpg's can't be progressive jpg's. Finally anchors "<a href='bla bla bla'>" will work but won't show as a different color unless you use font tags around them and specify to change the color of the text. ie. "<font color="#0000FF"><a href='bla.html'>Bla</a></font>"

    Hope that helps.

  3. #3
    Thanks for the help Legion6789
    Are you able to also use css fromatet html pages?

  4. #4
    Member
    Join Date
    Jul 2005
    Posts
    72
    Yeah. Check the link below for more details.
    http://www.macromedia.com/livedocs/f...html#wp4401953

  5. #5
    Member
    Join Date
    Aug 2002
    Location
    UK
    Posts
    31
    i've had a go at this, please can somebody tell me where i'm going wrong. Sorry i'm new to this. I've attached the files if you want to have a look
    Attached Files Attached Files

  6. #6
    Member
    Join Date
    Aug 2004
    Location
    brooklyn
    Posts
    97
    andy: i know it's two weeks later but if your still wondering why your text is not loading, it's cause your script refers to an html file but your file is a txt file.


    see ----> loadText.load("page2.html");




    your file is titled "page2.txt"
    the higher the climb, the better the view.

    www.jofolio.com

  7. #7
    Junior Member
    Join Date
    Apr 2004
    Location
    lahore
    Posts
    2

    HTML loading Problem

    Hi!
    I am trying to load the file... but it is not showing the right way. means it always show image at last... but my HTML have image in middle...
    Is there any way to correct it? i am using Flash ver-8.0
    waiting for reply.
    i am attaching FLA, Jpeg and html file...
    But the html file is changed to .txt
    please change it to html before using the files...
    Thanks...
    Attached Images Attached Images
    Attached Files Attached Files
    MeltedMoon

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center