Loading text by XML

Hi:
I am very new to XML so I would like to know if someone could
help me, this should be very simple. I have a textbox in my flash
movie that will display the main text (only a short paragraph); my
client wants that text to be loaded by XML but I do not know how to
do that because these are my very first steps with XML.
Any help, sample file or recommendation will be appreciated.
Greetings from Argentina.

var my_xml:XML = new XML()
my_xml.ignoreWhite = true
my_xml.load("yourtext.xml")
my_xml.onLoad = function(success) {
if(success) {
parseXML(this)
function parseXML(xml) {
my_xml = xml
textvalue =
my_xml.firstChild.childNodes[0].firstChild.nodeValue;
my_txt.text = textvalue
trace(textvalue);
=============
this is xml
<Dataset>
<text id="1">this is your text</text>
</Dataset>

Similar Messages

  • Best practice? Loading text with XML or AS?

    I am developing some instructional material that will include
    some practice questions. I know of 2 ways to handle the dynamic
    text, but am not sure what is considered best practice in the Flash
    community. Is XML the best, fastest or more efficient than
    embedding the text into actionscript?
    Thanks!
    Brad

    If the questions will ever need to be changed, updated, or
    edited, then XML would be the best.
    If you just need the quickest way to build your Flash and not
    have to worry about loading external files and what to do if the
    file isn't available, then put them into the body of the
    FLA.

  • XML Loaded Text Inconsistently Displays Apostrophe

    i have a number of dynamic text fields, all of which have
    text loaded from their respective xml files.
    one of the menu items includes an apostrophe. that apostrophe
    shows up in one area of the site but not in another where it is
    replaced by &apos; .
    these two sections are identical. both dynamic text boxes
    with xml loaded text. one works one doesn't.
    i've double checked everything. everything is embedded, i
    have no idea what the problem is.
    any ideas?
    if you want to see what i'm talking about go
    here and select WORK. JAMIES
    ORGANIC TREATS has no apostrophe because i took it out - it gets
    converted to &apos; in this location. but if you select JAMIES
    ORGANIC TREATS the name pops up in the new section correctly WITH
    the apostrophe.
    they are separate text fields with separate xml files but all
    of them are treated the same.
    Flash CS3 Flash Player 8 AS2
    Mac 10.5

    *SOLVED*
    i went back in and enabled html on the text box and changed
    all of the .text to .htmlTxt and it worked. also added the cdata
    tags.
    but any idea why the apostrophe works correctly in the other
    instance?

  • Flash CC Air iOS: Problems with loading text from an external xml located on a server.

    So I have this code allowing me to load text from an xml located on a server. Everything works fine on the Air for Android. The app even works in the ios emulator, but once I export my app to my ios device with ios 7, I don't see any text. The app is developed with Air sdk 3.9. What could be the reason? Do I need any special permissions like on Android? Does ios even allow to load xml from an external server?
    Any clues?

    It was my bad. I linked to a php file to avoid any connection lags, which was absolutely fine on the android, but didn't seem to work on the ios 7. So all I did is change the php extension to xml and it worked without any problems.

  • How do I add numeric values as text in XML??

    HI,
    So, I've developed a 3d carousel using this tutorial and the  XML, and customized the XML in Dreamweaver.
    http://www.gotoandlearn.com/play?id=33
    Now,  I've got the carousel set up exactly the way I would like, but the only  trouble, is how do I add numeric values as the text for the xml file???
    Here's an example to the working carousel and where text is loaded for each item on it.  (put your sound on mute if you don't want to hear the video)
    http://iongeo.com/collaboration_test_dev/video_arctic_imaging.html
    For  example, in my XML, if I would like the text to be "3d images", when I  export the FLA, only "d images" comes through because the numeric  values can't be added as the text for the tooltip.
    Does anyone  have any ideas?
    Here is an example of how the XML is loaded into  the .swf - the text loads great, but just not the numeric characters.
    The  same story can be said for special characters, I would like to know how  to add a "&" sign too.
    <icons>
    <icon  image="images/Subsalt_E_P_Partnerships.png" tooltip="3D Images"  content="Text Copy.">
    </icon>
    </icons>
    Any  help would be greatly appreciated.
    Thank you.

    Hi Randy,
    Thanks a lot for the reply.  Your post got me thinking that it's actually a flash problem, as the actual descriptor text shows 123,etc and "&".
    The trouble is that the icons are dynamically loaded from the XML to movie clips on the flash file.  I've asked the flash forum to see if they could take a look.
    Thanks again.
    Mike

  • How load text into dynamic text boxes from external file?

    hi all,
    my animation is very simple - a background image and 2 text boxes.  one of the textboxes shows a large word, which crossfades to another word, with a total of about 12 words (showing one at a time in different text boxes fading in & out in the same spot).
    i need a way to have the text be imported dynamically via xml or json (xml preferred).  this article is a good start, but i noticed he's putting all of the text into one box - i need separate strings put into separate boxes from the xml.
    Chris Gannon - Loading XML via AJAX into Adobe Edge
    he uses
    var outputField = $(this.lookupSelector(“xmlOutput”));
    for his text box.  what would be the best way to revise this code to include all my individual strings to be loaded into my individual text boxes?  thinking an array might work, but my js skills are limited.
    any other suggestions or tutorials you could point me to would be appreciated.
    thanks!!

    thanks joel_pau !
    this is helpful in seeing how the array is created, but after giving it a go I became a little confused.
    i wound up trying it again based on the example i linked out to previously, but it's not adding the text from my xml file when previewing.
    here's the code i'm using in edge animate on my stage.  something must be wrong somewhere.  let me know if you have any suggestions on this.
    // insert code to be run when the composition is fully loaded here
    // here i'm assigning a variable to each one of my textboxes at they're named in my edge animate comp
    var outputField1 = $(this.lookupSelector("helps2"));
    var outputField2 = $(this.lookupSelector("communicate"));
    var outputField3 = $(this.lookupSelector("experience"));
    var outputField4 = $(this.lookupSelector("interact"));
    var outputField5 = $(this.lookupSelector("understand"));
    var outputField6 = $(this.lookupSelector("overcome"));
    var outputField7 = $(this.lookupSelector("flourish"));
    var outputField8 = $(this.lookupSelector("collab"));
    var outputField9 = $(this.lookupSelector("trust"));
    var outputField10 = $(this.lookupSelector("grow"));
    var outputField11 = $(this.lookupSelector("engage"));
    var outputField12 = $(this.lookupSelector("survive"));
    var outputField13 = $(this.lookupSelector("thrive"));
    var outputField14 = $(this.lookupSelector("evolve"));
    var outputField15 = $(this.lookupSelector("connect"));
    var outputField16 = $(this.lookupSelector("achieve"));
    $.ajax({   
        type: "GET",
        url: "myxmlfile.xml",
        dataType: "xml",
        success: function(xml) {
    //here i'm trying to load the the text in my xml file into my textboxes in edge animate.  'txt1, txt2, txt3' are the tags in my xml file
            outputField1 = $(xml).find('txt1').text();
            outputField2 = $(xml).find('txt2').text();
            outputField3 = $(xml).find('txt3').text();
            outputField4 = $(xml).find('txt4').text();
            outputField5 = $(xml).find('txt5').text();
            outputField6 = $(xml).find('txt6').text();
            outputField7 = $(xml).find('txt7').text();
            outputField8 = $(xml).find('txt8').text();
            outputField9 = $(xml).find('txt9').text();
            outputField10 = $(xml).find('txt10').text();
            outputField11 = $(xml).find('txt11').text();
            outputField12 = $(xml).find('txt12').text();
            outputField13 = $(xml).find('txt13').text();
            outputField14 = $(xml).find('txt14').text();
            outputField15 = $(xml).find('txt15').text();
            outputField16 = $(xml).find('txt16').text();
    but nothing happens on preview.  my textboxes still contain the original text that lives in my comp.

  • Loading and viewing XML when a class object is created..Help Please

    Hello,
    I have writing a simple class which has a method that gets invoke when the object of the class is created. I am able to view the loaded XML content when I trace it with in my class method, but cannot assign the content to a instance variable using the mutator method. So the process goes like this:
    Class object is instantiated
    Class construtor then calls the loadXML method which laods the XML
    And then assigns the XML to a class instance variable.
    So now if I would like to access the loaded XML through class object, I should be able to see the loaded xml content which I am not able to see. I have spent over few hours and cannot get the class object to display the loaded XML content. I would highly appreciate it if someone can help in the right direction, please.
    [code]
    package com.as3.app
        import flash.display.*;
        import flash.events.*;
        import flash.text.*;
        import flash.net.*;
        public class Cars extends MovieClip {
               public var _CarList:Object;
               public function Quiz()
                  super();
                  loadCars();
    // ===========================================================
    //           CARS GETTER SETTER
    // ===========================================================
            public function set Cars(val:XML):void
                this._CarList = val;
            public function get Cars():XML
                return this._CarList;
    // ===========================================================
    //            LOAD QUESTIONS FROM XML
    // ===========================================================
            public function loadcars()
                var myXML:XML;
                var myLoader:URLLoader = new URLLoader();
                myLoader.load(new URLRequest("xml/cars.xml"));
                myLoader.addEventListener(Event.COMPLETE, processXML);
                function processXML(e:Event):void
                    myXML = new XML(e.target.data);  
                    Cars = myXML;                 // Assigning the loaded xml data via mutator method to the _CarList;
    //=============================================================  
                                  INSTANTIATING THE CLASS OBJECT
    //=============================================================
    package com.as3.app
        import flash.display.*;
        import flash.events.*;
        import flash.text.*;
        import flash.net.*;
        import com.as3.app.*;
        public class DocumentClass extends MovieClip {
            public var c:Car;
            public function DocumentClass()
                super();
                c = new Cars();  
                trace(c.Cars);
    [/code

    where you have:
                super();
                c = new Cars();  
                trace(c.Cars);
    c.Cars will not trace as the loaded xml, because it will not have loaded in time. After some time it should presumably have the correct value.
    loading operations in actionscript are asynchronous, so your nested function which is acting as the listener ( function processXML(e:Event):void) only ever executes when the raw xml data has loaded and that is (I believe, not 100% sure) always at least one frame subsequent to the current one.
    In general I would consider it bad practise to use nested functions like that, but I don't think its contributing to your issues here. I think its just a timing issue given how things work in flash....
    Additional observation:
    your Cars constructor calls loadCars() and your loadCars method is defined as:
    public function loadcars()
    I assume its just a typo in the forum that the uppercase is missing in the function name....

  • Presenter 9: "Change SWF loading text" not works

    Hello, everyone,
    I have just bought Adobe Presenter 9 to transfer PPT to e-Learning course file.
    When I try to change SWF loading text, I modify the presentation's vconfig.xml file by adding:
       <uitext name=”ADOBE_PRESENTER” value=”Welcome to our training”/>
    And I add this sentence for each language.
    Eventually, my vconfig.xml file looks like:
       <language id="en">
         <uitext name="DOCWRAP_MSG" value="Save to My Computer"/>
         <uitext name="DOCWRAP_PROMPT" value="Click to Download"/>
         <uitext name="ADOBE_PRESENTER" value="Changed text"/>
         </language>
    However, it still keeps appears "Adobe Presenter" when starting the course file.
    What's wrong with my operation? Any ideas?
    Duplicate post was removed by: Jorma Jennings

    If placing it in the published files (vconfig.xml), it appears it should be placed after the <!-- uitext --> comment, aprox line 62.
    My viewer.xml looked like:
    <uifont name="FONT_QUIZPOD_QUIZ_PASSSCORE_VALUE" value="Verdana,9,true,false,true"/>
    <!-- uitext -->
    <uitext name="ADOBE_PRESENTER" value="This Presentation Has Been Brought to You by the Letter Q"/>
    <!-- substitution: %n == slide number -->
    <uitext name="UNNAMEDSLIDETITLE" value="Slide %n"/>
    After making that change, I see that text when playing back the presentation.

  • Problem with  whitespace  then loading and saving xml

    i do not know how to handle this problem. i modifed a texteditor to send XML to a server and load XML back to the container.
    but then i do changes to the Textlayout it shows up like this --->
    Text in Container not modifed
    Text in Container modifed ---> with space beween the colorchanged string
    Text inContainersend and loaded ---> i think this has something to to with the
    TextFilter.export(_textFlow,TextFilter.TEXT_LAYOUT_FORMAT,ConversionType.XML_TYPE)
    can someone give me a hint...

    Hi,
    the link is --->
    http://www.horstmann-architekten.de/contentmanagment/SimpleEditor.html
    its a modified example of the texteditor provided by Adobe. You can send a xml to the server. and also read it from the server. You just use the xml identifer to give the xml a name.
    Try it out:
    1.  change the text and
    2.  give a XML-Identifer
         and then send it to the server. --> send to server
    3.  type in the XML-Identifer you have used and
    4.   load it from the server ---> Load from Server Button
    evering works ok exept the columns formating.
    I Think the colums Formating is not embeded in the XML as it should be. I attached the Files. (Newbie programmer)
    With best regards
    Michael Sprinzl
    --- robin.briggs <[email protected]> schrieb am Do, 17.9.2009:
    Von: robin.briggs <[email protected]>
    Betreff: Problem with  whitespace  then loading and saving xml
    An: "Michael sprinzl" <[email protected]>
    Datum: Donnerstag, 17. September 2009, 2:12
    Sounds like you have two different issues going on: (1) inline graphics aren't coming out correctly when you use the TextLineFactory, and (2) columns aren't working correctly. It's difficult for me to tell by looking at the application you link what is going wrong. One of the examples does seem to have columns working -- can you be more specific about what you're doing, and what results you are seeing? As for the inline graphics, there is a timing issue involved with using URLs, due to the asynchronous loading. See this comment in the docs for TextFlowTextLineFactory:
    Note: When using inline graphics, the source property of the InlineGraphicElement object   must either be an instance of a DisplayObject or a Class object representing an embedded asset.   URLRequest objects cannot be used. The width and height of the inline graphic at the time the line   is created is used to compose the flow.
    - robin

  • Displaying text from XML.

    Hello,
    I hoping that somone can steer me in the right direction
    here.
    Right now I have an application that reads an XML and
    displays thumbnails of images.
    A user clicks on the thumbnail and a larger image appears.
    What I would like to do is, instead of loading "images" into
    the thumbnails from the XML,
    I would like to load "text" into the thumbnails from the XML.
    So now the user can click on the text and an image would
    appear.
    I just can't seem to get my head around it.
    Attached below is the code I am currently using.
    Thank you for any help you can provide

    Yes Andrei1,
    You mean try something like,
    var holderArray:TextField = new TextField();
    Instead of,
    var holderArray:Array = new Array();
    But,
    this must not be correct because when I create a TextField
    like this.
    I get this error,
    Error #1056: Cannot create property 0 on
    flash.text.TextField.
    What would be the best way to create a TextField inside the
    Thumbnail?
    Thanks for your help.

  • TestStand Property Loader using a XML file

    I would like to use Labview Cluster to build XML files (in LabView 6.1) that could be use by TestStand Property Loader.
    Is it possible?
    Harold Hebert
    National Research Council Canada

    Harold,
    The TestStand Property Loader step type only loads text, comma-delimited, or excel files.
    As alternatives, you could make your own step type that would parse through the XML file to find the properties that you want to load. You could also use the excel VIs to write variable values to an excel file.
    Good luck!
    Shannon R.
    Applications Engineer
    National Instruments

  • After aborted rebuild in Mail: I can see and select the message in the center pane and when I click on it to display, I get "Loading" text, but nothing comes up

    I have searched quite a bit to find a resolution to this problem, with no success. Any help would be appreciated.
    I decided to rebuild my inboxes by following this advice: http://support.apple.com/kb/PH11704. The rebuild took several hours and at 96% (4 minutes remaining apparently), the indexing froze (that is, after 8 hours, the message was still telling me "4 minutes left"). I forced quit mail, restored the previous Envelope files from the trash, and everything seemed fine.
    However, since this failed attempt, I can see and select the message in the center pane and when I click on it to display, I get "Loading" text, but nothing comes up. All messages in my various inboxes have the reloading problem, EXCEPT messages that I downloaded since the aborted rebuild (in other words, there are about 40 messages that I downloaded since I tried the rebuild and I have no problem with these). The other 70,000 messages however wont load, even though I can see them in the centre pane and spotlight has no problem finding them and showing me their contents (when I hover the mouse over the message). When I click on the message in spotlight, mail opens and the loading problem re-occurs.
    Since then, based on various suggestions I found for similar issues, I have used Disk Utility to verify and repair permissions and the drive. I used Onix to rebuild the Mail index (that only took about a minute - I am not sure how to interpret this when compared to the hours the rebuild took with Mail). No joy, I still have the same problem. I even restored one of my inboxes via Time Machine and the same issue with loading continues.
    I am using ML 10.8.2. I have a combination of IMAP accounts (work) and POP accounts (personal). The issue of loading occurs irrespective of the account.
    I am baffled and am now considering migrating to either Thunderbird or Postbox 3 to try and solve my problem. I prefer to stay with Mail. I should note also that I am using MailTags with Mail (http://www.indev.ca/MailTags.html), although I have not used any of the features. I upgraded to ML from SL about 2 weeks ago. It was very smooth and there appear to be no issues (not sure how helpful this is and probably not at all related to this issue).
    Any suggestions much appreciated!

    Maybe these will help:
    https://discussions.apple.com/message/17677533#17677533
    https://discussions.apple.com/message/18324129#18324129
    https://discussions.apple.com/message/18203126#18203126

  • Change the SWF loading text for a single presentation

    This question was posted in response to the following article: http://help.adobe.com/en_US/Presenter/7.0/WS8815BC0A-5D22-4f29-87B9-D9047B5B57E4.html

    Hi,
      I have Adobe Presenter 7.0.5, in which with recently updating to 7.0.7 version.
    When I tried the fix of this "Change the SWF loading text for a single presentation" workaround fix, I passed to have the error:ReferenceError: Error #1069: Property ADOBE_PRESENTER not found on Pool_P75.Resource.UIText
    But before this error comes, I see that the loading text is changes from the original 2Adobe Presenter" to the one defined by me on the UIText, as the fix said.
    And what's happen is that the scrren with the loading text is not being changed by the learning first slide....
    Is there any workaround to correct that error?
    Many thanks in advance for any feedback from the adobe support team or from any other colleagues that are using Adobe Presenter (;-)).

  • How to load images using xml in flash

    Hi
    im working on a quiz project where i plan to load images using xml in to flash, can any one help with the script with AS2 or 3

    You'll find a tutorial for what you are after here:
    http://www.gotoandlearn.com/play?id=22

  • Corrputed loaded text from an Export Datasource with Unicode

    Hi Experts
    I am new with BW and this forum helped me a lot in the past year.
    I am loading texts to an InfoObject using a Master Data (texts) Export DataSource from another InfoObject. The system is NetWeaver 2004s (BW 3.5) with Unicode.
    The InfoObject's Text MD is Language Dependent but users enter the system only with EN language.
    For some reason the loaded texts are corrupted.
    For example:  The original InfoObject has Hebrew texts (that were loaded perfectly from the source system which is also Unicode), but the text in the PSA table and in the text table of the target InfoObject will be: ###########
    Can anyone help?

    Hi Niraj
    Thanks for your answers
    Let me explain:
    Currently, we load texts with Hebrew chars from the SAP ECC6 system and everything is good (we see Hebrew chars in SAPGUI/BEx/WAD etc.)
    The problem occurs when we load these texts from one InfoObject to another, via Export DataSource.
    To do that, We generated an Export DataSource for the original InfoObject and assigned it to the target InfoSource of the other InfoObject. After running an InfoPackage for this DataSource, the texts that were loaded to the PSA (and hence, to the target InfoObject texts table) were corrupted - which means that they appeared: ##########
    Thanks,
    Yaniv

Maybe you are looking for

  • Error after accessing to Oracle BI Spreadsheet Add-in

    Dear all, I downloaded Oracle Database 10g Express Edition (version 10.2.0.1. Beta) and I installed it successfully. I created a new account. Then I downloaded Oracle Business Intelligence Spreadsheet Add-in (version 10.1.2.1) and I installed it succ

  • Photoshop isn't using all the ram that I have.

    I recently installed 8gb of RAM into my Macbook Pro so i could increase the performance of Photoshop. Before using Photoshop, I increased the the "memory usage" slider up to 75% but after I do that, its only using 1gb worth of RAM. Am I doing somethi

  • I/O Error when trying to open pdf file

    I keep getting an error when I am trying to open pdf files from the internet or emails that are sent with pdf files. I am not able to view any of these pdf's - just the i/o error I receive. Anyone have anything to help me on that?? Thank you!

  • [CS5] Project Manager Trimming not supported for HDV footage?

    Yes, I have the licensed version of CS5 Production Premium. The Premiere Pro "Project Manager" allows you to create a "trimmed" version of your project. That is, only the footage actually used in sequences (along with some handles) is placed in the n

  • Why can't I copy a file across a network?

    I am having a very peculiar problem copying a simple text file across a network.  The problem occurs when I try to copy from a newly purchased and newly upgraded MacBook (13 inch aluminum 08) to a 2010 Mac mini. When I try to copy from the MacBook to