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




Printing XML In Textfield In List Not Line



ve got my content to print into my text field with no XML using text();
But, it always prints in one long line. How can I tell it to line break after it prints each node?

This is basically my code right now


Code:
function ParseClients(clientInput:XML):void {

//trace("XML Output");
//trace("------------------------");
//trace(clientInput.Client.Automotive);

var clientAttributes:XMLList = clientInput.Client.attributes();

for each (var clientIndustry:XML in clientAttributes) {

clientXML.field_01.text = clientIndustry;
clientXML.field_02.text = clientInput.Client.attributes()[1];

clientXML.clientfield_01.text = clientInput.Client.children().text();

}



}



KirupaForum > Flash > ActionScript 3.0
Posted on: 08-25-2008, 08:34 PM


View Complete Forum Thread with Replies

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

Vector Printing Of TextField. Part Of TextField Not Printing.
Hi, I hope somebody here can help me.
I have a movieclip with a dynamic textField in it.
I set autoSize = "center" and fill it with text.
Then, if i then use PrintJob.addPage("myPage", {printAsBitmap:false}); , the bottom few lines of the textfield don't print.  (The textField shows up fine on the screen.)

The textField shows up fine if I use {printAsBitmap:false}, allbeit in lower quality.

If anyone can make a dynamic textField print properly as vector, please lemme know.

thx,
miguel3d

Reading Textfield Line By Line ? Selecting Multiple Textfields At Once ?
OK i need some serious help/advice !

I`m trying to make a sort of program like word , i want to have a text field , but the problem comes when i want to create like borders around each line of text and have DIFFERENT background colors for each line.
So i was thinking if i can read line by line and get get the height of each line by examining char by char for it's size and get the biggest one ( since my text may have different fonts sizes ect on a single line) and then have like BLOCKS that are behind each line and adjust their sizes accoring to the line size and change their color also.

Also another thing that I would also want to do , i want to create a table which i did , but now how do i put the table into my text ...and not just lie on top blocking text behind it ..how do i like "push" the text around it ?? ANY IDEAS would help...thats why i thought maybe create lots of textfields just stacked from top to bottom..but then i will have the problem of selecting them all at once like in a REAL word processing problem...and also if the text becomes too big it will need to "flow" into next textfield...

Is there ANYWAY to do this ??! HELP ME!!!!

THANK YOU

Printing A TextField
hello :p Me again,

Posting separate messages for each of them problems.

Does anyone know how one can specifically print a dynamic text field, is there a suitable print command which does that. Or, can i have an external text file and print that file(?)

I think flash only offers options to print frames, but the text in the dynamic text field is scrollable and i want to print the entire text with one command.

Thank you.
Abhay

Printing A TextField
hello :p Me again,

Posting separate messages for each of them problems.

Does anyone know how one can specifically print a dynamic text field, is there a suitable print command which does that. Or, can i have an external text file and print that file(?)

I think flash only offers options to print frames, but the text in the dynamic text field is scrollable and i want to print the entire text with one command.

Thank you.
Abhay

Printing Contents Of List Or Tree UI Component
I have an accordion component that contains 3 list components and 2 tree components...there are all the components from the flash library of components...and I need to print the contents of these 5 "lists"

For now I'm concentrating on the lists...then I will worry about how to print the trees with all the nodes expanded...but I can't seem to figure out how to determine how many items are in a list...for the lists I am not using dataProvider so I'm kinda lost here...any ideas?

Printing Contents Of List Or Tree UI Component
I have an accordion component that contains 3 list components and 2 tree components...there are all the components from the flash library of components...and I need to print the contents of these 5 "lists"

For now I'm concentrating on the lists...then I will worry about how to print the trees with all the nodes expanded...but I can't seem to figure out how to determine how many items are in a list...for the lists I am not using dataProvider so I'm kinda lost here...any ideas?

Printing A Scrolling Textfield
I've tried targeting the textfield var like so:
on (release) {
printAsBitmap("_root.fader1.containerMC.daTextBox" , "bmovie");
}

but all it does is print out the clip containing it, which is not showing all the text

Any ideas?

Somebody has suggested copying the contents into a new text field which woud be taller than the actual movie, does anybody know how to do this dynamicaly.
Also I am pulling the text in from an html formatted .txt file

cheers

j

Printing A Scrolling Textfield
I need to print a textfield from Flash. I have a multiple choice quiz where the questions and answer choices are loaded from an XML document. The questions are displayed one and a time while the user is going through the quiz, and then at the end a textfield displays all of the questions and answers, as well as which answers are correct and what the user's choice was. Works just fine onscreen, but when I try to print (using a button within the .swf, not using the print option in the browser) the text gets scaled to all fit on one page.

I'm using Flash MX, and the printing code on the print button is:

print("_root.printMe_mc", "bframe");

where printMe_mc is the movieClip containing the textfield, which has one frame with the #p label where the textfield is displayed in its entirety (not scrolling, just one long field).

Printing occurs, the only problem is the scaling of the text. How do you tell Flash not to scale the text, but to print to multiple pages if necessary?

I've tried using "bmax" and "bmovie" for the bounding box parameter, with the same results -- everything scaled to fit on one page.

Do I need to determine how many lines per page I want to print and manually parse through the textfield, dividing it up into "page size" chunks and display those chunks in separate movieclips, created on the fly (maybe?)and then print those?

Any tips, tricks, clues, or brilliant ideas would be greatly appreciated!
Thanks,
Cindy

Printing Textfield Target Instead Of MC
I don't have a printer at home so I can't test this.

I have a client with a scrolling textbox, they want the text in the box to print.

The print function, as I understand prints whatever's in the frame, within the specified bounding box.

If for a target I give it a variable containing text instead of a MC reference, will it just print the text?

Printing A Dynamic TextField
I have a dynamic text field with a UIScrollbar. I am have problems with printing the content of the textField. If I set the print function to print the textField I get the following error -

TypeError: Error #1034: Type Coercion failed: cannot convert flash.text:


Any help would be welcome

Printing A Dynamic TextField
I have a dynamic text field with a UIScrollbar. I am have problems with printing the content of the textField. If I set the print function to print the textField I get the following error -

TypeError: Error #1034: Type Coercion failed: cannot convert flash.text:


Any help would be welcome

Printing A Dynamic TextField
I have a dynamic text field with a UIScrollbar. I am have problems with printing the content of the textField. If I set the print function to print the textField I get the following error -

TypeError: Error #1034: Type Coercion failed: cannot convert flash.text:


Any help would be welcome

Printing Contents Of TextField
Is there any way to print the contents of a textfield or string using the pring command in AS?

Printing A Dynamic TextField
I have a dynamic text field with a UIScrollbar. I am have problems with printing the content of the textField. If I set the print function to print the textField I get the following error -

TypeError: Error #1034: Type Coercion failed: cannot convert flash.text:


Any help would be welcome

Printing Contents Of TextField
Is there any way to print the contents of a textfield or string using the pring command in AS?

Black Line On The Left Margin When Printing
The printing functionality for a coloring book app working great in AS2. After porting to AS3 users get a black border on the left side of the page.

Have anyone had this problem or know of any solutions?

Thanks in advance for your time.

Printing A Movie Clip And Textfield?
I have loaded an swf as a variable in a movie clip. This is how:
pic1 = mov1.swf
loadMovie (/ic1, "lp1");

Now I want to print this movie clip which is actually the swf 'mov1'. I have used both print and printasBitmap options, but none works. All I am getting is black lines when using print option and blank page when using printasBitmap option. I am using the following code to print:
on (release) {
printAsBitmap ("lp1", "bmovie");
}
I have taken a second frame in movie lp1 whose label is #b and there I have drawn a rectangle which I believe would be taken as the bounding box for the movie to be printed. Isnt this right??
Could anyone tell me what the problem might be??
Also theres another textfield on the same frame as the movie clip which i want printed, is there a way??

Error Printing TextField With BevelFilter.
Hi,

I have a movie clip with a TextField that has a BevelFilter. When I run my movie everything is OK, but when I use the PrintJob to
send it to the printer it seems the textfield has lost filter properties. In the page printed by the printer has the textfield without the BevelFilter. Why????? Could anyone help me???

I need to solve this problem as soon as possible.
Thanks for everything.

Dynamic Textfield Printing And Linking
I have a dynamic textfield which i fill with HTML-text from an XML-file. This exceeds one page, and I would like to print it on several pages. How can I do this, when I use printjob.start it only prints one page...? And is it possible to track a word that is clicked? (to use as a link to other pages..)

Printing Dynamic Textfield Content
There have been some topics with this title but none of them seems to solve the problem of printing the dynamic text content which is by the way also a scrollable text. I manage to print only what is seen but not the whole text.

Is there anyone who could help. I am attaching my fla which is used only for testing purposes.

Thank you in advance

http://www.galahala.com/print2.zip

Dynamic Textfield Printing And Linking
I have a dynamic textfield which i fill with HTML-text from an XML-file. This exceeds one page, and I would like to print it on several pages. How can I do this, when I use printjob.start it only prints one page...? And is it possible to track a word that is clicked? (to use as a link to other pages..)

Printing Hidden Contents Of Scrollable Textfield
Hey guys,
Do you have any idea as to how to print the text inside a dyanamic textfield. now the problem is that the textbox is say 100/100 pixels and has a scrollbar attached to it and is set to multiline. Now is there a way to print all the text of the dynamic textfield.

Please respond ASAP...

Images Embedded Within Dynamic TextField Not Printing
Not sure if there's already a thread on this, but my issue is that images that are embedded within a dynamic textfield via XML are not showing up when I try to print using PrintJob. The images are showing up properly within the textfield on the screen, but not in the print preview (and of course not in the final print).

The print functionality is fairly straight forward, I have a MovieClip that contains one dynamic textfield. The textfield is populated by XML and CSS files.

Printing All Text In A Dynamic Scrollable Textfield
Hi,
I have search alot about solutions for solving the problem about trying to print all text in a dynamic Scrollable Text. There is no answer for this. So, is there a simpel way to print all the text in a dynamic scrollable textfield?

Because the text is dynamic, there is possible that the text can be 1- 100 pages.

Please help me out.
niklas@bafe.nuniklas@bafe.nu

[MX04] Printing All Text In A Dynamic Scrollable Textfield
Hi,
I have search alot about solutions for solving the problem about print all text in a dynamic scrollable textfield. There is no answer for this. So, is there a simpel, or any way to print all the text in a dynamic scrollable textfield? Not just the text you see on the screen.

Because the text is dynamic, there is possible that the text can be 1-100 printing pages long. So please don't tell me to resize the textfield to match textsize height.

Please help me out.

Textfield As List Component?
hi guys..

im a newbie. is it possible to have a textfield function as a listbox? i want to make a textfield lists records like a listbox and also it can be selected like a listbox. is this possible? if there are threads about this topic previously posted, i'l be very glad to be redirected..

thanks

HELP = List + TextField + Array
Hey can you help me...!?

Story:

I'm using Arrays to store data of many websites. Thase are Website's
Names, URLs and Infos. This Array is the dataProvider for a List which,
when selectedItem is clicked displays the Name, URL and Info into
seperate TextFields. There's a button which opens a browser of the URL of the selected Item!

Help:

I want to put a TextField which 'd Update the current List with
possible names of what has been aready typed, comparing it with the Website Name's... and when the TextField is empty, set the original
dataProvider for the List...
A Button to initiate the search aint so bad!

Codes Used:

function showStats(obj):Void {
linkText.text = (obj.target.selectedItem.link);
infoText.text = (obj.target.selectedItem.info);
}

var list:Array = [
{label:'Yahoo!' , link:'http://www.yahoo.com , info:'Bla Bla
Bla...'}]

myList.addEventListener("change", showStats);
myList.dataProvider = list;

goButton.onPress = function(){
getURL(obj.target.selectedItem.data, "_blank")
}


I'm not a good coder so please help me out man...! I've gotten this
far, using forums... the search bit is a little bit too crazy for me
now!

A Line Of My Textfield
I have a textfield and I want to just get the 3rd line of text in it. Is this possible? I didn't set any line breaks, lines are made from word wrap. So I can't just count carriage returns. Please help?

Formatting List Items In Textfield
does anyone know of a way to bring list items closer together in either a multiline textfield or textarea component ? All the bullet points are spaced quite a distant apart from each other.

The text comes from a remoting call, but is just standard <li>. Can i use CSS to modify the gap or something ?

Any help greatly appreciated!!

How Can I Know When A Word In A Textfield Will Go To The Next Line?
I have created a textfield with a multiline property. And so if the width of words loaded into that textfield exceed the textfield width, the word will go to the next line. The problem is how can I know the line number of a specific word?

Detect Last Line Textfield ?
Hi,

Is it possible to detect the end of a textfield, for example when you read a policy and you finished scrolling, make a movieclip do something ?

Reading A Specified Line In A Textfield
Hi!

Here is my question

- I have a Dynamic textfield with dynamic text ower serveral lines WORDWRAPs

- I need to read line by line to build up a new string so that my backend uses the same linebreaks that my flash textfield uses.

- So wat i really need to do is read line by line. Like line0 + "
" + line1 + "
" + line2 and so forth.

Any ideas?

TextField Line Count
is there any way to count the amount of text lines you got in a dynamic textfiled?

Y Position Of The Last Line In A TextField
I want to position something based on the position of the last line of a TextField. What's making it hard for me is that a lot of the vertical measurements are based on the number of lines, not the number of pixels.

textHeight and getCharBoundaries are both based on pixels, but I'm having trouble taking into account the scrolling offset, because scrollV is based on the number of lines.

I've been trying to use this, but it's still buggy:

ActionScript Code:
output.y+output.textHeight-output.getCharBoundaries(output.getLineOffset(output.scrollV)).y;
See, I'm trying to subtract the y value of the first visible line. But sometimes it gives me a the error "Cannot access a property or method of a null object reference" I understand that means I'm giving .getCharBoundaries a parameter it can't accept, but I can't make sure to use a legitimate character index.

Any suggestions?

Line Feeds In A Textfield
Hello,

I hace a dynamic textfield whose content is loaded from an xml file.
As linefeeds, I used
.

example :
<example><content>That examples's first paragraph

That examples's second paragraph</content></example>

The file loads properly but when displayed in my textField, linefeeds don't appear and
are displayed instead.

How can I render my line feeds? Is there any encoding to do when my xml is loaded?

Thanks in advanced,

Pascal

Textformat For One Line In A Textfield
Hi,

I wonder how I could set the textformat for one line of text.

Thanks for any help!

TextField New Line Problem
Hi, I'm using a dynamic textfield to show some text. I've noticed that when I add a text with line breaks, the result is always some more lines than I wanted... So I started setting the htmlText of the textfield and found the problem: even added as line breaks (<br>) these new lines are interpreted as new paragraphs (<p>) what causes the text seems like it have some extra lines... Here an example (exactely the lie I used):

var myTextField:TextField = new TextField();
myTextField.htmlText = '<P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="12" COLOR="#FFFFFF">primeiro texto no sítio<BR>com uma segunda linha<BR>agora com três</FONT></P>';
trace (myTextField.htmlText);

This results the following output... Notice that all my line breaks were, in fact, turned into paragraphs:

<P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="12" COLOR="#FFFFFF" LETTERSPACING="0" KERNING="0">primeiro texto no sítio</FONT></P><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="12" COLOR="#FFFFFF" LETTERSPACING="0" KERNING="0"></FONT></P><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="12" COLOR="#FFFFFF" LETTERSPACING="0" KERNING="0">com uma segunda linha</FONT></P><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="12" COLOR="#FFFFFF" LETTERSPACING="0" KERNING="0"></FONT></P><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="12" COLOR="#FFFFFF" LETTERSPACING="0" KERNING="0">agora com três</FONT></P>

If I call myTextField.numLines I get 6 as the answer, not 3 as I expected... Is there a way to change this behaviour, keeping the line breaks (<br>) instead of the paragraphs (<p>)?

Thank you...

Get The Number Of A Line In A TextField
Hi,

is there a way to find the number or of a line in a textField that contains a certain string?

I can find the string using
Code:
string.search();
But then I would like to find where the line is in the textfield and scroll it dynamically.

I found
Code:
numLines
but that is only the number of lines in a textField.

thanks,

Jerryj.

Last Line Number In TextField
With bottomScrollV you got the last visible line number. But how can you get the last line number of text - invisible? I´m trying to get the text not visible in text field.

TextField Line Height
Hi guys.


Is there anyway to get the font line height of a TextField? I can't find anything in the Flash Help docs but I may have missed something.


Cheers.
Si ++

Line Number In Textfield
Unfortunatelly Flash cannot detect line number for the exact character in the textfiled (like Director can)
To resolve this I'm counting "
" (from the start till the character), but this way is bitter slow when textfileds are big.

Any opinions to do this in the other way?

Extracting Textfield Text From Display List
I am attempting to extract the text in a textfield that is displayed with the container (see below) display list. The code snippet I am using is listed below.

for (i = 0; i < container.numChildren; i++) {
var temp:TextField = new TextField();
// temp = container.getChildAt(i);
trace(container.getChildAt(i));
trace(temp.text);
}

When I execute this, the trace(container.getChildAt(i)) line displays <object TextField>. But, when I activate the comment line temp = container.getChildAt(i); I get an error about coerceing a static variable. Can anyone give me a clue how I can trace the text in the textfield container.getChildAt(i)?

TextField Width Of A List Component Item
Hi,

is there a way to find out the label textwidth of a list component item?
list.getItemAt(x) only returns an object but not the reference to the list item class (or whatever it is called )...

Thanks,
BMA

Numbers On A Line In A Dynamic Textfield?
How do I make a loop like:

for(a=1;a<=10;a++)(
textfieldVar+=a; // this is wrong I know ;-)
}

where the textFieldVar will look like this;

"12345678910"


Regards

Godowsky

Get The Exact Y-position Of A Line In A Textfield
hi !

i got a problem, that makes me mad!

i want to have a listbox that uses only one textfield.
to place the selection bar at the right place,
i tried to get the exact y-position of a certain line with
the getExtent method and the leading property
of the textformat object, but i didn't get the exact
value for it.

here's some pseudo-code to illustrate that:

i=numberoftheline;
lineheight=txtFormat.getTextExtent("C");
linespace=txtFormat.leading;
y=(lineheight+linespace)*i;

this does not properly result in the exact ypos.

maybe i'm on the wrong way.
please help.

How To Use TAB Key To Indent A Line In Input Textfield
I see there are "TextFormat.tabStops" and "TextField.tabEnabled";

I put on a multi-line input textfield in my movie. However, I can not use TAB key to indent a line. When I press TAB key, it just makes my focus shift to other buttons.

Is there a "wantTab" property for textfield ?

If TAB key can not input " ", then why do we need to set tabStops ?

Line Number Of Text In A Textfield
Is there a way to get the line number of a specific string in a dynamic textfield set to auto wrap.

ex.

If a dynamic text box set to auto wrap looks like the following:

here is
some text
on different
lines



Is there a way to know that the string "some text" is on line 2?

Different Colors For Each Line In Dynamic Textfield?
Hi

I have 2 doubts regarding dynamic textField

1)How to set different colors for each line in dynamic textField?I tried

my_txt.textColor = 0xFF0000;

but this changes whole text box color

2)How to display last line in dynamic text field

can anyone help me

Thanks in advance

Find The Number Of A Line In A TextField
Hi,



is there a way to find the number or of a line in a textField that contains a certain string?



I can find the string using
Code:
string.search();
But then I would like to find where the line is in the textfield and scroll it dynamically.



I found
Code:
numLines
but that is only the number of lines in a textField.



thanks,



Jerryj.

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