Tuesday, 15 June 2010

It is possible to convert HTML code into ActionScript? -


I have an ASPX web application for my business back-office staff. In a back office module, I'm using to edit some text before saving a database. The text looks like this:

  & lt; P data-MC-style = "- WebKit-margin-first: 0px; -webkit-margin-after: 0px; font-family: 'sego UI'; font-size: 14px; background-color: #F7F 7F7; "& gt; & Lt; Strong> & Lt; / Strong> A & lt; Period style = "text-decoration: underlined;" Data-MC-style = "text-decoration: underline;" & Gt; Most & lt; / Span & gt; Great & lt; Span style = "background color: RGB (255, 204, 153);" Data-MC-style = "background-color: #FFCC99;" & Gt; Ballet & lt; / Span & gt; & Lt; Strong & gt; World & lt; / Strong> In . "& Lt; em> Sleeping Beauty & lt; / em & gt;" Take lieutenant Span style = "color: RGB (51, 153, 102);" Data-MC-style = "color: # 339966;" & Gt; We & lt; / Span & gt; A & lt; A href = "http://pt.wikipedia.org/" target = "_ blank" data-fish-href = "http://pt.wikipedia.org/" & gt; Unwanted & lt; / A & gt; & Amp; Nbsp; Location & lt; / P & gt; & Lt; Ul & gt; & Lt; Li data-MC-style = "- WebKit-margin-first: 0px; -webkit-margin-after: 0px; font-family: 'Segoyi UI'; font-size: 14px; background color: # f7f7f7;" Gt; With forests, & lt; / Li & gt; & Lt; Li data-MC-style = "- WebKit-margin-first: 0px; -webkit-margin-after: 0px; font-family: 'Segoyi UI'; font-size: 14px; background color: # f7f7f7;" Gt; Curse and Fire, & lt; / Li & gt; & Lt; / Ul & gt; & Lt; P style = "text-align: proper;" Data-MC-style = "text-align: justified;" & Gt; A romantic and beautiful lieutenant; Span style = "color: RGB (0, 0, 255);" Data-MC-style = "color: # 0000ff;" & Gt; Lyrics & lt; / Span & gt; . A brilliant & lt; Sup> Show & lt; / Sup>. & Lt; / P & gt;  

The mobile front-end application (developed by someone else in Flash) needs to display the text with all the styles. However, sometimes the application does not show anything, and the developer says that this is because Flash does not like HTML tags / styles.

I was thinking that we can use some kind of parser, HTML code more suitable for flash, but I could not find anything. I have come to these two links, but I do not know anything about the action script, so they do not help me:

  • Is there any easy way to change the action script in HTML?

    Any "easy way" unfortunately.

    As you've already searched, the basic HTML and the text via TextField class html text and styleSheet CSS rendering supports> properties, but are very limited in some cases you can change tags ( RegExp or by using simple string search) to get closer to the original style.

    In addition to this, things like data-mce-style are specific to MCE, so you have to convert it to a meaningful form in HTML.

    If you are using AIR , then you can see the HTMLLoader or StageWeb view . Both of these classes use a full HTML rendering engine (WebKit or Basic Web Renderer).

    Finally, and this can be your best option, in the web browser, you can & lt; Div & gt; ; on SWF (with wmode = opaque or transparent ) and display HTML in the browser.


    No comments:

    Post a Comment