Importing Text from a .txt

Hi everyone,
First post here, woo!
Let's say I have 5 pages (each about 4 frames long), and on
each page I need to pull in distinctively different text. On page
1, I need the Bible; page 2, Baghavad Gita; page 3, Yoga
Sutras...etc. Also, when I pull them in, I need to be able to play
with them. For example, I need to be able to hide each paragraph
when I click a button.
I first thought I'd need to import a text file into a text
box I pre-defined on the stage, but I can't seem to get that to
override the text of a MovieClip (come on, I'm a rookie!). Then I
thought I'd just ActionScript a text box into existence with code.
Only problem is, I need to animate it to disappear when I click a
button, and re-appear again (which I achieve with just having it
scroll off the stage - any suggestions on improving this situation
would also be much appreciated).
So, my question is: How do I pull in external text files (or
internal? - if I'm over-complicating things) onto the stage, so
that I can animate them to do things like disappear, or move, or
whatever really?
Am I making sense? All help would be GREATLY appreciated!
Cheers
Marc

To pull in your external data, I would advise using XML (make
sure to use CDATA with large text blocks). AS3 has a new beautiful
way to pull and parse XML Data. Just use a URLLoader/URLRequest to
get the XML data, then use the E4X Parser built in Flash to parse
the data, here's an example:
http://pixelfumes.blogspot.com/2007/05/easy-xml-parsing-using-as3-actionscript.html

Similar Messages

  • Importing Text From A .txt File

    Hey guys,
    I'm looking for a way to import text from a .txt file but I'm totally lost. If someone could point me in the right direction that would be awesome

    Hi Prails
    This script is basically what you asked:
    #target illustrator
    #targetengine main
    function copyText(){
        var textFile = File.openDialog ("Select the file");
        if (! textFile.exists || app.documents.length==0){
            return;
        textFile.open("r");
        var txtContent = textFile.read();
        textFile.close();
        var doc = app.activeDocument;
        var textItem = doc.textFrames.add();
        textItem.contents = txtContent   
    copyText ();
    Basically what you need to do is declare the text file, open it, read the content and close it. Then, you create a new text item in the Illustrator document and write the content once catched into the text item.
    You could continue to work with the variable "textItem" in my example script if you want to set properties like the size, color of the text, position and so on. Also, if you want, replace the first line of the function var textFile = new File ("~/Desktop/Test.txt"); by var textFile = File.openDialog ("Select the file"); so the scripts opens a dialog to ask you the file you want the copy the content.
    Hope to be helped
    Best Regards
    Gustavo
    Message was edited by: Gustavo Del Vechio

  • [Win CS5] Import text from *.txt, analyse and place

    Hello everybody!
    I hope this hasn't been posted before, I've used the search function, but haven't found anything...
    This is my problem:
    I have a *.txt file with vocabulary, organised like this:
    vocable<tab>1. translation
    <tab>2. translation
    vocable<tab>translation
    (vocables and traductions are separated by tabs)
    Example:
    suscipio, is, ere, suscepi, susceptum<tab>(ici) prendre sur soi, entreprendre
    deposco, is, ere, depoposci, /<tab>demander avec instance, exiger, réclamer
    injungo, is, ere, injured, injunctum<tab>1. appliquer dans
    <tab>2. joindre à, relier (tecta injuncta muro)
    <tab>3. infliger (injuriam alicui)
    <tab>4. imposer (servitutem alicui)
    I want to place the vocable on a page in a textframe (4x5 textframes on a page), and the translation on the next page in a textframe, at the position where the vocable is located on the back, if you print the two pages duplex on a sheet (so that if you cut the textframes out, the vocable is on one side, the translation on the back). The problem is that I have no idea how to write a script in JavaScript which analyses the text from the *.txt file, and pastes the vocable and its translation in the rigth textframes. Another problem is, if it's easier to generate the textframes first, and paste the text, or to search the vocable and the translation and then generate the textframe and its content :-S
    It'd be kind if anybody could help me with this or give me a hint!
    Thx a lot!
    Jean-Pierre

    But all white color are not the same…
    If your background is the size of the entire book page that's not a problem. Your picture will simply sit on top of your all white background with the letters at the bottom - no chance of seeing an outlined box around it. If there ever was a discernible difference you certainly wouldn't notice it from one page to another. And anyway, won't full white (100%) register as no ink when the book is printed?
    Again, if you're unsure why not just go for the simplest solution? Do your page design in Photoshop (you're already creating your background) and use the book tool to do the final layout and send it out. Sometimes simple is the best answer!

  • How can I import text from Word including paragraph indents?

    I'm using Captivate 7.
    I need to import text from a series of documents written in Microsoft Word.
    When I copy and paste most of the formatting is retained. Bold, italics and underline import perfectly but I lose the indented paragraphs. They all become left aligned.
    Is there a way to import the indented first lines in the paragraphs?
    Thanks in advance.

    Lilybiri, sorry it took me so long to get back to you. Life sometimes interferes with living.
    Thanks for sharing your opinions. Your deep and penetrating insights have changed my life forever. As in: "...that people expect ..." Gee; I've pondered that for years. Now that you've opened my eyes to "what people expect" I can let that go and concentrate on something else. Like, is cheese REALLY binding?
    With your helpful and concerned attitude I'm sure you'll be glad to know that my problem has been solved. Not by anything from Adobe; the company or the forum, but by simply finding another program that works as it should.
    By the way, I marked my own answer correct as it was clear that there is no answer and I just wanted to close the thread. Actually, after I reread what I said,  I realized my answer IS correct. So, I'll stand by it.
    Thanks again, it's been interesting.
    So long Lilybiri, and good-bye Adobe Captivate.

  • Import Text From Form Field into Subject Line of Email

    Hello,
    Is there a way to import text from a form field into the subject line of the email when sending back (attaching) the PDF form?  In other words, there is an "applicant name" and I would like that name to be the subject line of the email.
    I am using Adobe Acrobat X (10.1.7)
    If any one has aby guidance or resources online where I can locate this information I would greatly appreciate it!  I have been searching all day but have not found a solution yet. 
    Thanks!

    Thank you so much for the help.  For some reason I cannot get it to work though.   Now, when I hit the submit button it does not do anything.
    Previously, I had the following code under
    ACTIONS>Mouse Up>Submit a Form
    mailto:[email protected]?subject=Employee Application
    I removed the above mailto URL and put in your code as a Javascript function. I made sure that my field name matched the name in quotes within the code.
    I used the following:
    var subject = getField("lastname").value 
    this.mailDoc({
    bUI: false,
    cTo: "[email protected]",
    cSubject: subject,
    cMsg: "Type message here"
    Do you see anything obvious that I am doing wrong?
    Many thanks!

  • Importing text from word into indesign3

    I am importing text from a word document that has lots of footnotes in it into an indesign3 file  - I need to keep some of the formatting from the word document i.e italics and tabs however I need to be able to edit and reposition the 'word' footnotes within indesign - I don't seem to be able to do this without turning off the footnotes editing completely before importing? Is there a way around this?

    Word is wordprocessor. iWeb is an application to create webpages with.
    Copy/pasting formatted text always has unexpected results.
    To overcome that, save your Word document as a html file.
    Open it in a browser and then copy/paste the text.
    iWeb will retain the formatting.
    And Lion is an operating system. Just like a Mercedes is a car. Neither has anything to do with your problem.

  • HOW CAN I IMPORT TEXT FROM MICROSOFT WORD TO THE WEB PAGE?

    HOW CAN I IMPORT TEXT FROM MICROSOFT WORD TO THE WEB PAGE?

    Another method is tosave your Word document as an a web page.  Then open the htm file, copy the text and paste into an HTML snippet on your web page.  Resize to show all the document and publish. It will retain the style, font and alignment of the original Word document.
    OT

  • Selecting and importing text from Word

    Hi..
    I am interested in importing text from Microsoft Word into labview.
    The text will be identified by a particular 'style'. I have seen examples of reading text marked by 'bookmarks' however this doesn't appear to be sufficient or flexible enough for this application.
    I have tried adapting the 'bookmark' code (using different property/invoke nodes) but can't seem to find something that works in a similar way.
    Just wondering if anyone has already tried something similar.
    Any help is much appreciated.
    Regards,
    Mike
    (Labview 8.2.1 + Report Generation Toolkits)

    Hi Mark,
    The plan was to be able to sift through text in a Word document for blocks of text that match a particular 'style' (determined by us) and import the text into Labview to populate VI descriptions/free labels etc.
    I have adapted some code I have found to be able to cycle through table rows/columns and be able to match text/string patterns, however matching the 'style' property should make this operation a little cleaner or perhaps give us more control over what strings are matched.
    Mike

  • Loading text from a .txt file

    I want to do something that should be VERY simple, but due to
    Adobe's insistence on using #$%^ing tutorials instead of just
    providing step by step instructions, it's very frustrating to
    figure out how to do it.
    All I want to do is load the contents of a text file into a
    dynamic text field, but I can't figure out how to do it (I'm not
    all that familiar with AS). I'm working with Flash 8. Please help.
    Thanks.

    Create the dynamic text box, and name it schedule.
    Then, in the frame on the timeline that the text box resides
    in, the corresponding actionscript would be used to create a text
    variable and assign the text from a txt file to it:
    loadText = new LoadVars();
    loadText.load("externalfile.txt");
    loadText.onLoad = function() {
    schedule.text = this.textbody;
    Where does the "textbody" variable come from? In the external
    text file (externalfile.txt in this example), you have a variable
    called textbody, and the externalfile.txt should read along the
    lines of:
    textbody = "I'm the external text that needs to be read
    in"

  • Importing accents from a txt file

    Hi everyone
    I have the following proble that I can't solve for now:
    I've got a pdf file with forms
    I've got an excel file that I export to txt (tab delimited text file)
    When I import the data from the txt file to the pdf everything is fine but the french accents (é or è or à). For example the "é" becomes a " ,".
    I thinks it might be related to unicode or utf but I don't know how to export properly then import those characters.
    Any idea ?
    Thanks
    Florent
    PS: I'm using Excell 2011 on MAC and Acrobat 9 Pro.

    Done that already, no luck.
    I've saved in all the txt formats possible in my Excel.

  • Problem with imported text from quark

    Hi everyone
    I have imported files from quark version 4 off a mac to Indesign cs4 on a windows PC. everything is fine apart from the text being a little messed up so i am happy enough with that. The problem is that when i drag and drop or copy and paste into a new document all the images will move over but new text will not work with the images.
    By this i mean that when i try to type something over or near the graphics the graphics just vanish! you can drag them over the image and they vanish, then when you drag them away again them reappear!
    Also the shapes that i move over have a thin white border on them where as the shapes that i create directly do not have this boarder.
    Any help that you cold give me on this would be great!
    Thanks in advance!!
    Sam

    Thats it thank you!
    There was a text wrap applied to all the graphics. its working perfectly now!!
    Thank you again!!!
    Sam

  • Importing text from large Word document ID freeze

    I'm converting a large Word document to PDF via InDesign and when I import the text from the Word doc, ID always freezes.
    I want to preserve the styles and formatting in the text but unfortunately the freeze occurs at the beginning where the Placing Microsoft Office Word 2007 document progress bar shows either "Processing character attributes..." or "Processing table attributes..."
    My problem is that it is such a large document with lots of italics, bolds and styles that I would like to take over to InDesign in order to speed up the design process.

    RTF will be fine and will retain all the Bold and Italic and other styles. RTF stands for RICH TEXT FORMAT and I think it's better than the standard .doc saved from Word; for importing to InDesign.
    Try these steps.
    In Word:
    File>Save As
    Choose RTF (that way you are not overwriting the original file)
    In InDesign:
    Start a new document - completely blank - don't worry about page size (A4 will do) and don't worry about margins (standard margins will do)
    Use File>Place and import the RTF file you just saved
    If that imports ok - then select all the text
    File>Export and choose RTF (rich text format)
    Now use that new RTF to import to your layout
    (there is no need to worry about images, you should reimport all  images that are in Word through File>Place; if you have any images in  your Word document. Make sure you use the same source file as when you  placed into Word)
    The reasons for the steps above is because there is a lot of unnecessary styles made with Word - and importing to InDesign and a fresh Export to RTF makes a cleaner file to use with InDesign.
    Have a look at  this too - http://www.paperspecs.com/mainblog/degunkifying-word-files/

  • Importing data from a .txt file and have Acrobat create new pages

    Hi everyone,
    I've created a form in Acrobat 9 to be used as an invoice. I want to be able to import data from an excel spreadsheet or .txt file into all the form fields. I know that I can go Forms > Manage form Data > Import Data to import 1 record at a time, but say I have about 50 invoices to populate, is there a way to import all the records at once and have acrobat create a new invoice for each of the customer's records?
    If there is a way, will it be compatible for Acrobat Reader users since this form will be used by someone who only has the Reader?
    Really appreciate any help.

    Sure.. this is what we use. "New Micro Right Click Tools"
    http://www.nowmicro.com/rct/

  • Pulling text from a .txt to a scroll pane or text area

    Hi-
    I'm sure there's a way to do this, but I'm not exactly fluent in ActionScript.
    Basically, my whole website's going to be in Flash, but I want to be able to update one page (sort of a news/blog page) without having to edit the Flash file every time. I'm assuming the easiest way to do this would be to set up either a scroll pane or a text box and pull the text in from a .txt file (if there's a better way, please let me know). That way I could continue to add on to the .txt file, and Flash would always pull in the current version.
    So, my issues are:
    1. I have no idea where to start with the code for something like that. Is it a LoadVar? Do I physically put a scroll pane or a text area in the frame and put the action on that, or do I put the action on the frame and have it call up a text area component?
    2. Will the text scroll automatically, or is that something else I would have to add in? I plan on adding to this text file for awhile, so it could end up being a lot of text over time.
    3. Would I be able to format the text in the .txt at all? For instance, if I hit enter to put in a paragraph break, would that register once it's pulled into Flash, or would I have to put in an html paragraph break or something? That may be a dumb question, but as I said, I'm not exactly fluent in ActionScript (or any other programming language for that matter).
    Any help is definitely appreciated!
    Thanks!
    -Geoff

    I recommend you use an xml file rather than a text file for storing your content.  The main reason being that it tends to make thing more easily organizable, as well as easier to differentiate things like titles, contents, links, images, etc.
    You could start off using a TextArea component if you want, just to keep things simple.  If you want to format things you can use the htmlText property rather than the text proiperty when assigning your content.  That will allow you more control of the presentation.
    If you want to take the xml approach, you should search Google for "AS# XML tutorial" where you substitute whatever version you plan to use for the "#".  If you plan to use AS3, there is a good tutorial here: http://www.gotoandlearn.com/play?id=64

  • Problems importing text from EXCEL

    Help please!
    I'm using CF to import data from an EXCEL sheet that has a
    mix of numbers and text onto a SQL Server database. I get a
    successful import of numbers, but have problems with the text
    import. Specifically, quotes, apostrophes, dashes, etc are
    converted to null (?) values--when you output onto a webpage, they
    turn into "square boxes". Anyone run into this problem and knows a
    fix?
    FYI. I can't set up DTS (as some have recommended) since
    database server is housed outside my domain.
    Also, I would like to keep the format of the text if possible
    (ex. breaks, bold, italics, etc.)
    Thanks in advance!

    Some utilities you can use:
    SQL Loader:
    http://download-east.oracle.com/docs/cd/B14117_01/server.101/b10825/ldr_concepts.htm
    External tables:
    http://download-east.oracle.com/docs/cd/B14117_01/server.101/b10739/tables.htm#ADMIN01507
    Or directly from forms using text_io or cleint_text_io:
    http://www.oracle.com/webapps/online-help/forms/10g/state?navSetId=_&navId=3&vtTopicFile=f1_help/oraini/c_text_io.html&vtTopicId=

Maybe you are looking for