A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: show html code IN a html doc?

  1. #1
    Senior Member
    Join Date
    Feb 2004
    Location
    Halifax, MA
    Posts
    205

    show html code in a contentpane?

    Is there some way to show html codes in the html text of a contentpane?

    If I type, "Use ## to mark your page breaks," in an html file imported to a contentpane, the double hashes are not printed by the contentpane. Nor are "<html>" or </html>."

    I have a list of supported html tags and can't see one for escaping the codes.

    Is there a way to do it?
    Last edited by jimventola; 08-22-2006 at 02:39 AM. Reason: clarity

  2. #2
    Polak Maly ant_Z's Avatar
    Join Date
    Jul 2006
    Location
    Poland
    Posts
    440
    maybe try html entites (?) these you can take a look here: http://webmaster.helion.pl/kurshtml/znaki/znaki.htm its in polish but thenames on entites(?) are in english too :]

  3. #3
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    The double hashes should be visible unless you used the routine to break up a text I posted a few days ago (A string used to split on doesn't end up in the splitted strings) .

    If you set a html page for content, it assumes the html codes should be used for the layout of the text. If you set it as normal text content you will see the html tags inside it.

    If you want to show the code in another contentpane, do it like this
    Code:
    contentpane1.onTransit = function(){
     contentpane2.setContent(0,contentpane1.htmlText);
    }
    In this case contentpane1 is the one containing the formatted html text and contentpane2 shows the source.

  4. #4
    Senior Member
    Join Date
    Feb 2004
    Location
    Halifax, MA
    Posts
    205
    Quote Originally Posted by w.brants
    The double hashes should be visible unless you used the routine to break up a text I posted a few days ago (A string used to split on doesn't end up in the splitted strings) .
    Thanks. I did indeed use your code. Thanks to it and the contentpane, my movie will actually do double-duty. I can use it to create audio presentations for my students, but it will also be usable by people without KM to create their own presentations--they just need to use the proper names for the text and audio files to create the lessons. Since the SWF has those hard coded, it can be re-used with new media repeatedly. I am hoping teachers with no Flash experience will find it useful.

    I wanted the instructions about preparing the text for display to be in "myText.html" (rather than in a text file), so users could see a working example.

    Luckily, the codes linked by Ant_Z seem to work. All is well.
    Last edited by jimventola; 08-22-2006 at 12:03 PM.

  5. #5
    Senior Member
    Join Date
    Feb 2004
    Location
    Halifax, MA
    Posts
    205

    It worked!

    Quote Originally Posted by ant_Z
    maybe try html entites (?) these you can take a look here: http://webmaster.helion.pl/kurshtml/znaki/znaki.htm its in polish but thenames on entites(?) are in english too :]
    Thanks for that link. I was looking for just such a chart.

    I didn't think it would work, but I just got a less than sign into the display. This makes it possible to include code in the contentpane.

    This is so good--I want to Polka.
    Last edited by jimventola; 08-22-2006 at 11:59 AM.

  6. #6
    Polak Maly ant_Z's Avatar
    Join Date
    Jul 2006
    Location
    Poland
    Posts
    440
    Quote Originally Posted by jimventola
    This is so good--I want to Polka.
    If you meant dancing, Polka came form Czech Republic and it isnt polish if you want, i can do a script for you (in PHP) automaticly converting html tags into entitles... allright, just make a form with textarea named "toconvert", method POST and action boom.php

    boom.php code:

    <?
    $after = htmlspecialchars($_POST['toconvert']);
    echo $after;
    ?>

    and look at the generated page source code - only entitles

    oh... if you meant Polka as a Polish woman, thats a good choice :] nice, intelligent and beatiful

  7. #7
    Senior Member
    Join Date
    Feb 2004
    Location
    Halifax, MA
    Posts
    205
    Thanks for the kind offer.

    I did mean the dance. From now on, I will dance the Czechia. There are even Irish polkas at this point, though.

    I am only now beginning to look at Php. It would take a lot of time to learn.
    I cannot actually follow this, but I think I have the general idea. What do you mean by "entites"? I can think of the word "entities," but that seems too general as it just means "beings."

    I only needed to show a bit of html in the contentpane that one time, so I won't need the script for the sort of text I will be using: poems and essays, mostly. But other users of the contentpane may well want to display html tags, so making the contentpane able to handle html code is a good idea.

  8. #8
    Polak Maly ant_Z's Avatar
    Join Date
    Jul 2006
    Location
    Poland
    Posts
    440
    Quote Originally Posted by jimventola
    It would take a lot of time to learn.

    What do you mean by "entites"? I can think of the word "entities," but that seems too general as it just means "beings."

    But other users of the contentpane may well want to display html tags, so making the contentpane able to handle html code is a good idea.
    First thing - i would even say youre ver wrong :] saying things like "it would take a lot fo time" is bul... ekhm... ive learned PHP in about 3 days. PHP is so easy... got error? got message. message says what kind of error occurs, in which file and which line. And this is beaty of PHP. ITs got hundres of pre-defined functions, so you dont have to make them manually. Just visit http://php.net ;]

  9. #9
    Polak Maly ant_Z's Avatar
    Join Date
    Jul 2006
    Location
    Poland
    Posts
    440
    second thing - i meat &lafglhgfgva; and other bushes :]
    third thing: in free time ill put this script on a server and lett all users enjoy it :]

  10. #10
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Jim PHP is pretty easy to master. And there are TONS of PHP resources out there to learn from. Books, websites etc. One such that I frequent is PHPbuilder.com very good meesage board there.

  11. #11
    Senior Member
    Join Date
    Feb 2004
    Location
    Halifax, MA
    Posts
    205
    Quote Originally Posted by blanius
    Jim PHP is pretty easy to master. And there are TONS of PHP resources out there to learn from. Books, websites etc. One such that I frequent is PHPbuilder.com very good meesage board there.
    Thanks, guys, for the links; I will take a look.

    I recently got interested in Ruby when I stumbled on this very funny manual
    http://poignantguide.net/ruby/

    but php is probably more practical at this point.

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