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




HtmlText Problems



Im trying to do a basic htmlText <href> link, im pretty sure i have my XML well formed, and i've tried CDATA, plus lt;A HREF="..."> etc.

The thing is the text shows perfectly, untill the link itself, after that it doesnt show anything, im guessing either its a stilying problem since the font is embeded, or something of that sort...

Anyone ever had a similar problem ?



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 10-13-2006, 04:57 PM


View Complete Forum Thread with Replies

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

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.

HTMLText?
this is what I do,
T_TEXTFORMAT = new TextFormat();
T_TEXTFORMAT.font = "VerdanaBold";
T_TEXTFORMAT.size = 10;
T_TEXTFORMAT.color = 0x000000;

function FormatPaneText(TextBox) {
TexBox.html = true;
TextBox.border = true;
TextBox.background = true;
TextBox.backgroundColor = "0xcccccc";
TextBox.multiline = true;
TextBox.wordWrap = true;
TextBox.autoSize = false;
TextBox.embedFonts = true;
TextBox.setNewTextFormat(T_TEXTFORMAT);
TextBox.setTextFormat(T_TEXTFORMAT);
}

MC.createTextField("TXTValue", i+2, 0, TEXTy, paneWidth, 20);
FormatPaneText(MC["TXTValue"]);
myText = eval(PaneName add "Array")[1];
MC["TXTValue"].htmlText = myText;

////////////////////////////////
I have another TextField that this works on, the only difference is that I don't Create that one it's already on stage. But this one I create and the HTML text doesn't appear at all.

Please Help.

Thanks

Maybe I should ad that this text field is then set to a Scrollable Pane

HtmlText And Xml
how can i include html formatted text within an xml document to be loaded into a dynamic text field in flash? I can't seem to get it to work...

thanks,
dave

HtmlText
Does anyone know of a good place to learn about htmlText in the MX text Field? The output html is does not work in a browser. I need to learn more about it and what tags the flash version has.

Thanks,
TheBigOnion

HtmlText
I am trying to format a Dynamic text box using the htmlText option and only a very limited amount of html commands are working. I thought that BOLD Tags and Italic Tags worked with this option. Am I wrong?

Here's what I have done:

1. Create a dynamic text box and mark it for html formating.
2. Create some buttons, that once pressed, place text in the dynamic text box. I have included Bold Tags, which don't work. The only tag that does seem to work is the (<br>), I have enclosed this tag here because I'm not sure if it would be read as html or not within this message.

Thanks for all of your help.

HtmlText <br> Tag
i have a simple text field with html=true and htmlText=hi<br>hi

why does'nt the <br> show

i get:
hihi

i want
hi
hi

i have attached the files im using.

thanks!

HtmlText ?
I want to format specific text in a dynamic texfield to a certain color

The code i am trying to use is

_parent.strCheck_txt.htmlText += "<font color=#ff0000>_</font> different color text";



But this method dose not work... anyone know why? Is there another method i could use

Bug In HtmlText?
ok compare these two html text entries:

T.htmlText = "<P ALIGN="CENTER"><FONT SIZE="20" COLOR="#ED2024">HEADLINE<FONT COLOR="#FFFFFF"> X <FONT COLOR="#8AC056">HERE</FONT></FONT></FONT></P>";

with

T.htmlText = "<P ALIGN="CENTER"><FONT SIZE="20" COLOR="#ED2024">HEADLINE<FONT COLOR="#FFFFFF"> <FONT COLOR="#8AC056">HERE</FONT></FONT></FONT></P>";

If you plug these into a TextField with html text turned on you'll see what it does.

On the first one it works like expected.
On the Second there should be a space inbetween "Headline" and "Here" but it completely ignores the space.

if you use &nbsp; that works fine but this is a dynamic text box i'm using and when you press the space key it does not enter a &nbsp;

Does anyone know how to fix this? or a work arround?

HtmlText
Hey,

Im having trouble getting the htmlText working. It works fine with .text but when I change it to .htmlText the it doesnt appear.
Cant figure out why, any suggestions?

Thanks

HtmlText
[HTML]title_txt.htmlText="<font color=’#FF0000’>hello world</font>"[/HTML]

Why wont this work. I have my textfiled on the stage and the buttons html text is selected in the property panel

Using HtmlText
Hi there.

My_Button.title_txt.text = named[i] + "(NEW)";

With this code I'm adding (NEW) onto the end of what an Array called "named" contains at position "i". The Array contains the names of video clips, so I'm ending up with, for example:

My Video (NEW)

My problem is that I need the "(NEW)" to be in a different colour to the "My Video". Is there any way of doing this?

Thanks

Htmltext And Img Tag
Hi ! I'm trying to load an embed image into an htmltext...

It nearly works here is the code (Flex)


Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
[Embed(source="eighth.png")] public var iconEighth:Class;

]]>
</mx:Script>
<mx:TextArea width="100%" height="100%">
<mx:htmlText>
<![CDATA[
<p>You can include an image in your HTML text with the
<img> tag.</p><p><img src='test2_iconEighth' width='30' height='30'
align='left' hspace='10' vspace='10'>Here is text that follows the image.
I'm extending the text by lengthening this sentence until it's long enough
to show wrapping around the bottom of the image.</p>
]]>
</mx:htmlText>
</mx:TextArea>
</mx:Application>
So the image appears but only in the top left corner..... if I use "eighth.png" instead of the linkageID it works perfectly so what is wrong ????

Thanks !

Help On HtmlText...
Hi guys, i used htmlText to load my html text file to the Flash actionscript but the hyperlinking part is not working.
In my html file, i tried to hyperlink e.g:
<a href='http://www.tradenet.gov.sg/trdnet/index.jsp?catName=7&artName=10349&url=/html/32_List_of_Controlled_Goods_-_Exports.html'> to a word, it's not working and the below text would disappear. However, if i wanted to change the url to this:
<a href="http://www.tradenet.gov.sg/trdnet/index_home.jsp? "target="_blank">
Then it's working. So i think the error is due to '&' sign and i tried to use'&amp' but it's still not working, what should i do? and if i were to use other methods to link complicating url in html file to be loaded in flash, what method should i use?

HtmlText
Hello,
How can I find out size and font of a htmlText string?
Thanks

HtmlText Img
I'm relatively new to AS3 (started work two days ago in it), and I'm having trouble formatting an image in TextArea via htmlText. My goal is to have the image appear to just be there, not in any box. I've tried playing with several properties, and I can't get it.

Attempt 1 was to set the alpha property,
field_area.alpha=0;

This was successful at removing the background on all of my TextAreas that had other html in them, but it made image disappear as well.

Attempt 2 was to set the padding to 0,
field_area.setStyle("textPadding", 0);
field_area.condenseWhite = true;

This was successful again with the TextAreas that had other Html, but seemed to have no effect on the one with the <img> tag.

Any suggestions would be greatly appreciated!

Thanks,
Brian

XML And HtmlText
I have an XML file that I'm loading into an htmlText enabled text field. The XML has HTML throughout it like this:


Code:
<News>
This is some <b>big</b> news.<br><br>And this <i>isn't</i> so big!
</News>
My text field is showing the HTML tags sometimes and not other times. Any suggestions? Thanks.

Selfminded

HtmlText
I need to create a Flash website that retrieves its data from a mySQL database. The client, however, would like the text to have all the basic formatting posibilities of html text. In other words they would like to be able to have some words bold, italic or coloured and text to flow around images.

How do I do this? I am assuming the only way to do this is to make use of html tags and display the text in flash as htmlText but what's the best way to get the html formatted text into the database? Do I create a CMS that uploads the text into the database as html formatted and when I pull it out of the database through PHP will the formating remain intact or become just a long strong? I need some guidance here. Thanks

HtmlText
I have text field and I have htmlText in the properties, and it supports tag '<img>'... but how I use?
An example? because not working with me =/

Thanks,
Mello

[fmx] HtmlText
Hi, i just arrive. I'm brazilian and i think that i'm writing like an indian. ..no matter, sorry about the english.

well, how i align a dinamic text loaded to the right ?? I'm using htmlText..

THANKS

Img Tag For HtmlText
i'm trying to embed smilies into my htmlText for a text field.

i can get one smilie to work. but it always aligns to the left. how do i get it to stay positioned with the text?

also, if i use more than 1, only 1 shows up. what's up with that?

has anyone done this?

thanks

Htmltext?
hi everyone

is it possible to use htmltext to make a word or sentence clickable, to make an a.s. work. i.e. gotoAndStop() or changing a dynamic textfield. Or is there a work around with something like substr() to make the word clickable.

thanks,

Ric

Help On HtmlText
Hi guys, i used htmlText to load my html text file to the Flash actionscript but the hyperlinking part is not working.
In my html file, i tried to hyperlink e.g:
<a href='http://www.tradenet.gov.sg/trdnet/index.jsp?catName=7&artName=10349&url=/html/32_List_of_Controlled_Goods_-_Exports.html'> to a word, it's not working and the below text would disappear. However, if i wanted to change the url to this:
<a href="http://www.tradenet.gov.sg/trdnet/index_home.jsp? "target="_blank">
Then it's working. So i suspect that it's the complicated url behind(got the catName=7&artName=...) that makes the flash unable to read. What should i do?

[fmx] HtmlText
Hi, i just arrive. I'm brazilian and i think that i'm writing like an indian. ..no matter, sorry about the english.

well, how i align a dinamic text loaded to the right ?? I'm using htmlText..

THANKS

HtmlText
Is there a reason a line break <br> would not work in a dynamic textfield?



HTMLtext & The <li> Tag
I am reading data into Flash via PHP/MySQL. The textbox is populated via the script:


ActionScript Code:
nArticle.htmlText += tbNews[i];


where [i] is a value of the array. The problem I'm having is with the < li > tag in that once a record containing this tag is displayed, every record after it is bulleted.

Prior to refreshing the data based on the users selection, I am clearing out the textbox with:


ActionScript Code:
nArticle.htmlText = "";


So, I can't figure out why the bulleted lists continue. What am I doing wrong here??

AS2 - HtmlText + <img> = Bug?
Hi, I have a function which I call in to create an html enabled textfield to show some content and its working perfectly except that while loading there's a split second (before the images inside the html render into the field) where flash shows a white rectangle, the size of the textfield, then it disappears and the content appears.

Here's the function I'm using:

PHP Code:



function createHTMLTf (hld:MovieClip, nam:String, dep:Number, xpos:Number, ypos:Number, wid:Number, hei:Number, txt:String):Void {
    var tf:TextField = hld.createTextField(nam, dep, Math.round(xpos), Math.round(ypos), Math.round(wid), Math.round(hei));
    
    tf.antiAliasType = 'normal';
    tf.autoSize = 'left';
    tf.background = false;
    tf.border = false;
    tf.embedFonts = true;
    tf.multiline = true;
    tf.selectable = true;
    tf.type = 'dynamic';
    tf.wordWrap = true;
    tf.html = true;
    
    tf.htmlText = txt;





Anyone has experienced this before or knows a workaround?

Can The HtmlText Be Used In The Following Example
I found this example tutorial and it's exactly want I need except the text in the pop-up needs to be htmlText in order to incorporate a couple hyperlinks inclusive of some additional text.

Based on the follwing example can this be done?

example

Thank you.

+ And % In HTMLtext Field
Okie, feeling stupid,

what do i need to do to display + and % symbols in a html text field,

Thanks,

Chi

HtmlText And Hyperlinks
Hey guys, maybe some of you can help with a question i have.

im loading information from a database, and displaying it in an htmlText text field...that in itself is fine, the thing is the hyperlinks which will bring up the more detailed information of the event opens up in a new window.

Ideally i want to call a function that tells a movie clip to play and load the required details, (and im sure i have seen some solution to this somewhere but cannot find it now) but i dont know if or how this is possible using the html formatting within this text field.

thanks in advance

HtmlText And TextField
I am trying to load htmlText into a textField from a xml file. The htmlText contains wingdings font.

I use the following code.

_root.createTextField("myText",1,100,100,300,100);
myText.html = true;
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(success) {
myText.htmlText = this.firstChild.firstChild.nodeValue;
}
myXML.load("test.xml");

The test.xml is as follow.

<item>
<![CDATA[<p align="center"><H4 align="center"><b>
<font face="WINGDINGS"><font color="#000080">a</font></font>
<font face="ARIAL"><font color="#000080">——</font></font>
<font face="WINGDINGS"><font color="#000080">a</font></font></b></H4></p>]]>
</item>

However, all the text in the textField appear in Arial font.
Can anyone tell me how to display Wingdings font as well as other fonts properly with htmlText?
Thank you very much!!!

HtmlText + Hyperlinks
Hello,
I'm trying to highlight the hyperlinks in a htmlTextField in flash, when the user already visited this link. but I can't find a solution.
Does anyone here have an idea, or already did this.
I would realy appreciate it.

Kind regards

Htmltext, Access DB And ASP?
i'm trying to create a news page in my flash website.
I can have a ASP script that reads stuff from a Access database but how can i have all those results displayed in flash? using a box .htmltext or duplicatemovieclip?

I would have something like

date:
Title:
Content:

10/10/03
New somthign addes
asdf asdf asdf asdf asdf asdf

10/09/03
Another news
asdfasdfasdfasdfasdfasdf


10/07/03
Another news
asdfasdfasdfasdfasdfasdf

All that inside a txt box

thanks!

Htmltext Question
If you check out jweintraub.com and click on the portal button the text in my dynamic text box will not render the html, however if you click on either profile or resume then click on portal it does render the html.

Any ideas as to why that is happening. The only thing I can think of is that there are a lot more links in the portal text file

Any help would be appreciated

Any Way To Style HtmlText In FP6?
I know FP7 supports CSS for htmlText in dynamic fields. But whatabout FP6? Is there any way to, for instance, color links differently etc, inside a dynamic text field in Flash Player 6? I guess you could do a lame font color= tag but then there's no hover interactivity.

[MX] HtmlText Loop
Using this loop


Code:
for (i=1; i<=pageTotal; i++) {
_root.page_txt.htmlText += "<b> " + i + "</b>";
}
I get these results in my text file

1
2
3

Whereas I'd like the results to stay on the same line and come out as

1 2 3

Is there a way I can do this?

Textfield.htmlText
I've done some research in Moock's Actionscript for Flash MX, but still running into issues.

I have text variables being passed into my flash movie that need to be in the same paragraph but can be one of 3 types: title, url, blank. Each one goes on a separate line. My code seems to be creating the html string properly, and when I create a textbox with the authoring tool, instead of with code, and set it to html = false, it displays the html string. However, when I enable html, it displays nothing.
Next I tried creating a text field with code, however, it still will not display the text. One thought is that there is a limit on how many characters a string can hold? If so, what do I use instead? My code is below:
Make the text string (this works fine)

Code:
function makeText(){
for(i=1; i<=13; i++){ //13 is the number of lines available for display
if(_root["linksAkey_"+i] == 0){ //blank line
_root.Astring += '<BR>';
}else if(_root["linksAkey_"+i] == 1){ //title line
_root.Astring += '<FONT COLOR=#B5BD8E>';
_root.Astring += _root["linksAname_"+i];
_root.Astring += '</FONT><BR>';
}else if(_root["linksAkey_"+i] == 2){ //url line
_root.Astring += '<FONT COLOR=#FFFFFF><U><A HREF=http://';
_root.Astring += _root["linksAurl_"+i];
_root.Astring += '>';
_root.Astring += _root["linksAname_"+i];
_root.Astring += '</A></U></FONT><BR>';
}
}
}
Make the textbox and display _root.Astring (not working)

Code:
this.createTextField("linksA", 10, 10, 162, 150, 209);
this.linksA.html = true;
this.linksA.htmlText = _root.Astring;
this.linksA.type = "dynamic";
this.linksA.embedFonts = true;
this.linksA.setTextFormat(_root.typewriter12);
this.linksA.multiline = true;
this.linksA.wordWrap = true;

Htmltext And GetCaretIndex
Does anyone know of a good hack to retreive the caret position of a textfield_txt.htmlText, based its textfield_txt.text position?

Dos

Problems With HtmlText
I have some html text that I am dynamically generating that involves the concatenation of variables.

Only the first part of the message is displayed.

here is the code:

***********************************

for (b=1;b<=crank;b++){
temp= ["<img src=rightarrow.gif align='left'> "+ _root.benefits[b] + "<br>"];

benefitoutput=benefitoutput+temp;

}


tmessage="<b>Key benefits : </b><br>"+benefitoutput;
_root.output.html=true;
_root.output.htmlText=tmessage;


***********************************
In this situation, html formatting is on, but it only displays the words "Key benefits" The rest, which is a bunch of concatenated stuff, is not displayed at all.

Does anyone know why this is happening and how to fix??

Mytext.htmlText
Hello
i've got a dynamic text field with var=strProduct (from the database:http://www.address.com)
i would like to get this text as an url into mytext field
i know it's something like this, i can try to put the var into it but no succes, idon't know how to organized the var. thank's
mytext.htmlText="<a href='.......'>........<a>"

it's not working at all

on my first frame


onClipEvent(data)
{
strName = Name;
strTelephone = Telephone;
strCity = City;
str Product = Product;
strNotes = Notes;
strPosition = "Record " add String(CurrentRecord+1) add " of " add String(TotalRecords);
}

onClipEvent(load)
{
CurrentRecord = 0;
loadVariables ("getdetails.asp?Record=0", this);

}


thank's 4 reply
xcear

HtmlText Problem
I have a textField and I am using it's .htmlText property. when i set preferences to flash player 6 '<br>' tags do what they are supposed to do and create a new line. if i set preferences to flash player 7 the '<br>' tag does not work. anyone know why. i need to use player 7 becase i need to be able to modify the context menu; so using player six is not an option.

thanks

.htmlText Links(MX)
I am tryng create a links page using .htmlText but cant get it working.

The information is loaded from a .txt which appears to work ok.

I have attached the .fla and .txt files, if someone can show me where im going wrong it would be much appreciated!

HtmlText Leading And XML
I'm importing a restaurants menu written in XML but it seems it is adding a few extra hard returns between nodes.

If I use a couple lines like this


Code:
<dish4>
Gourmet Pizzas with Basil Pesto, Mozzarella, and Goat Cheese Tomato Sauce also available
</dish4>
<dish5>
Chicken Satay with Toasted Coconut, Almonds and a Ginger Soy Dipping Sauce
</dish5>


There will be two hard returns between each entry. How do I change that?

HtmlText Align
how do i align with htmlText? Im using MX.

i have:
code: _root.textMC.htmlText = "<b>Hello World</b>";

how do i align it? centre right etc.

HtmlText Using Br BIG PROBLEM
Hello
I am using flashMX 2004, and I am typing the attached code:

_root.createTextField("t_txt", 0, 20, 20, 0, 0);
t_txt.autoSize = true;
t_txt.condenseWhite = true;
t_txt.selectable = false;
t_txt.html = true;
t_txt.htmlText = "hi<br>hi";


the resault is shown with no new line : "hihi". if i set the player to be flash 6.0 the new line is shown. how can i fix the bug/problem?

PLEASE HELP
ADI

HtmlText Shows Nothing
I have 3 dynamic text fields vertically aligned, and one of them needs to be able to link to another web page. So I figured an easy way to do this would be to make it an HTML field.

Here is my code:


Code:
_root.text_Client = myImagesInfo[theNumber].imageClient;
_root.text_Title = myImagesInfo[theNumber].imageTitle;
_root.text_Agency.html = true;
_root.text_Agency.htmlText = '<a href="'+myImagesInfo[theNumber].agencyURL+'">'+myImagesInfo[theNumber].imageAgency+'</a>';


text_Client and text_Title work just fine. However, the there is no text in the third dynamic text field.

If I do remove the htmlText:

Code:
_root.text_Agency = '<a href="'+myImagesInfo[theNumber].agencyURL+'">'+myImagesInfo[theNumber].imageAgency+'</a>';


I see everything, the text and the HTML (html is not rendered).

Any ideas? I'm not sure what else to try...

Thanks
Tyler

Combobox & HtmlText
is there any way to set html text in combobox ?? in my dropdown i want to show some label in bold and some in normal is it possible?

HTMLText And ClipEvents
I've created text boxes that are embeded into a Movie Clip. The text boxes are using HTMLText that is displaying imported strings that contain URL links.

Everything works fine until I assign a ClipEvent to the above-mentioned movie clip. Once I do that, the links in my imported strings no longer work.

Is there a work-around for this? Did I do something wrong? Have I been bad?

HtmlText In Scrollpane Is This Possible ?
I cant make htmlText in scrollPane component.

I wonder if its me or the component limitation, if its the component limit I may need to implement a more useful component or solution, any ideas on that as well. I don't want to build scroll bars again. Components were supposed to make things easy!

HtmlText & Scroll
Can I utilize the scroll property w/ htmlText and if so, how?

right now this is what I have, for example:


Code:
var loadedVars = new LoadVars();
loadedVars.load("someFile.txt");
textInstance.html = true;
textInstance.htmlText = loadedVars.var1;

instanceName.onPress = function(){
textInstance.htmlText.scroll++;
}

HTMLtext Image Help
I am having trouble getting an image to show up in my textbox which is set for html code.

I have used the normal <img src = 'images/imagename.jpg'> code placed right before the </font> of the last of my text. the closest I could come was that right before the end of my box, which I have made into a box with a scrollbar, using the component option, It shows a couple pixels of the top of the image, but the image is cut off the bottom. Any help here would be nice.

I had another question as well. In order to make it easier, I was wondering if there was anyway to tel how much space my html text is going to take up without having to preview it. It would make it easier because I have a frame that slides in around it, and at this point I have to use guess and check for the html box size.

Thanks

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