Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Help HTMLtext - Stylesheet HTML Tags



Got this tutorial off the net. My stylesheets and HTML dont seem to be loading. Did the stylesheets tutorial off Kirupa. That worked fine. But in my code below, the only thing that worx is the <b></b> tags.

My stylesheet should be fine as well. Dont see what the problem is?!

Please help. Desperate

posting the code (ignore the AMFPHP stuff)
====================================

function getStyle() {
// load stylesheet first, then get content (separate function)
var flash_css = new TextField.StyleSheet();
var path="sitestyles.css";
flash_css.load(path);
flash_css.onLoad = function(success:Boolean) {
if (success) {
categoryTitle.StyleSheet = flash_css;
pageContent.StyleSheet = flash_css;
} else {
pageContent.htmlText = "Style sheet appears to be rodgered";
}
};

};



import mx.remoting.*;
import mx.rpc.*;
import mx.remoting.debug.NetDebug;
import mx.utils.Delegate;

NetDebug.initialize();
// ----------------------------
// create the responder object
// In this object we will define
// all the result function for
// the data received from server
// ----------------------------
mainResponder = new Object();
// echoString receiver
mainResponder.echoString_Result = function( data_pass ){
trace("echoString result");
trace("received: " + data_pass );
trace("----");
}
// echoPageTitle receiver
mainResponder.getCategoryTitle_Result = function( data_pass ){
categoryTitle.html = true;
categoryTitle.htmlText += "<p class='three'><b>";
categoryTitle.htmlText += data_pass;
categoryTitle.htmlText += "</b></p>";

}
// echoPageContent receiver
mainResponder.getPageContent_Result = function( data_pass ){
pageContent.html = true;
pageContent.wordWrap = true;
trace("in GetPageContent");
//data_pass type object
// pull out data loop build string
var data_pass_string="";

data_pass_ln=data_pass.getLength();
for (var i:Number = 0; i < data_pass_ln; i++) {
// for each person node:
trace(data_pass.getItemAt(i).Item_title);

data_pass_string+="<b>" + data_pass.getItemAt(i).Item_title +"</b>" + " R" + data_pass.getItemAt(i).Item_cost + i + " <BR> ";

}

pageContent.type="dynamic";
pageContent.htmlText += "<p class='two'>";
pageContent.htmlText += data_pass_string;
pageContent.htmlText += "</p>";


}
// generic onStauts responder, it will be invoked
// when an error is received from the server
mainResponder.onStatus = function ( data_pass ) {
trace("an error occurred")
trace("in line: " + data_pass.line)
trace("error level: " + data_pass.level)
trace("description: " + data_pass.description)
}
// define the path of our gateway.php
NetServices.setDefaultGatewayUrl( 'http://localhost/flashservices/gateway.php' );
// initialize a variable for the connection
conn = NetServices.createGatewayConnection();
// initialize the service for our class ModxTut
// an tell which is the responder object
// for all the calls to the server
serv = conn.getService("FontanasMenu", mainResponder);
serv.getCategoryTitle(1);
serv.getPageContent(1);

// flash stuff again
_root.createTextField("categoryTitle", getNextHighestDepth(), 2, 2, 300, 40);

_root.createTextField("pageContent", getNextHighestDepth(), 20, 40, 300, 200);

// scrollbar
this.createClassObject(mx.controls.UIScrollBar, "my_sb", 20);
// Set the target text field.
my_sb.setScrollTarget(pageContent);
// Size it to match the text field.
my_sb.setSize(16, pageContent._height);
// Move it next to the text field.
my_sb.move(pageContent._x + pageContent._width, pageContent._y);

getStyle();

====================================



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 08-22-2006, 12:52 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

A Problem With HtmlText And Certain HTML Tags
Hello, I was hoping you could help with this probem I've been having.

I am loading HTML from an external .txt file into my movie. The text shows up just fine, but certain HTML tags like the <h1> and <table> tags don't seem to be working. Is this a feature or am I doing something wrong?

Obviously, I am a flash newbie and I greatly appreciate any help.

Disabling HTML Tags In Htmltext To Be Rendered
Hi Buddies,

Am loading some dynamic text from an xml which has html tags inside dat text. I jus loading dat specified texts into a dynamic text fields where html is enabled and assisgned as a htmlText instead of normal text.

It works fine, but the thing is, i want to disable certain html tags to be rendered but it shud display as it is as a normal texts.
Is there any way to do dat

Trouble With Html Tags In HtmlText = Statement
Guys, I've got a puzzler. A friend is building a blog, with entries placed in a database, pulled out with php, and then passed to flash. It all goes well except for one thing...problems with html. She's using a tutorial from webmonkey and here's all the actionscript, as it originally was created:

ActionScript Code:
//function to load external data using the loadVars() object//l=name of loadVars object//n=name of text field //t=trigger to decide whether to show all entries or just one.//e= entry number to display (number)//f=file to load from (string)function lv(l, n, t, e, f) {    sb.setSize(null, 200);    sb2.setSize(null, 50);    //create a new loadVars object if one doesn't already exist    //if it does, use it    if (l == undefined) {        l = new LoadVars();        l.onLoad = function() {            var i;            //clear out any text that might already be there            n.htmlText = "";            //to show a single entry at a time we use the            //following code            if (t == undefined) {                n.htmlText += "<b>"+this["title"+e]+"  -  "+this["date"+e]+"</b><br><br>";                n.htmlText += this["entry"+e];            } else {                //cycle through and show all entries                for (i=0; i<this.n; i++) {                    n.htmlText += "<u><a href='asfunction:_root.loadArc,"+this["id"+i]+"'>"+this["title"+i]+"  -  "+this["date"+i]+"</a></u><br>";                }            }            sb.update();            sb2.update();        };    }    l.load(f);}function loadArc(passed) {    arcNum = passed-1;    lv(blog_lv, entries_txt, undefined, arcNum, "blog.php");}//for the large entry textfield lv(blog_lv, entries_txt, undefined, 0, "blog.php"); //for the archives text field lv(archive_lv, archive_txt, "cycle", null, "blog.php");


the result: everything loaded in the .swf except the title of her entry over the entry itself. There is a bold html tag around that part, she removed it and voila! The title appeared. But now there's another html tag that starts off a line of code, and it's failing. Click on the entries, and nothing loads except the - between the date and title. Here is that section of code:

ActionScript Code:
for (i=0; i<this.n; i++) {                    n.htmlText += "<u><a href='asfunction:_root.loadArc,"+this["id"+i]+"'>"+this["title"+i]+"  -  "+this["date"+i]+"</a></u><br>";                }

She found that by hardcoding a variable defined by the loadArc function, which is pulled in as arcNum, the whole thing works...but of course, can only pull in one entry with the one id number she coded. She also has removed the <u> tags, but the <a href must obviously remain to make her entries clickable.

Any clues why having html at the front of this statement in the for loop is causing the entire line to fail, and no variable to pass? It's an interesting stumper. To see this in action, here is the page: http://www.lunesse.com/journal/journal.swf. In that directory you can also find the .fla file and the php results from the database. Tester.html is her second flash movie, also in that directory and completely barebones, and she received the exact same results.

Any pointers I could relay to her would be great. Thanks for your time.

Trouble With Html Tags In HtmlText = Statement
Guys, I've got a puzzler. A friend is building a blog, with entries placed in a database, pulled out with php, and then passed to flash. It all goes well except for one thing...problems with html. She's using a tutorial from webmonkey and here's all the actionscript, as it originally was created:

ActionScript Code:
//function to load external data using the loadVars() object//l=name of loadVars object//n=name of text field //t=trigger to decide whether to show all entries or just one.//e= entry number to display (number)//f=file to load from (string)function lv(l, n, t, e, f) {    sb.setSize(null, 200);    sb2.setSize(null, 50);    //create a new loadVars object if one doesn't already exist    //if it does, use it    if (l == undefined) {        l = new LoadVars();        l.onLoad = function() {            var i;            //clear out any text that might already be there            n.htmlText = "";            //to show a single entry at a time we use the            //following code            if (t == undefined) {                n.htmlText += "<b>"+this["title"+e]+"  -  "+this["date"+e]+"</b><br><br>";                n.htmlText += this["entry"+e];            } else {                //cycle through and show all entries                for (i=0; i<this.n; i++) {                    n.htmlText += "<u><a href='asfunction:_root.loadArc,"+this["id"+i]+"'>"+this["title"+i]+"  -  "+this["date"+i]+"</a></u><br>";                }            }            sb.update();            sb2.update();        };    }    l.load(f);}function loadArc(passed) {    arcNum = passed-1;    lv(blog_lv, entries_txt, undefined, arcNum, "blog.php");}//for the large entry textfield lv(blog_lv, entries_txt, undefined, 0, "blog.php"); //for the archives text field lv(archive_lv, archive_txt, "cycle", null, "blog.php");


the result: everything loaded in the .swf except the title of her entry over the entry itself. There is a bold html tag around that part, she removed it and voila! The title appeared. But now there's another html tag that starts off a line of code, and it's failing. Click on the entries, and nothing loads except the - between the date and title. Here is that section of code:

ActionScript Code:
for (i=0; i<this.n; i++) {                    n.htmlText += "<u><a href='asfunction:_root.loadArc,"+this["id"+i]+"'>"+this["title"+i]+"  -  "+this["date"+i]+"</a></u><br>";                }

She found that by hardcoding a variable defined by the loadArc function, which is pulled in as arcNum, the whole thing works...but of course, can only pull in one entry with the one id number she coded. She also has removed the <u> tags, but the <a href must obviously remain to make her entries clickable.

Any clues why having html at the front of this statement in the for loop is causing the entire line to fail, and no variable to pass? It's an interesting stumper. To see this in action, here is the page: http://www.lunesse.com/journal/journal.swf. In that directory you can also find the .fla file and the php results from the database. Tester.html is her second flash movie, also in that directory and completely barebones, and she received the exact same results.

Any pointers I could relay to her would be great. Thanks for your time.

HtmlText Issue-shows Html Tags On Render
Im experiencing problems with the following similar problem.

the textfield (adviceText) renders my html string with the html tags, so it isnt picking them up!
this is the code that doesnt work...
--------------------------------------
adviceText.html=true;
adviceText.autoSize = rue;
adviceText.htmlText =_parent["player"+pressed].theAdvice;
--------------------------------------

now the variable is correct and is a string i cant see a problem with. it comes from a hard coded (for now) xml file within a CDATA tag to allow the html tags to be ignored during the xml parse.

if i set the string in the flash document the text field will render correctly i.e.
---------------------------------------
adviceText.htmlText ="test<br>test";
---------------------------------------

im desperate for ideas, the above line of code if substitued works correctly so im assuming that means the text field is set up correct.

thanks

My_txt.htmltext = ExampleText; Is Not Decoding HTML Tags. Why Not
var myCSS = new TextField.StyleSheet();
//Load CSS file
myCSS.onLoad = function(success:Boolean) {
if (success) {
trace("CSS loaded");
} else {
trace("CSS not loaded!");
}
};
myCSS.load("example.css");
//define onLoad handler

this.createTextField("my_txt", 1, 100, 100, 300, 100);
my_txt.styleSheet = myCSS;
my_txt.multiline = true;
my_txt.wordWrap = true;
my_txt.htmlText= true;

var exampleText = "<p class='headline'>Tutorial Takes Forever To Write</p>";
exampleText += "<p><span class='byline'>Bath, UK</span>";
exampleText += "--Flash developer NWebb seemed to take ";
exampleText += "forever to finish his CSS-Flash tutorial, ";
exampleText += "but it is finished now and you can find it ";
exampleText += "<a href='http://www.nwebb.co.uk'>here</a> ";
exampleText += "along with a few others.</p>";

my_txt.htmltext = exampleText;

Flash Dynamic HTMLText Some HTML Tags Not Working
var myText:String = "<b>Subscript of Term is 6</b> i.e., Term<sub>6</sub>"

The above <sub> tag is not working. The flash ignored the tag.

How I can use Super and Sub script.

Can anyone help me...?

Thanks in advance.

Regards
Razzak

Stylesheet Applying To A Tags, But Not B Tags In Dynamic Text Box
Hello, I have a dynamic text box that pulls HTML-formatted content from a PHP script and everything is working, including getting it formatted with a stylesheet, except the stylesheet seems to be ignored for <B> tags. This is the code I tried:

b,B { font-weight:bold; color:#6600FF; font-family:Baskerville; }
a:link { text-decoration:none; font-family:Baskerville; font-weight:bold; }
a:hover { text-decoration:underline; }
a:active { text-decoration:none; }

This is just for texting. I have a simple textbox with plain text, part of it in bold, part of it as a link, and the link gets the Baskerville font, but the bold tag doesn't. When I set a color for the link, the link gets a color but the bold tag doesn't. I'm stumped. Any ideas?

HtmlText And StyleSheet
Pretty simple code here, works just fine.


Code:
var myStyles:TextField.StyleSheet = new TextField.StyleSheet();
myStyles.setStyle("p", {color:'#808080'});
myStyles.setStyle("h1", {color:'#84ABDB'});
this.createTextField("my_txt",this.getNextHighestDepth(),20,20,260,50);
my_txt.styleSheet = myStyles;
my_txt.html = true;
my_txt.htmlText = "<p>Name: </p>";
my_txt.htmlText += "<h1>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</h1>";
Here is my problem - want to make a variable and put it between the style tags.

For instance:

Code:
var blah:String = "Hello there";
my_txt.htmlText = "<p>blah</p>";
Without it just writing "blah" I need it to get the string from the variable. How would I accomplish this?

HtmlText And StyleSheet
Pretty simple code here, works just fine.


Code:
var myStyles:TextField.StyleSheet = new TextField.StyleSheet();
myStyles.setStyle("p", {color:'#808080'});
myStyles.setStyle("h1", {color:'#84ABDB'});
this.createTextField("my_txt",this.getNextHighestDepth(),20,20,260,50);
my_txt.styleSheet = myStyles;
my_txt.html = true;
my_txt.htmlText = "<p>Name: </p>";
my_txt.htmlText += "<h1>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</h1>";

Here is my problem - want to make a variable and put it between the style tags.

For instance:

Code:
var blah:String = "Hello there";
my_txt.htmlText = "<p>blah</p>";
Without it just writing "blah" I need it to get the string from the variable. How would I accomplish this?

Odd Behavior With HtmlText, StyleSheet, And <a>
I have a programmatically-generated text field that looks like this:


Code:
var tf:TextField=new TextField();
tf.styleSheet=styles;
tf.embedFonts=true;
tf.antiAliasType="advanced";
tf.selectable=false;
tf.width=760;
tf.multiline=true;
tf.wordWrap=true;
tf.autoSize="left";
tf.htmlText="<p>"+xmldoc.meta.welcomeText+"</p>";
tf.x=tf.y=20;
FYI, here's what the styleSheet is based on:


Code:
css="p{font-family:"+(new HNC().fontName)+";font-size:16px;color:#333333} a{display:inline;color:#0000FF}";
styles=new StyleSheet();
styles.parseCSS(css);
("HNC" is the identifier of a font included in the library.)

Everything appears to render properly -- except (of course!) the anchor tags. Without a:hover, there's just a weird extra space before the first instance of an anchor tag -- once you mouse over it, it goes away. If I add back the a:hover style, anytime I mouse over either link, in one place, that space appears (and in another, adds a space at the end of the link!), and when I mouse off, it goes back to looking "normal."

Has anyone else noticed this odd behavior? It's too distracting and unprofessional-looking to leave the way it is, but I'm not sure what my alternatives are if I want to include links in the text (which is imported from an XML file).

I'd appreciate any advice! Also, this is in Flash CS3. Thanks!

EDIT: If I don't embed the fonts, the "problem" goes away; however, I'm left with non-embedded fonts. Rarggh.

Stylesheet, Block Text, And HtmlText Help
Hi All,

I've created a simple CSS stylesheet and loaded it into my Flash movie where I have an htmlText field.

The CSS has a <p> definition, and a <h1> definition. By default both should be displayed as block text and have breaks before and after the text. This seems to be working between the <h1>Some Title</h1><p>A bunch of text</p> -- This displays as:

Some Title
A bunch of text

But not between paragraphs such as, <p>A bunch of text</p><p>Some more text</p> -- this displays as:

A bunch of textSome more text

Additionally I never get a full return as I would between block level text in an html page.

How do I get this text to behave as it would in a browser? How do I add the returns in to the text?

Thanks.

_t

Start_txt.htmlText = "<TAB>" How To Have Tags Written I HtmlText?
Hi!
start_txt.htmlText = "<TAB>";

How do I write so that the text <TAB> is written.
I have tried with in front of the tags, but nothing works.

Can't Cut HtmlText Tags
I got a xml that has tag:





<a href='http://www.google.com'><b>Bold link to google<b></a>

and this is loaded to htmlText text field. All works fine and dandy except that everything written after that is also a link to google. Also if I tag some text to different colour, everything after that continues to be that colour?

huh

HtmlText Working EXCEPT For <IMG Tags
What's wrong with this code?

headline_txt.html = true;
headline_txt.wordWrap = true;
headline_txt.multiline = true;
headline_txt.htmlText = "<img src='box.jpeg'><br>Wheres<br>the image?</br>";

The text and <BR> tags display but not the image. The image is in the same directory and is local and is non progressive.

Flash 8 Basic, Actionscript 2.0


Any ideas.

Omitted Spaces Around Tags In HtmlText
I fear this is something noob'ish but I copied some content from a feed and pasted it into a separate XML file. Now the spaces around my tags are missing when its published.

<p>my text that is, let's say, <b>bold</b> or something.</p>

comes out "my text that is, let's say,boldor something."

!prettyPrinting // didn't effect issue
condenseWhite // also didn't effect issue

b {dispay:inline;} // because it goes block

Any thoughts? -- still a lot of quirks dealing with htmlText

Spaces Appearing Before <p> Tags In .htmlText
I'm using the .htmlText function in ActionScript to format some text from an xml file however I seem to be having some trubles with 2 spaces being put before the start of each <p> tag. I've googled it but so far haven't come up with anything, I've used html in this manor before and never seen this.

I end up with paragraphs looking like this

So every line is starts indented.

Cheers

David

HtmlText: Whitespace Between Anchor Tags Disappears
Why does this happen? Make a textbox and assign it some text:


Code:
article.htmlText = "<P>this is a word <a href='www.google.co.uk'>link1</a> <a href='www.yahoo.co.uk'>link2</a></P>"
trace(article.htmlText)
Notice the space between the two anchor tags. Well, if you run this, the space disappears and the trac shows that flash has removed it:


Code:
<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Arial" SIZE="24" COLOR="#000000">this is a word <A HREF="www.google.co.uk" TARGET="">link1</A><A HREF="www.yahoo.co.uk" TARGET="">link2</A></FONT></P></TEXTFORMAT>

HtmlText: <img> Tags Invalidate Click Events
Here's the situation:

- I've got an XML file. It's got a CData area with text content, like so:


Code:
<textcontent><![CDATA[<b><u><a href="event:openPopUp and this is cool">This text
should open a popup</a></u></b> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed
diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
<img align="right" src="images/test.jpg" width="75" height="75">Ut wisi enim ad minim veniam,
quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
]]></textcontent>
I read that in and place it in a TextField object. That's all fine. Now, if the content is exactly as it is above, that will work fine. I can click my link and call my popup class just fine.

BUT

If I simply add another image into my content, it kills all of my links (even regular links to URLs). They are no longer clickable, you don't even get the finger pointer when you roll over them. The images and text all display fine, but the links die.

Any thoughts? This is a weird one.

Retaining Markup Tags In HtmlText Fields
Is it possible to wrap an XML object so that it's element tags are preserved (not parsed) if it populates a text field as htmlText? I'm trying to use XML in an htmlText field where other (non-XML) text is styled using CSS. I get the results I'm looking for (except for the CSS) when I populate the text field as plain text (not htmlText).

I tried wrapping the XML in a <![CDATA[]]> tag, but that too was parsed when used as htmlText.

Any ideas?

How To Edit HtmlText TEXT Without Bugging TAGS
I have a "title" field that is a TextField that contains htmlText and is formatted with a stylesheet. Sometimes we want the full title to appear, and other times we want to truncate it with an ellipsis. (...) eg "Raiders of the Lost Corona" or sometimes just "Raiders of the..."

I need to find a way to trim down the number of TEXT characters that are in the htmlText, without affecting the HTML tags.

I tried
fld.text=fld.text.substr(0, n) ... but of course this removes the HTML.
fld.htmlText=fld.htmlText.substr(0, n) ... breaks the XML
fld.replaceText() throws an error because I'm using a stylesheet.
I'm told this might be possible with a RegExp... basically delete one char from the end of the htmlText, while skipping over the tags... But I have no clue how... any Reg Exp gurus out there?

Can Image Alt Tags In HtmlText Fields Display?
I've been working on a project that up until now, has not been requested as accessible. I use the Flash accessibility in all my projects anyway so it's not that big a deal, but I am wondering if there are those out there with more knowledge on this topic?

I know that the ALT attribute in the IMG tag is supported when placed inside an htmlText field (all dynamically for my project). But how does Flash use it, or does it use it at all? I have a user that is expecting to see the ALT text when they roll over the image, but it's placed via html, not inside a movieclip, so I don't know if it's even possible.

Any information would be most helpful.

How Do I Embed The Stylesheet Into The Html Code?
i'm having trouble with the .css files with my flash page...

i was wondering.. how can i place the code inside my stylesheet onto the html page itself, so i won't have to try and refer to a sylesheet include anymore???

thanks, guys!

Embed Fonts CSS XML HTML Stylesheet
Hi All,

I've been trying everything with this issue so thought I'd put it out there to see if anyone can offer a solution or even advise if this is possible or not.

This is the scenario:

I dynamically create a textField.
I load an external CSS file into a stylesheet.
From an XML file I load HTML content into the textField via .htmlText
I have added the font to the library and have made it available for Export for ActionScript

The HTML has spans with classes eg:
<span class="boldText">Flash Flash Flash</span>

The CSS states:
.boldtext {
font-family:Anivers;
font-style:italic;
font-weight:bold;
font-size:16px;
}

IMPORTANT NOTE: The font I'm using does not have any other family members like bold or italic

Here is the problem.

Leaving embedFonts = false things work just fine. But obviously I need to embed this font so all can see it.

As soon as i set embedFonts = true I no longer get bold or italic.

Is this a case of because the font does not have a bold or italic the system it just rendering, or am I just missing something? For example the checkboxes in the font's properties where you can choose bold and italic. I tried these but no luck.

Any help would be greatly appreciated.

Regards,
jkaris

Changing Stylesheet On Html Textbox
Hi,

I have a dynamic textbox, "txtMain", it loads in html text and then I apply a CSS to it. All works great. Now what I want to be able to do is simply change the font-size at a click on a button i.e. make the text bigger. Here's my code so far (attached).


It doesn't seem to work, can anyone help?


Thanks,

Lilalfyalien







Attach Code

Code:

var format = new TextField.StyleSheet();
var path = "main.css";
format.load(path);
txtMain.styleSheet = format;
txtMain.text = htmlText;

then on the button handler:

Code:

on(release) {
format.setStyle("imagecaption", {fontsize:'30px'});
txtMain.styleSheet = format;
}

My stylesheet:

Code:

p
{
font-family: Arial, Helvetica, Verdana;

}
.imagecaption {
font-size: 24px;
font-weight: bold;
}
.normal {
font-size: 40px;
}

My HTML:

Code:

<p class="normal">This is normal</p><p class="imagecaption">This is image caption</p>

[MX04] HTML Tags Needs To Be Disabled In Dynamic Html Enabled Text Fields
Hi Buddies,

Am loading some dynamic text from an xml which has html tags inside dat text. I jus loading dat specified texts into a dynamic text fields where html is enabled and assisgned as a htmlText instead of normal text.

It works fine, but the thing is, i want to disable certain html tags to be rendered but it shud display as it is as a normal texts.
Is there any way to do dat

Dont Want To Render < HTML > Tags In HTML Enabled Dyna Text
Hi All,

Is there any way to display < HTML > tags in the HTML enabled dynamic text field with out actually rendering it ? one constraint is, I want to enable the HTML feature for that text field all the time. because, i want to render some other tags.

The problem is in my text field unable to display msgs having <> characters i.e. even if I say < hello > it is not displaying anything, because, it is treating it as HTML tag and trying to render it. Is there any work around to display this text as it is ??

Thank all in adv,

Html Tags In Xml Tags
Hi,

i've got this XML file - in it the tag below:

<level.one name="ql2<br>na">

i'm loading the xml into flash and i want to display the value of the attribute "name" inside a dynamic text box, i marked the "render text as html" BUT: inside the xml i can't put "<br>" because of the "<" ">" - so what do i put instead so reading the xml will be ok and flash can read it right?

thanks in advanced,
Maya.

Embedding Html In Xml Tags, When Rednering Text As Html
Quick question,

I have a site that reads all content from an external xml. The text box that reads this info renders the content as html; does anyone know how to go about putting an html tag in an xml tag so that flash can read it?

So would it be possible to do:
<content>
" Welcome to the site<br>we are happy to have you here<br><img src="logo.jpg"> "
</content>

HTML TextFields Using Html Tags During Creation
OK, so I have an html formatted textfield, if i was loading external text in from a file I could put stuff like "<ul><li><b>bullet1</b></li><li>bullet 2</li></ul>" in the external file and it would render. However when you set the contents of a textfield during creation you can set things like font size, bold etc but you can't choose bullets?!? or am I totally missing something here? I can input bullets using 'Alt-0149' like this --> • but then it doesnt do the indenting for you like the <li> tag would...

HTML Textfield Shows My Html Tags?
My html properties of my textfield are set on true and STILL he shows all my html tags? (property is set with actionscript AND in properties panel)

The XML with the html content looks like this:
====================================
<?xml version="1.0" encoding="utf-8" ?>
<texts>
<text><![CDATA[ <p>Vai kaut reizi esi</p>]]></text>
</texts>
====================================
Code:
var xmlTexts:XML = new XML();
xmlTexts.ignoreWhite = true;
xmlTexts.onLoad = function(ok) {
if (ok) {
var varText = this.firstChild.firstChild;
mvcText1.txt.html = true;
mvcText1.txt.htmlText = new String(varText);
//mvcText1.txt.htmlText = "<p> this is text </p><p> this is text </p><p> this is text </p>";;
trace("HTML set on "+mvcText1.txt.html);
}
};
xmlTexts.load("texts.xml");

HTML TextFields Using Html Tags During Creation
OK, so I have an html formatted textfield, if i was loading external text in from a file I could put stuff like "<ul><li><b>bullet1</b></li><li>bullet 2</li></ul>" in the external file and it would render. However when you set the contents of a textfield during creation you can set things like font size, bold etc but you can't choose bullets?!? or am I totally missing something here? I can input bullets using 'Alt-0149' like this --> • but then it doesnt do the indenting for you like the <li> tag would...

HTML Experts Please Come And See HtmlText
quoted from the AS dictionary - Preserving rich text formatting

The following HTML tags are supported in text fields: <A>, <B>, <FONT COLOR>, <FONT FACE>, <FONT SIZE>, <I>, <P>, and <U>.

The following HTML attributes are supported in text fields: LEFTMARGIN, RIGHTMARGIN, ALIGN, INDENT, and LEADING.



Would anyone show me the HTML syntax of LEFTMARGIN, RIGHTMARGIN, ALIGN, INDENT, and LEADING which are supported in text fields?

Thank you for reading my post!

Htmltext -> Html Links Inside Swf?
Hi, Im trying to use a link in some html text in a movie to call a func within the swf (not jump to an external site). Any way to tell an <a> html tag to call a flash function when clicked? Ive searched around and haven't found anything related, so perhaps its not possible?

Thanks in advance.

.htmlText Supported Html (Flash 7.02)
I've got a field on flash that's set by results of a web service...

I'm setting .htmlText and some of the code works, some doesn't...

CODEcoverify.htmlText = "<span style="text-align: center">" + "Verify online at:<br>" + "<span style="color: blue">" + _global.DData.CVER + "</span>" + "<br><b>" + _global.DData.CNAME + "</b>" + "</span>"

[ --HTML And IMG Tags-- ]
Masters,

Could someone please describe how I might utilize the images embedded in an HTML document while keeping their relation? I am using loadVaribableNum to load the HTML into a text field and I would like to pull the images from the html into a movieclip. (Picture an MSN news article)

I am building a Flash front-end to a backend tool that will be kicking out html pages in pretty much whatever format I need. (the backend is SQL/XML driven and XSL is formatting the info in usable HTML)

I have been the XML path already, but I really find Flash's XML capabilities limited and clunky (and procssor intensive)


Additional questions:

1. Will there be a limit to the size of the HTML doc being passed into the Flash text Variable?

2. Can I pull in an entire html doc without popping up another window?

Thanks in Advance,
RASTERB8

||||| Avenge the Innocent, God Bless America |||||

Html Tags
Where can I find a list of html tags supported by Flash 5?

Html Tags
hi! i just wanted to ask how the hell i must use the html tags on the text fields, cause i cant get any results on this.
The flash help wasnt enough for this stupid argentinian! i´m really sorry!
thanks a lot!

veddero9@hotmail.com

Html Tags In Xml
hello, i've been storing my data in xml files and loading their contents into flash.

what i'd like to do is be able to have tags in that data such as the "BR" tag and "A HREF" tag

the current format of my data is like this: (don't worry, i used < & >), it wouldn't post on the board correctly with the code tag...

[?xml version="1.0" encoding="UTF-8"?]
[root]
[entry]
[title]July 3rd[/title]
[body]today was boring.[/body]
[/entry]
[entry]
[title]July 2nd[/title]
[body]i ate food.[/body]
[/entry]
[entry]
[title]July 1st[/title]
[body]i visited this <u>site</u>.[/body]
[/entry]
[/root]

say for example, in the July 1st entry, the underlined word needs to be bold and a link.

i've been using an xml to object actionscript file in to make it easier to use xml, not sure if that would affect the data being parsed.

currently, the only method i know is to make up my own tags, like [b] and just parse the text with string fuctions/methods.

Still In Need Of Help...HTML Tags
Hy there!

Though linha direta has given me sample files (an I thank him for this) , I haven't solved the problem.
My problem is simple : I have two pages in HTML , both loading the same .swf file , wich contains only one field of dynamic text , with the variable named text.
The two pages have the titles (the tags corresponding) Home and Second page.
How can I read the tags (any of them , the titles are just an example)and initialize the text variable with them?
In , other words , how can I have the title of the current page in one flash file , loaded in both pages?
I use Flash 5.I don't have SSI or CGI acces for my server.

Tanks , in advance!Best regards!

XML And HTML Tags
Obvious you can't use HTML tags inside a node value in XML, right?

I come up with an idea inspired from this forum,
What if I create tags like in this forum and do a search and replace inside Flash when reading the XML file, that should work, right?

Other ideas

T

HTML Tags
I'm getting html based info (eg: <TABLE height="100" width="100%">) from a SQL database into flash. I figured out that flash does not understand all the html tags. Does anyone have an idea wich tags are understood by flash and wich ones are not?
Maybe a tutorial somewhere or a reference site?

Thx

Html Tags
Hi,
do you have experience with text formating? I'm using this script for dynamic text:

Code:
content_txt.htmlText += "<font size='12'><b>" + head + "</b>" + "<br>" + </font>" + body;
Strage is, that in one case it works fine, but in my recent project bold tag cause invisibility of "head". Without bold tag it's fine, I can change font size. It there any futiveness I have to be aware of?

Can These Html Tags Can Be Used ?
Hi buddies here are the html tags dat i have wimmi .... i jus wanna know whether these tags can be displayed in the specified format in a Flash Dynamic TextField or not

1. <pre>
2. <font face = arial size =2>
3. <br>
4. <i>
5. <u>
6. <b>
7. <p align="center">
8. <img src="/mtapplication/files/52352.jpeg"></img>
9. <a href="/servlet/MyFirstServlet">Make me say Hello World!</a>
10. <h1><h2>….<h6>
11. <hr>
12. <center>
13. <!-- Line 1 --><!-- Line 2 --> Like this also exist
14. <strong>
15. <sub>
16. <sup>
17. <span>
18. <li>
19. <ol>
20. <table>
21. <tr>
22. <td>
23. <th>
24. <div>


And more can i dispaly an xml string in a dynamic text box ???

HTML Tags In XML
I'm having some problems when inserting html tags in my XML file. I thought that because of the textField.html option, i could simply insert my html tags into the xml strings.


Code:
<?xml version='1.0' encoding='utf-8'?>

<pages>
<page header="<c>Info</c>" ...
those center tags surely messed things up so how would I do it?
Thanks in advance.

Using HTML Tags With XML
Hello everyone,

I have an XML document that contains CDATA nodes with <BR> tags. I'm importing the XML and displaying it in a text box, but unfortunately the text box is actually displaying the <BR> tags, rather than inserting line breaks. I've set the text box to "Render text as HTML", and I've applied the XML data through htmlText, but it's still not working. If I insert text into the text box manually it will render as HTML, as in:


Code:
textBox.htmlText = "Testing...<br>Testing...";
But if I apply the XML node, it just displays the <BR> tags, like this:


Code:
textBox.htmlText = my_xml.firstChild.childNodes;
Does anyone happen to have any idea why this is happening? I've included a .zip attachment that contains a sample .xml and .fla file that illustrates the issue I'm having.

Thanks!

Html Tags In Xml
I've look everywhere, I've try many things but I can't get it right. I just want use html tags in a xlm file.

xml:

<news>

<newsNode newsTitle="Titel 1" newsText="This mthe first news. Look at www.blabla.nl. It's a quit nice site...."></newsNode>

<newsNode newsTitle="Titel 2" newsText="This mthe second news. Look at www.blabla.nl. It's a quit nice site...."></newsNode>

</news>

I'd like to be able to use some html tags (<a href+...>, <b>, <br>...)

Action in Flash:

news_xml = new XML();
news_xml.onLoad = startnewshow;
news_xml.load("news.xml");
news_xml.ignoreWhite = true;
//
// Show the first news and intialize variables
function startnewshow(success) {
if (success == true) {
rootNode = news_xml.firstChild;
totalnews = rootNode.childNodes.length;
firstnewsNode = rootNode.firstChild;
currentnewsNode = firstnewsNode;
currentIndex = 1;
updatenews(firstnewsNode);

}
}
//
// Updates the current news with new image and text
function updatenews(newnewsNode) {
newsTitle = newnewsNode.attributes.newsTitle;
newsText = newnewsNode.attributes.newsText;
targetClip.loadMovie(newsTitle);
}
//
// Event handler for 'Next news' button
next_btn.onRelease = function() {
nextnewsNode = currentnewsNode.nextSibling;
if (nextnewsNode == null) {
break;
} else {
currentIndex++;
updatenews(nextnewsNode);
currentnewsNode = nextnewsNode;
}
};
//
// Event handler for 'Previous news' button
back_btn.onRelease = function() {
previousnewsNode = currentnewsNode.previousSibling;
if (previousnewsNode == null) {
break;
} else {
currentIndex--;
currentnewsNode = previousnewsNode;
updatenews(previousnewsNode);
}
};

I hope someone can help me.

Thanks

Html Tags In Xml (one More)
I can' t find the solution of my problem in other thread. So I hope someone can help me.

My xml:


Quote:




<?xml version="1.0" encoding="iso-8859-1"?>
<news>

<newsTitle>
<![CDATA[
<a href="http://www.worfoual.com">Dit project biedt</a> nieuwe leden van de BNO <i>(Beroepsorganisatie Nederlandse Ontwerpers)</i> de mogelijkheid om ansichtkaarten te laten produceren bij Spinhex & Industrie. Voor spelregels zie www.bno.nl
]]>
</newsTitle>

<newsTitle>
tweede nieuws nieuwe leden van de BNO (Beroepsorganisatie Nederlandse Ontwerpers) de mogelijkheid om ansichtkaarten te laten produceren bij Spinhex & Industrie. Voor spelregels zie www.bno.nl
</newsTitle>

</news>




My actionscript:



Quote:




news_xml = new XML();
news_xml.onLoad = startnewshow;
news_xml.load("news.xml");
news_xml.ignoreWhite = true;
//
// Show the first news and intialize variables
function startnewshow(success) {
if (success == true) {
rootNode = news_xml.firstChild;
totalnews = rootNode.childNodes.length;
firstnewsNode = rootNode.firstChild;
currentnewsNode = firstnewsNode;
currentIndex = 1;
updatenews(firstnewsNode);

}
}
//
// Updates the current news with new image and text
function updatenews(newnewsNode) {
newsTitle = newnewsNode.attributes.newsTitle;
newsText = newnewsNode.attributes.newsText;
targetClip.loadMovie(newsTitle);
}
//
// Event handler for 'Next news' button
next_btn.onRelease = function() {
nextnewsNode = currentnewsNode.nextSibling;
if (nextnewsNode == null) {
break;
} else {
currentIndex++;
updatenews(nextnewsNode);
currentnewsNode = nextnewsNode;
}
};
//
// Event handler for 'Previous news' button
back_btn.onRelease = function() {
previousnewsNode = currentnewsNode.previousSibling;
if (previousnewsNode == null) {
break;
} else {
currentIndex--;
currentnewsNode = previousnewsNode;
updatenews(previousnewsNode);
}
};





The html tags are NOT working. WHY, what am I doing wrong?

HTML Tags In XML
is there a way to add simple text formatting HTML tags in an XML doc that gets loaded into a flash text field?

TIA

Copyright © 2005-08 www.BigResource.com, All rights reserved