dcsimg
A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: sharing an external html file with a static page

  1. #1
    Member
    Join Date
    Feb 2005
    Posts
    31

    sharing an external html file with a static page

    hi all,

    Flash MX 2004...

    I need to make an external text doc load in my .swf as well as a static page so I can have two verisons of the same site, both and low bandwidth versions, and only have to update a single text file for each to be updated.

    I have created a simple doc using the pragraph, bold, and link tags only.

    I can get this file to display fine in an iframe on the static page, but I am having trouble getting flash to import the text correctly.

    I have a dynamic box, set to display as html. I used a bit of trickery to get it to show up at all, by using a load xml command I found. Problem now is that all the lines are seperated too far, and the html tags are being displayed.

    I know this has to be a fairly common thing to do...what's the best method here?

    Ps. - I am trying to make it so the $content= doesn't display on the html page, that's why I am not going the standard route...unless someone knows how to hide this from the broswer for the iframe?

    Thanks!

  2. #2

  3. #3
    Member
    Join Date
    Feb 2005
    Posts
    31
    <p><b>this is a test</b><br>
    I am hoping to get this text to display in flash as well as an plain html page</p>
    I hope someone can help, because I haven't been able to find anything on <br>
    <a href='http://www.google.com' target='_blank'>Google</a>

  4. #4
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    well heer is how to get a regular textFile into FLASH and have it parse theHTML tags that is can...

    I dont know HOW your trying to get a text file contents into an HTML page though...
    Attached Files Attached Files

  5. #5
    Member
    Join Date
    Feb 2005
    Posts
    31
    thanks for the files, but it's that pesky "info=" variable declaration that brought me here to begin with.

    Is there a way to import this text to Flash without using that? (or a way to hide that part from a browser which is loading the text as an iframe?)

  6. #6
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    hide it form FLASH?..I dont think so...that it what designates the var name to call the data (text) from...

    how are you calling the textFile into your iFRAME?.. you maybe be able to use XML or something....

  7. #7
    Member
    Join Date
    Feb 2005
    Posts
    31
    no, not hide it from flash...hide it from the browser that is calling the text ito an iframe. I do have to rename the file to a .html to get it to display correctly in the iframe. I use this command to call it to the html page:

    <IFRAME SRC="myText.html" width=500 height=400>

    2 problems:

    1 - when I change the file from a .txt to a .html, the flash dynamic box displays it in broken lines with a full carriage return in between each line.
    2 - if I leave it as .txt, the browser will not display the formattings...and it also shows the "content=" in the iframe.



    Simple concept..one text file, that will display both in a dynamic flash box and as a dynamically loaded component in an html page as well.

    I don't know how to go about this other than the dead ends I am on...surely this is a common thing to do...or does everyone who makes a high and low bandwidth version of a site update everything in two places each time?

    I am open to any and all ideas here...

  8. #8
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    this is NOT common..FLASH does NOT nor is it intended, to read/load HTML pages..it can load .txt files with SIMPLE html tags inside of it..

  9. #9
    Member
    Join Date
    Feb 2005
    Posts
    31
    ok, no problem...

    then does anyone know how to load a .txt file that flash can display into a standard html file?

  10. #10
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    ??? I dont think you fully grasping this.

    flash can ONLY import text files (or XML) and parse the data..it can NOT do anything with an HTML file... inside your .txt file though..you CAN have simple HTML tags that FLASH will understand and apply to the text.

    HTML is HTML... you create an HTML page with the <html> tags and everything...save it and use it as is.. Unless you have some sort of PHP or ASP in your HTML pages that takes the text from a DB or somewhere and populates the page...you CANT do this.

    I guess wait for someone else to post on it.

  11. #11
    Senior Member
    Join Date
    Feb 2006
    Location
    Melbourne, Australia
    Posts
    105
    Actually you can do this.

    I'll look up my notes and get back to you on this at some stage, but it is more than possible to have a PHP page that displays very simple text (as in not every HTML command will be supported by flash) be loaded into a dynamic text box.

    You should be able to find information on this by searching these forums, but i will get back to you if you can't.

    -LetterAfterZ

  12. #12
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    as I stated...unless you use ASP or PHP..this is NOT possible.. using a server side language to populate your HTML page..or send text to flash is different than using a flat (text) file.

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