Need some help with loading of XML text

So here's how I support my xml:

var xmlLoader:URLLoader = new URLLoader();

var xmlData:XML = new XML();

xmlLoader.addEventListener (Event.COMPLETE, LoadXML);

xmlLoader.load (new URLRequest ("sampleXML.xml"));

function LoadXML(e:Event):void {}

xmlData = new XML (e.target.data);

trace (XMLDATA);


}

And it works. My question is what code put to replace trace (xmlData); with the code that will allow me the XML components be arranged in textfields. Here's how my XML is built:

< xml >

< slogan1 > texttttt < / slogan1 >

< slogan2 > textttttt < / slogan2 >

< slogan3 > texttttt < / slogan3 >

< slogan4 > texttttttttttt < / slogan4 >

< / xml >

What code set AS so when I start to appoint my textfields tf1, tf2, tf3 tf4 each line of XML to go to its text field (as first line of the XML goes to tf1, second line for tf2 etc.).

If these textfields already exists when your code runs, you can use:

var tl:MovieClip =;

var xmlLoader:URLLoader = new URLLoader();

var xmlData:XML = new XML();

xmlLoader.addEventListener (Event.COMPLETE, LoadXML);

xmlLoader.load (new URLRequest ("sampleXML.xml"));

function LoadXML(e:Event):void {}

xmlData = new XML (e.target.data);

for (var i: uint = 0; i<>

TL ["TF" +(i+1)]. Text = XMLDATA. Children() [i];

}


}

Tags: Adobe Animate

Similar Questions

  • Need some help with FLASH

    Hello world

    I'm a very new to using flash 8 and I need som help.

    I know what it mifgt be a simple for some of you, but for me it's a chlange...

    I need to create a page with 6 buttons

    I can create a button without a problem and I can scrupt uncertain and it will open url

    However, if I have 4-5 buttons every thing work towards the top, down etc but the script does not work then link do not OUP page...

    I'm sure it's a simple soluton to this question

    Help, please

    I would like to join .fla file to show what I was doing, but it seems that it's not possible...

    Anyway please help if you can

    Sincerely

    L.

    Your instance names must match those that you use in the code.  The name of the instance provides the means for code assignment and control objects.  If you have btn1 as instance name, the code for this button should use this name...

    Btn1.onRelease = function() {}
    getURL ("http://www.google.com");
    }

    Think of it in terms of talking to the touch... you gave this button name "btn1", so your code needs to say "Hey, btn1, this.

    In addition, in order to keep things clean for yourself, you must create a layer for actionscript, where you take all the code you are currently distributed through the layers of each button and move to that layer.  I often create some to separate the different types of actionscript, variables, functions, actions, but you can do what suits you best.  But having it on separate layers makes it easier to find and manage.

  • Need help with loading the XML file

    Hello

    I spent reviewing the web/forums for an example on how to do this for a few days now.  I managed to get this working in Flash Pro easily enough, but I think I'm missing something when I want to do the same thing in Flex.

    Basically, I want to load an XML file and then set the values of the text of labels 5, equal to the data in the XML file.

    So I have a button created in MXML and have put the following click event:

    Click = "dsSetup (Event)" "

    I also stated the following:

    public var myRequest:URLRequest = new URLRequest ("assets/myFile.xml");   folder located under the CBC in project

    public var myLoader:URLLoader = new URLLoader();

    public var myXML:XML;

    My function that loads is as follows:

    public function dsSetup(event:MouseEvent):void

    {

         trace ("dsSetup");

    myXML = new XML (myLoader.data);

    H3. Text = myXML.source.itemA;

    H4.text = myXML.source.itemB;

    H5.text = myXML.source.itemC;

    H7.text = myXML.source.itemD;

    H8.text = myXML.source.itemE;

    currentState = "MainMenu";

    }

    myLoader.addEventListener (Event.COMPLETE, dsSetup);   I think that this line is no longer as I put it in the MXML

    myLoader.load (myRequest);

    It's the way I did in Flash and it worked fine, but I must be missing something when it comes to Flex.

    Can you explain or point me to a good tutorial that shows how to load XML in Flex code?

    Those I've found seems to have about 50 lines of code just to load a file and add through a complex for a beginner.

    Thank you very much

    I suggest you save the data loaded in a variable that can be linked, then bind the properties of the text - who:

    [Bindable]

    var myXML:XML;

    public void dsSetup(event:MouseEvent):void

    {

    myXML = new XML (myLoader.data);

    currentState = "MainMenu";

    }

    ...

  • Need help with loading in a different place every time the page reloaded the film.

    Hello

    I have a Flash movie that I need to go to one of the 6 chosen images when say a user presses the button back or home page of the site. I don't want just the same user, see the flash movie to play again in the same place each time that they return home.

    Help with this is appreciated.

    Thanks advance.

    -Ann

    Here's what I wrote:

    var numbers: Array = [2,114,415,687,960,1195,1485];

    _root.firstTime = true;

    {if (Firsttime)}

    firstTime = false;

    The frame number: var = Math.floor (Math.random () * numbers.) (Length);

    gotoAndPlay ([frame] numbers);

    }

    I also tried this:

    Array.prototype.shuffle = function() {}
    for (var = this.length - 1; ivar ivar > = 0; ivar-) {}
    var p = random (ivar + 1);
    var t = this [ivar];
    This [ivar] = this [p];
    This [p] = t;
    }
    };
    ASSetPropFlags (Array.prototype, ["shuffle"], 1, 1);
    var Array_ar:Array = new Array (2,114,415,687,960,1195,1485);
    Array_ar.shuffle ();
    index = 0;
    function load_random() {}
    gotoAndPlay(Array_ar[index++]);
    If (index == Array_ar.length) {}
    (index = 0);
    }
    }
    load_random();

    But this Dungeon jumping whenever I hit the back of the frame 1 or refresh.

    Thanks again.

    use:

    var numbers: Array = [2,114,415,687,960,1195,1485];

    The frame number: var = Math.floor (Math.random () * numbers.length);

    gotoAndPlay ([frame] numbers);

  • UPDATES TO XP 0X0824800A I NEED SOME HELP PLEASE

    Hi can I have help with updates, I have a code ox8024800A it drives me crazy please help.steveop.

    As the error number was typed at least once (disparity between those cited in your question and its support of text), maybe he was did twice. There is an error code well documented on this forum which is 0x8024400A. What is the actual error code? If it is then this thread can help you...

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_xp-windows_update/error-code-number-ox8024400a-in-Windows-Update/10c49c41-0f5b-4053-9330-bf4cc897e8d8

    .. marked as an answer by the ordering party.

    If your code isn't 0x8024400A then please follow the advice already given.

    Tricky

  • problem with loading of XML

    For example, the following code is in a class - it's a setter function. I noticed the output of each trace statement... I don't know, but it does not seem to load the XML file. Obviously, if my tracing instructions don't work, my second class appeal will not (and does not) work.

    Maybe can you help?

    Try:

    var xnNode:XMLNode = this.firstChild;

  • Samyak Veera - can do some help with adobe photoshop elements 9?

    Hello, my name is Samyak Veera United States


    I bought adobe photo shop elements 9 and adobe first element 9... It has 2 DVD. Can you tell me what to do with the disc 1 and disc 2 and it will help me with film taken they way it help with photo? / And hence I get the solution. I know how to use adobe but what I can do with this expansive thing.


    Thank you

    Solaine Veera

    Hi Khaled.  I'm sorry it took two hours for your position to be decided, but this isn't the forum elements.

    You can go ask in this forum please:

    Photoshop Elements

    Or maybe this forum:

    First Elements

    Good luck

  • Need help with loading analyzed text RSS

    Hi, I've created an AS3 FLA where I am the analysis and displays the text of RSS. I've traced the analyzed text and the text displayed in the boxes of dynamic text on the stage without problem.
    However the line breaks in the text will appear on stage as well.
    How does a band on the < p > or </r > tags in the text to make the text a nice long line that ends with the length of the text as parameters box is?

    OK, I found the answer, thanks all.

    var myvar:String = myDynamicText.text;
    myDynamicText.text = myvar.split ("\r").join("");
    myDynamicText.text = myDynamicText.text.split("\n").join("");

  • need help with loading Flash on Apple Mac Mini

    Lost my username, password & I am unable to load flash version 8 or better, totally computer illiterate & need HELP!

    Hi Michael,

    Please see what userid & password I need to install Flash Player?.

    --

    Maria

  • need help with loading the icon

    can I get help about icon loading in oracle forms?

    OK make a folder name it icons and copy all you are gif icons and paste into the same folder (icons), and then copy the icons folder and paste in
    D:\DevSuiteHome_1\forms\java\oracle\forms

    When you want to display the icon, then do not use .gif (Note: sometimes also works with .gif) and something more Stéphane on capital letter of gif - icons.it should be in letter.i hope that you understand.

    Sarah

  • need help with loading paper inkjet 4635

    I just bought a HP Office Jet 46635 and I can understand how to load the paper.   Can anyone help?

    Here's the Manual.  PG 24 illustrates how to load the paper. Happy new year!!

  • Need help with loading BSO cube with several data export files using the Regional service

    Hello

    We have BSO cubes that are huge and when I expoted data in files, it generated ABC.txt, ABC_1.txt, ABC_2.txt, like this.

    How to load this data in the Cube that sits on the other environments? We use Essbase 9.3.1.

    I can load the individual files using EAS data loading? If so, ABC_2.txt then ABC_1.txt and finally an ABC.txt would be the loading sequence back?

    Please suggest.

    As Essbase is written this block by block, each block will have its complete info if it is done as a single export or parallel export. You can easily prove this (and I have) If you export a database and load only files 2 or 3, it loads without error. don't forget that you load a file rules, the load fails when the first error. There is no error found, so a value of a complete block of information must be present. Also open export (large files can be opened with wordpad) and you will see a complete info for block exery

  • Need help with analysis on XML DataGrid

    Hello

    I retrivied in my function from HttpService result data.


    < list >
    < user >
    < ename > JAMES < / ename >
    < > 7900 empno < / empno >
    < / user >
    < user >
    < ename > FORD < / ename >
    < > 7902 empno < / empno >
    < / user >
    < user >
    < ename > MILLER < / ename >
    < > 7934 empno < / empno >
    < / user >
    < / list >

    [Bindable]
    private var xmldata:XML;

    private void resultHandler(event:ResultEvent):void {}
    XMLDATA = Event.Result as XML;
    }


    < mx:DataGrid x = "50" y = "23" width = "469" height = "265" dataProvider = "{xmldata." The user} ">"
    < mx:columns >
    < mx:DataGridColumn headerText = "Type" dataField = "ename" / >
    < mx:DataGridColumn headerText = "Sales" dataField = "empno" / >
    < / mx:columns >
    < / mx:DataGrid >

    But this displays all the data in the DataGrid control.

    Could someone help me please.

    Thank you.

    After obtaining data affect data in the data grid

    DataGrid.DataProvider = xml;

    and also do datagrid.invalidateList () after u get the data if the line above does not help

    See also if the data provider is not null, if nothing is done.

  • Need help with loading lightroom 6

    Loaded disc. happens by entering the serial number is application to choose a name. does not load program.

    You must go in the App Store, and then you could spend MAC

    You can also contact Apple Chat Support for the upgrade.

  • I need some help please (web Vsphere client connection problem with Vcenter)

    Dear professionals

    I can not connect to the server via the customer web vicenter.

    I have installed and configured the following successfully:

    -esxi5.5

    -Win 2008 server1 (installed on AD)

    -Server2 Win 2008 joined to the domain, then I installed on: sso, inventory, customer web Vsphere and vcenter server service

    as you can see in the attached photos, when I double click on the client vsphere of wen I should be able to log on to the server vcenter, but I couldn't do it.

    do not forget that I logged Win 2008 server2 as a domain administrator, then I installed sso, inventory, customer web Vsphere and vcenter server service

    the WebClient service is runningand I tried https://server.example.com:9443 / vsphere client.

    There are more than two things, I noticed:

    -When I turned the web customer service I got the certificate error (see photo).

    -When I typed nslookup in the domain controller I got the error message.  web vsphere client error is related to the DNS error in the domain controller?


    Please see the pictures attached.

    Please tell me what to do if you have any idea or what is the cause of this problem.

    Please let me know as soon as possible because I've stuck to that point where I can't connect to the via customer web vsphere vcenter.

    Best regards


    naoufl

    Please register these two servers to the DNS entry field. and make sure both servers firewall set OFF mode.  If the production environment please check the network connection by using the network firewall team.

Maybe you are looking for

  • I lost my iphone and its dead and I can't find on find my iphone help please!

    I lost my iphone it also died and find my iphone does not. help please

  • Search including VI LV executable utility

    To enable my operators search 'service of interest' then, they know who subVI (s) to open the troubleshooting system, how can I include a function text search utility in my main VI? Thank you

  • See the line between cursors on a graph

    Hello I have a graph simple intensity with two sets of sliders on it, called 1 and 2 cursor cursor.  I would like to make a distinction between the sliders so that when the user moves a cursor can see a line superimposed on the graph.  Please see the

  • Error in the capture of several channels using pre-trigger

    I have problems of acquiring data with pre-trigger samples during the capture of several channels, using hardware NOR-PXI-6071E and Analog Input VIs in Labview (inheritance OR-DAQ). My goal is to trigger a signal, while capturing another. Unfortunate

  • S5120Y wiring diagram business Slimline

    I am repairing a HP Pavilion Slimline of S5120Y. I've been looking for a case wiring diagram Slimline help identify the correct façade component wiring to install on my card mother ASUS P5G41T-M LX Plus. I have the diagram for the motherboard but I a