Read text with actionscript

I have been looking all around for this answer but I never
really found the exact answer I'm looking for.... I need something
that would read a .txt file and compare it to a variable containing
a .txt file (already loaded), and if it is the same then it will do
an action.
My case is that I have 1 file for each language (3 languages)
containing the same information but in a different language. And I
would like to check what language is already loaded, so that it
knows what language file it should load in the variable when
someone presses a button in the nav bar.
I hope I'm clear enough. Please let me know if you know or if
you need me to find a better way to say this.
Thanks you.

Sorry. Tried writing the code for you very late last night.
Now that I am a bit more awake, here are step by step instructions
to create a small version of what I am talking about. You will have
to modify it to fit your exact situation.
1) create a new flash file and save it on the hard-drive.
2) Create a new text file inside notepad or equivalent
program.
3) In this file, write content=Welcome to our home. Save it
as en_welcome.txt, making sure to save it in the same folder as
your flash file.
4) Create another new text file inside notepad.
5) In this file, write content=Bienvenidos a nosotros casa.
Save it as sp_welcome.txt making sure to save it in the same folder
as your flash file.
6) In your new flash file, create a dynamic text field on the
stage. Set the variable field in the options bar to content.
7) Select the text field and create a symbol out of it. Name
it something you'll remember. Give it an instance name of target_mc
on the Stage.
8) Create a new layer in the main movie for your language
menu. Create two buttons on the stage...one for English and one for
Spanish. Give each a proper instance name, in my code, I'll be
using "english_btn" and "spanish_btn".
9) Add a new layer to the main movie again for your standard
menu. Create a static text field with the word "Welcome" in it.
Select the word welcome and create a symbol out of it named menu
and give it an instance name of menu. Double click the new symbol
on the stage. Select the word welcome and create another symbol out
of it named Welcome and give it an instance name of welcome.
10) Now we start coding

Similar Messages

  • How to Write BUFFER & Read TEXT with Encrypt file ?

    I'm using Windows Phone 8.1 RT.
    I have a issue :
    - I write a BUFFER encrypted to file. After, I read file with TEXT. It's throw exception : No mapping for the Unicode character exists in the target multi-byte code page. (//ERROR 2)
    - I write a TEXT encrypted to file. After, I read file with BUFFER. It's throw exception : The supplied user buffer is not valid for the requested operation. (//ERROR 1)
    Code Write Buffer & Read Text.
    //Write Textstring msg = EncryptText.Text;
    //ERROR 1 - Use 1 or 2
    await WriteTextAsync(this.file, msg);
    //ERROR 1
    //Read Buffer
    string msg;
    //ERROR 1 - Use 1 or 2
    IBuffer buffer = await ReadBufferAsync(this.file);
    StreamReader stream = new StreamReader(buffer.AsStream());
    msg = stream.ReadToEnd();
    //ERROR 1
    Code Encrypt-Decypt.
    public static string EncryptString(string msg)
                var bufferMsg = CryptographicBuffer.ConvertStringToBinary(msg, BinaryStringEncoding.Utf8);
                var bufferMsgEncrypted = Encrypt(bufferMsg);
                var msgEncrypted = CryptographicBuffer.EncodeToBase64String(bufferMsgEncrypted);
                return msgEncrypted;
            }public static IAsyncAction WriteTextAsync(IStorageFile file, string msg)
                return FileIO.WriteTextAsync(file, EncryptString(msg));
    public static IBuffer Decrypt(IBuffer bufferMsg)
                var key = CreateKey(KEY);
                var aes = SymmetricKeyAlgorithmProvider.OpenAlgorithm(SymmetricAlgorithmNames.AesCbcPkcs7);
                var symetricKey = aes.CreateSymmetricKey(key);
                var bufferMsgDecrypted = CryptographicEngine.Decrypt(symetricKey, bufferMsg, null);
                return bufferMsgDecrypted;
            }public static IAsyncOperation<IBuffer> ReadBufferAsync(IStorageFile file)
                var buffer = FileIO.ReadBufferAsync(file);
                Task<IBuffer> result = Task.Run<IBuffer>(async () =>
                    var Buffer = await buffer;
                    return Decrypt(Buffer);
                return result.AsAsyncOperation();
    Link demo code :
    https://drive.google.com/file/d/0B_cS3IYO936_akE0cmI4bExJMjh0RU9qR3RvWDBWWElZWC1z/view?usp=sharing

    Please provide a working app so this can be tested. You can upload to OneDrive and share a link here.
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • I need to get texting with my 4s to my 2013 altima

    I need to know how to send and read text with my hands free Bluetooth on my 2013 nissan Altimaw

    Have you consulted with the dealership that sold you the car?  I worked at a car dealership before, and the car salesman(women) would often help customers with issues like these, or get a mechanic to help.

  • Is there a way to  have the iPad 2 "read" text from iBooks as with web sites or pages?

    is there a way to  have the iPad 2 "read" text from iBooks as with web sites or pages? A different App perhaps?

    Isn't that you asking how to get it (undefined) back?
    If you never had Pages '09, you can buy it from Amazon very cheaply:
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=432&sid=f68e84cd2ec6 123bd2ed93806c7e7fb6&mforum=iworktipsntrick
    Peter

  • Why can I now highlight text with mouse pointer in Adobe Reader 9

    I just downloaded Adobe Reader X. I think I prefer Reader 9. I don't like being able to click in the document and have a flashing place mark (right terminology?) there. This is now happening in the Reader 9 version too, and I can copy text this way, but I don't want this. I didn't change any preferences. Can anyone help?

    Like I said, I didn't change any of the preferences, so I don't know why this happened. I think it only happened after I opened Adobe Reader X. I see no options in preferences for turning on or off the ability to highlight text with your mouse pointer, and I thought you were not supposed to be able to do this in Adobe Reader 9.

  • Problem with reading text from .DOC files through java and POI

    I have used a jar file "poi-scratchpad-3.2-FINAL-20081019.jar" and "poi-3.2-FINAL.jar" to read text from a .DOC file. I used the "getParagraphText()" function of the class "org.apache.poi.hwpf.extractor.WordExtractor" to get the text.
    I am able to get the text in the .DOC file but along with that i am getting the following messages/warnings
    Current policy properties
    *     thread.thread_num_limited: true*
    *     file.write.state: disabled*
    *     net.connect_ex_dom_list:*
    *     mmc.sess_cab_act.block_unsigned: false*
    *     mmc.sess_cab_act.action: validate*
    *     mmc.sess_pe_act.block_blacklisted: false*
    *     mmc.sess_pe_act.block_invalid: true*
    *     jscan.sess_applet_act.stub_out_blocked_applet: true*
    *     file.destructive.in_list:*
    *     jscan.sess_applet_act.block_all: false*
    *     file.write.in_list:*
    *     file.nondestructive.in_list:*
    *     window.num_limited: true*
    *     file.read.state: disabled*
    *     jscan.session.origin_uri: http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/poi/poi/3.2-FINAL/poi-3.2-FINAL.jar*
    *     file.nondestructive.state: disabled*
    *     jscan.session.user_ipaddr: 10.136.64.153*
    *     net.connect_other: false*
    *     thread.thread_num_max: 8*
    *     file.destructive.ex_list:*
    *     file.nondestructive.ex_list:*
    *     file.write.ex_list:*
    *     jscan.sess_applet_act.sig_invalid: block*
    *     file.read.in_list:*
    *     mmc.sess_cab_act.block_invalid: true*
    *     jscan.session.policyname: TU1DIERlZmF1bHQgUG9saWN5*
    *     mmc.sess_pe_act.action: validate*
    *     thread.threadgroup_create: false*
    *     net.connect_in_dom_list:*
    *     net.bind_enable: false*
    *     jscan.sess_applet_act.sig_trusted: pass*
    *     jscan.session.user_name: 10.166.64.201*
    *     jscan.session.user_hostname:*
    *     file.read.ex_list:*
    *     jscan.sess_applet_act.sig_blacklisted: block*
    *     jscan.session.daemon_protocol: http*
    *     net.connect_src: true*
    *     jscan.sess_applet_act.unsigned: instrument*
    *     mmc.sess_pe_act.block_unsigned: false*
    *     file.destructive.state: disabled*
    *     mmc.sess_cab_act.block_blacklisted: true*
    *     window.num_max: 5*
    Below the above messages/warnings the data is getting printed. Only the text part of the data is retrieved not the fonts, styles and bullets etc.
    Can anyone explain me why I am getting above warnings and how can I remove them. Is it possible to fetch the text depending on delimiters.
    Thanks in advance,
    Tiijnar
    Edited by: tiijnar on May 21, 2009 2:45 AM

    The jar files which were used are downloaded from http://jarfinder.com. Those jars created the problem of displaying those messages on console. I downloaded APIs from apache.org and used them in my application. Now my application is running good.
    Tiijnar

  • How to highlight text with Adobe Reader XI?

    email [email protected]

    Thanks. The PDF file was made from a web site article and I guess this is the same as scanned as I cannot highlight.  The cursor changes but cannot highlight what I want.
    I was able to add text and I did this in Red and will ask the VA to read under the sections marked in Red.
    Thanks,
    Vernon Pobanz
          From: ~graffiti <[email protected]>
    To: vernon pobang <[email protected]>
    Sent: Tuesday, October 7, 2014 11:57 AM
    Subject:  How to highlight text with Adobe Reader XI?
    How to highlight text with Adobe Reader XI?
    created by ~graffiti in Adobe Reader - View the full discussionUse the highlight tool under Comment>Annotations. This will only work if the pdf isn't a scanned image. If that is the case, there is no text to highlight. Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at https://forums.adobe.com/message/6800192#6800192 Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:  To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click the Stop Email Notifications link.  Start a new discussion in Adobe Reader by email or at Adobe Community For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • Reader converts text with http in it clickable. How to have it be colored and/or underline?

    I've got a word document with text that contains http://blabblah.com which is not hyperlinked in word. I save it as a PDF file. When I read it with Adobe Reader, it will recognize it as a link since it starts with http:// and will make it clickable which is fine. But, I also want it to change the font, color and/or underline it to make it appear as a link and not just text. How do I do that in Adobe Reader? Is there a setting I can change or ???

    Adobe Reader cannot do this. Even in Adobe Acrobat it is tedious and uncertain task. Set all the font attributes in Word.

  • Change the "Font size" in a TLF Textfield with actionscript?

    I could not realize how should I resize my TLF Textfiels in flash cs6 with actionscript??
    None of these worked:
    if (....)
         myTLFText.textSize++;
         myTLFText.fontSize++;
    Error: Access of possibly undefined property size through a reference with static type fl.text:TLFTextField.
    I appreciate your kind help please??

    Here is the part of code I am using to resize the textfield (and other elements).
    /******SET POSITION**********/
    function setPosition():void
          //Position appBG
          appBG.height = stage.stageHeight;
          appBG.width = appBG.height;
          //Fit the appTXT in middle of screen  (AppTXT is a MovieClip contains sourceText - RTLTextField)
          appTXT.sourceText.width = stage.stageWidth * 0.9;
          appTXT.sourceText.x = stage.stageWidth * 0.05;
          appTXT.sourceText.y = stage.stageHeight * 0.1;
          //Fit the maskText layer on top of text;
          maskText.width = appTXT.sourceText.width;
          maskText.height = stage.stageHeight * 0.8;
          maskText.x = stage.stageWidth * 0.05;
          maskText.y = stage.stageHeight * 0.1;
          //Set buttons in their proper position
          if (stage.stageWidth > stage.stageHeight)
                appBG.width = stage.stageWidth;
                appBG.height = appBG.width;
          appBG.x = stage.stageWidth / 2;
          appBG.y = stage.stageHeight / 2;
    Everything works fine, but when I install the apk on my Google nexus (800x1280), the font size looks VERY SMALL and I can hardly read it!
    If I increase the Font size pt (Red Arrow in above PrntScr) to 40. then it reads perfect on phones with 800x1280 screen size. Ok?  But then any OTHER smaller screen cell phones will see the font TOO BIG!
    So I need to set the Font size pt by CODE based on a percent of stageWidth to could solve this. thx.

  • Is it possible to add paragraphs with actionscript?

    If I have an object like
    <s:RichText id="foo">
    <s:content></s:content>
    </s:RichText>
    Can I manually add paragraphs to it with actionscript?
    I want to manually create a new paragraph, assign a string to it, and then stash it in the RichText object.  So I can use a loop to create as many paragraphs as I might need.
    Such as
    for each (s:String in myCollection) {
       [ foo add a p element with s in it ]

    I think I've got it:
    var textFlow:TextFlow = new TextFlow();
    for each ( var s:String in instructionsArray)
         var p:ParagraphElement = new ParagraphElement();
         var span:SpanElement = new SpanElement();
         span.text = s;
         p.replaceChildren(0, 0, span);
         textFlow.replaceChildren(textFlow.numChildren, textFlow.numChildren, p);
    instructionText.content = textFlow;
    Where "instructionText" is a RichText object.
    This is very, very cool, btw.

  • Easiest Way to make scrolling text with color

    What is the easiest way to make scrollable text that I can
    set to whatever font I want (embeded of course)
    have it look very well anti-aliased; like most Flash text, not like it's being read out of a regular system or browser window. (the text will be big so no probs)
    have different portions of the text be different colors so I can highlight certain words and leave others alone
    use actionscript to load text content into it
    maybe make (all) the text semi transparent for design purposes
    I'm going to use some action script to load some XML content into the text areas or whatever. Any of you know of any easy ways of accomplishing this? or have a link to any type of tutorial? (at least for Flash CS3 and above of course, along with ActionScript 3)

    Go to Lee Brimlow's website. It has some great tutorials, including one on loading an XML file.
    <url>http://www.gotoandlearn.com/</url>
    Another good site is Kirupa.com
    <url>http://www.kirupa.com/developer/flash/index.htm</url>

  • Adding mxml form with actionscript

    In my application, I have a form that is generated with an
    accodion and a repeater. The repeater is used to generate the
    number of forms needed based on the number of children in the xml
    dataprovider. Now what I would like to do is to add new forms with
    actionscript and a button. Can this be done? Here's to code:
    <!--Create an accordion for Contacts-->
    <mx:Accordion width="360" height="610" x="837" y="10"
    backgroundColor="#FFD897" cornerRadius="5" borderThickness="3"
    id="contactAccordion" creationPolicy="auto">
    <mx:Repeater id="repeat"
    dataProvider="{populateContactXML}" >
    <mx:Form xmlns:mx="
    http://www.adobe.com/2006/mxml"
    id="contactForm" width="360" height="585" borderStyle="none"
    backgroundColor="#E1E1E1" cornerRadius="5" borderThickness="3"
    label=" >
    <mx:FormHeading id="contactHeading" label="Contact
    Information"/>
    <mx:FormItem label="Contact Type" width="290" x="790"
    y="10">
    <mx:FormItem id="address1Item" label="Address 1"
    width="290">
    <mx:TextInput id="address1" change="onChange(event,
    event.currentTarget.repeaterIndex, 'Address_1')" width="183"
    borderStyle="solid" cornerRadius="5"
    text="{repeat.currentItem.@Address_1}" >
    <mx:Script>
    <![CDATA[
    public function onChange(event:Event, idx:int,
    str:String):void
    populateContactXML[idx]["@" + str] =
    event.currentTarget.text;
    trace("index = ", idx);
    tmptxt3.text = "index = " +idx;
    ]]>
    </mx:Script>
    </mx:TextInput>
    </mx:FormItem>
    </mx:Form>
    </mx:Repeater>
    </mx:Accordion>

    Hi,
    All you need to do is add a node (XMLList) to your
    populateContactXML object (make sure populateContactXML is a
    XMLListCollection and not an XMLList so that binding works
    flawlessly) on the click of a button.

  • Using ImageMagick with ActionScript

    Hi,
    I there a way we can use ImageMagick with actionscript. There are classes available for using it with PHP, Ruby on Rails ets.. but is there a way we can use it with actionscript?

    I am working on an application where I want various text shapes like: vertical arch, bridge, bowtie etc... but the problem is that I am not able to figure out any firm solution for that in Flash. I came across the ImageMagick library and with Fred's ImageMagick Scripts for text effects, I think all the shapes I am looking for can be done. But unfortunately no AS wrapper is available for ImageMagick .
    So was looking for a solution.

  • Aligning object to stage with actionscript

    I have a dynamic text box pulling info from an xml file.
    After the text loads the box resizes with autoSize.
    Any ideas on how i can get the box to align to the center of
    the stage after that with actionscript??
    I've looked around and can't seem to find a solid yes or no
    anywhere.
    Or if that's impossible, is there any way to vertically align
    the text, which would negate the need for the resize and align.
    Thanks

    nevermind....
    worked a little more and got it to work with
    mc_text.desc_txt._y=(Stage.height/2)-mc_text.desc_txt._height/2;

  • How to download / read  text attachment  in Sender Mail Adapter  IN XI

    Hi
    I would like to know how to download / read text attachment in sender mail Adapter & sent same attachment to target system using file adapter.
    Please help how to design / resolve this concept.
    Regards
    DSR

    I would like to know how to download / read text attachment in sender mail Adapter & sent same
    attachment to target system using file adapter.
    Take help from this blog:
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    From the blog:
    However in most cases
    our message will not be a part of the e-mail's payload but will be sent as a file attachment.
    Can XI's mail adapter handle such scenarios? Sure it can but with a little help
    from the PayloadSwapBean adapter module
    Once your message (attachment) is read by the sender CC, you can perform the basic mapping requirement (if any) to convert the mail message fromat to the file format.....configure a receiver FILE CC and send the message...this should be the design...
    Regards,
    Abhishek.

Maybe you are looking for

  • How you can solve a problem or find out on a dead pc if the problem relies on motherboard and not on processor or vice versa

    hi. I am working myself with computers ,  so there is one thing in my mind I wanted to be sure,which I couldn't find an answer for it! because I had before totally black screen and the problem was damaged processor. I am wondering how I can be sure a

  • Magic Trackpad Installation Software

    I have a new Magic Trackpad but cannot use it because there is no "Trackpad" to click on in System Preferences as per the instructions. I have the latest update to Snow Leopard installed and have no other pending software updates. I don't know what e

  • Custom layout with DVT

    Dear All, I want to use dvt features (drag and drop,....) with my custom layout. It seems that dvt deals with specific hierarchy with specific class(style classes) but actually i didn't find any example or documentation. Here is my custom layout: <ne

  • Data manipulation

    As one of the query from DB returns 1000s of records ,I want to implemnet a mechanism like this in search box type some letters and press a button. this should execute a search query and show results in a popup form where user can select a value and

  • Needed help / suggestions. on query

    Hi ,      I have sql query.      select count(cd) from bqcusthierarchy h1, bqcusthierarchy h2,           bqcustomerdeal cd where h1.child = ?           and h1.parent = h2.parent and h2.child = cd.customer      Gobal Account      Regional Account 1