To access the XML from a different class

Hi all

I have a xml class that loads the xml data, I need to access the data of another class. I imported the xml classinto the new class and created a new instance of it. However when I try to access the xml data it come back as null. I understand that it is certainly because when she is called the xml data has not completed loading. How can I get around this?

XML class:

package {}

flash.xml import. *;
import flash.events. *;
import flash.net. *.
import flash.display. *.

public class xml extends MovieClip
{
public var xmlRequest:URLRequest;
public var xmlLoader:URLLoader;
public var xmlImages:XML;

public void xml()
{
xmlRequest = new URLRequest ("images.xml");
xmlLoader = new URLLoader (xmlRequest)

xmlLoader.addEventListener (Event.COMPLETE, xmlLoaded);
xmlLoader.load (xmlRequest);
}

private void xmlLoaded(event:Event):void
{
trace (xmlLoader.Data);
xmlImages = new XML (xmlLoader.data);
}
}
}

Thanks in advance

Or even better:

package {     import flash.events.*;     import flash.net.*;     import flash.xml.*;

     public class XMLLoader extends URLLoader     {          public var xmlImages:XML;

          public function XMLLoader()          {

          }

          public function loadXML(url:String):void {               this.addEventListener(Event.COMPLETE, xmlLoaded);               this.load(new URLRequest(url));          }

          private function xmlLoaded(event:Event):void          {               trace(xmlLoader.data);               xmlImages = newXML(this.data);               dispatchEvent(new Event("loadComplete"));          }     }}

Use:

var xmlLoader:XMLLoader = new XMLLoader();
xmlLoader.addEventListener ("loadComplete", onXMLLoad);

xmlLoader.loadXML ("images.xml");

function onXMLLoad(e:Event):void {}
trace (xmlLoader.xmlImages);
}

Tags: Adobe Animate

Similar Questions

  • To access the data from database to a remote computer

    Hi all

    Can someone tell me how to access data from a database, sitting on another computer? I use the Sqlite database. It works fine in my computer. But I don't know hoe to put the database in another computer (server) and access the data from there. In my program, it is essential to do this for a simultaneous use for different users. Someone please help.

    Kind regards

    Cindy.

    I found the solution... http://ConnectionStrings.com/

  • cannot access the internet from the desktop

    I am able to access the internet through the application of start page, but cannot access the internet from the desktop page. The convenience store has not detected a problem. Does not work via Wifi or wired broadband direct.

    Hello

    Are you using the right Internet Explorer?

    There are two more separate... From the start screen and another completely different for the office.

  • To access the files from the computers on the same network.

    We recently bought two Macs and an airport Time Capsule as we were told that it would allow us to access the files from one computer to another. Run us a business out of our home and require both Mac to be able to access the files from each other or have at least a common location to save etc. Both Mac is put back up automatically and lift you under the "Shared" section of the Finder. The airport shows also here as well. I don't understand how to get this to work so that I can share files easily. Any help would be appreciated.

    Open the system preferences sharing pane, start sharing files if necessary, and then use the connection to the server command in the Finder menu go.

    (142670)

  • Outlook Express has stopped to let me access the internet from an e-mail.

    Outlook express

    A week ago, Outlook Express stopped allowing me to access the internet from an e-mail.  If someone sends you an e-mail with a WEB address, that it does not connect to it just says connection.  Could not find a way to fix this.  If anyone can help.  Thank you

    Hyperlinks do not work in Outlook Express or in Word (revised 29-Apr-09)
    http://support.Microsoft.com/kb/823301

    Hyperlinks do not work in Outlook Express after you put upgraded to IE7 [or IE8] (revised 29-Apr-09)
    http://support.Microsoft.com/kb/929867

    If still no joy:

    With the permission of MVP Frank Saunders. [RIP]

    If nothing happens when you click on a link:
    Open Windows Explorer or on the control panel.
    Go to tools | Folder options | Types of files.
    Scroll to [NONE] URL: HyperText Transfer Protocol (NOT the shortcut URL: Internet) and select it.
    Click Edit or advanced, depending on your version of Windows.
    Choose 'open '.
    Click on change.

    "Application used to perform action" should read:

    "C:\PROGRAM may EXPLORER\iexplore.exe" - nohome (check the path to)
    Iexplore.exe to ensure that it is correct and use the double quotes).

    DDE should be checked and in the boxes below, you should have:

    #1:
    « %1 »,,-1,0,,,
    #2
    IExplore
    #3 (white)

    #4
    WWW_OpenURL

    Protocol URL: HyperText Transfer with Privacy should be the same.

    If the foregoing is correct, uncheck the box: use DDE.

  • to access the eprint from iphone problems

    I have an officejet 6500 has more.  I can access the printer from my iphone at home on my home network fine.  When I'm away from home I can not access the printer through the eprint application.  I connected to the eprint and activated / adding the printer.

    Any suggestion?

    Hello

    Seems that there is communication developed here.

    The iphone uses AIRPRINT and EPRINT not. For airprint works, you two units must be on the same network.

    However, you can use Eprint from your Iphone by sending everything you want to print to the adres e-mail provided by the printer when you set up Eprint.

  • Cannot access the files from the internal hard drive that has been converted to drive external hard after the motherboard is dead

    I can't access the files from an internal hard drive that has been converted to drive external hard after the motherboard is dead. I think that my files are still there, as shown in the volume of the player volume ~ 500 gb which is almost completely full. But I can't access most files, including documents and settings. When I took 'ownership' of the folder, I could open the TI but then it showed everything that was in my documents and settings on the computer file I used to open it, not the documents of the car.

    I can't access the files from an internal hard drive that has been converted to drive external hard after the motherboard is dead. I think that my files are still there, as shown in the volume of the player volume ~ 500 gb which is almost completely full. But I can't access most files, including documents and settings. When I took 'ownership' of the folder, I could open the TI but then it showed everything that was in my documents and settings on the computer file I used to open it, not the documents of the car.

    Uhm... I think the issue here is a misunderstanding of what you watch.

    If you want to access your files from the old hard drive - you need to look in the right place.  If the old system was "Windows 7", "Documents and Settings" is the * wrong * place to look and "Users" would be the place to go.

    You * will * take ownership and change permissions on ALL (you want to propagate to all subfolders/files when do - to save time) in order to get them properly.

    New-->: Windows Vista/7 would have your files located in the directory 'Users' of the root of the drive - and then under your username.

    • \USERS\\Desktop\
    • \USERS\\Downloads\
    • \USERS\\Favorites\
    • \USERS\\Documents\
    • \USERS\\Music\
    • \USERS\\Pictures\
    • \USERS\\Videos\

    ... etc...

    Documents and settings to WIndows Vista/Windows 7 is a symbolic link and would lead to what you see if you tried to use it.

  • Can I access the guest from the server OS (virtual machine)?

    Hi all

    Can I access the guest from the server OS (virtual machine)? I mean, I would also like to start and discovers a guest OS (VM) directly in the server as in VMware Server 2.0. I would also like to see the graphic on the server management console to manage virtual machines.

    Or do I always have at least two computers? For example, the server ESXi without GUI / frontend access and the client with vCenter, vInfrastructure, blah-blah-blah,...?

    Thanks for the replies!

    Best regards

    Joao Araujo

    You will need the Client or another tool for access (RDP, SSH) a machine separate. ESXi is a very tiny BONES.

  • Flash as2 cross subject to access the SWF from another server domain

    I have question cross-domain, how do I access the .swf from another swf file without using System.Security.allowDomain() in the swf file, which we are called.

    I use 2 domains and I have 2 files swf is a.com (a.swf) and another is of bcom (b.swf) I want to access the file the a.swf b.swf frames, if I use the system.Security.allowDomain() in b.swf file I can access executives. But without using this way I can access the file from another domain.

    Because I have a risk to change the file b.swf so I vant to go without changing the file b.swf is any other wey to access frames of the file the file a.swf b.swf. Please someone help me solve this problem.

    use a local executable (such as php) to load the b.swf and send it back to a.swf.  for example:

    loadSWF.php:

    <>

    $fh = fopen ("www.b.com/b.swf", "r");

    Header ("Content-type: application/x-shockwave-flash");

    fpassthru ($FH);

    ?>

    a.fla:

    var target_mc:MovieClip=this.createEmptyMovieClip("target_mc",this.getNextHighestDepth());

    target_mc.loadMovie ("loadSWF.php");

  • Cannot access the XML file on localhost.

    Type localhost or 127.0.0.1 in any browser on a Macintosh (os 10.5) does not have access to the host computer.

    The following Actionscript code generates the following error:

    var XMLURL:URLRequest = new URLRequest ("http://localhost/quoteRotator/quotes1.xml");

    Error opening URL ' http://localhost/quoteRotator/quotes1.XML '

    #2044 error: Unhandled IO error...

    How can I access the XML file using Actionscript 3?

    Thanks for your help.

    use:

    var XMLURL:URLRequest = new URLRequest("quotes1.xml");
    
  • How to get the XML from the Request of Java object before sending. SOAP Web services

    I'm building Java request to Online Web Services and we'll call it application A . I got the WSDL forms the second part of the file in order to communicate with their application and we'll call it application B .

    Of the WSDL file generate the Java required classes that are Requests and Responses . classes Application A will send some request object after setting the parameters required and with the exception of response object of application B .

    The connection is established and the two applications A and B communicate with each other.

    Question:

    Of application A How can I get the xml data (or text file) for the request object before sending it to application B ?

    As described the connection is passing Java object such as request and I know that in some point this request will be converted to xml file. How to get it?

    -EDIT-

    Missing important information which can be confusing.

    I'm generated the Java rating were generated using the Axis framework

    The problem is solved by, add the following statements in the bindingStub class that was automatically generated from the WSDL file to the web-services you are trying to access.

       String request = _call.getMessageContext().getRequestMessage().getSOAPPartAsString(); 
     String response = _call.getMessageContext().getResponseMessage().getSOAPPartAsString();
    

    These statements should be placed after the following method call _call.invoke otherwise you will get NullPointerException .

    _callis a variable of type org.apache.axis.client.Cal and it is automatically generated byAxis

  • How to configure the VPN LAN to access the internet from the remote network

    I have set up for our project site to another Office VPN. Please join.
    Now I have already configured Site to site vpn between ASA 5510 and 1841 router.

    HQ LAN

    Branch of the LAN
                     10.2.1.0/24 > ASA 5510 1841 > > INTERNET < 1841=""> <> 10.30.3.0/24
    ^
    ^
    ^
    ^
    Call Manager
    No. 2851
    Now access from branch LAN LAN of HQ each other.

    I face problems that are
    (1) in the direction of LAN, they can access HQ LAN & resource, but cannot access the internet. I did not configure NAT on the router PH
    (2) can I access internet BRANCH LAN via HQ LAN INTERNET. Where can I access the Internet of general management of the LAN of the PH router directly while access to the VPN to the local network of HQ?
    (3) in the Site of the Directorate, phone hard cannot work but phone on PC can call to Headquarters. Hard IP phone are same in remote network (172.16.1.0/24 ). What's the problem? How can I configure separately?

    Please give advise me how should I do.

    Hello

    (1) in the direction of LAN, they can access HQ LAN & resource, but cannot access the internet. I did not configure NAT on the router PH

    Answer:

    You must configure the NAT and crossed to the ASA HQ so that the VPN branch router provides LAN and u-Turn, access to Internet of the SAA.  You must first seup NAT for the branch on the SAA router subnet, then you must type the command:

    permit same-security-traffic intra-interface

    Here's a great example for VPN client hairpining.

    http://www.Cisco.com/en/us/products/ps6120/products_configuration_example09186a00805734ae.shtml

    (2) can I access internet BRANCH LAN via HQ LAN INTERNET. Where can I access the Internet of general management of the LAN of the PH router directly while access to the VPN to the local network of HQ?

    Yes, you can

    (3) in the Site of the Directorate, phone hard cannot work but phone on PC can call to Headquarters. Hard IP phone are same in remote network (172.16.1.0/24 ). What's the problem? How can I configure separately?

    You must change your subnet VLANS to be different from the subnet HQ voice phone IP VOice VLAn, it should be fine.

    Kind regards

    Mohamed

  • How to access the virtual machines to different physical network?

    Hello

    I'm new to ESXi, can someone tell me how can I access virtual machines on the physical network existing in case I use different IP classes? Physics of the network by using the class C IPs and I assigned IPs to virtual machines of class A? If it is possible, then, what are the steps?

    In fact, I installed exchange 2010 VMs and also want to access the email accounts of physical network.

    Thank you.

    vmjunki wrote:

    You mean there's no way in ESXi to configure the way so we can access the virtual machines to physical network? without third-party applications.

    Because it is impossible for the various networks IP connect without a router, you must have such a device. There is really no difference in that in a pure virtual or physical environment.

    You might think the ESXi host as a box with one or more servers (virtual) inside and one or more layer (virtual) two switches, just like a small server room. This means you will need to provide the same type of connectivity that you would have to a new server room with machines configured with addresses in a different IP network range.

  • Generation of the XML from the Oracle tables

    I'm using Oracle 11 g R1.

    I have two tables header and the line:

    CREATE THE TABLE HEADER
    (
    EXPENSE_INFO VARCHAR2 (2000).
    NUMBER OF ERROR_CODE,
    REASON_OF_FAILURE VARCHAR2 (4000)
    )
    /


    CREATE THE ROW IN THE TABLE
    (
    EXPENSE_INFO VARCHAR2 (2000).
    DATE OF EXPENSE_DATE,
    EXPENSE_CODE VARCHAR2 (10),
    EXPENSE_REF VARCHAR2 (2000).
    GROSS_AMOUNT NUMBER,
    NUMBER OF TAX_AMOUNT,
    NUMBER OF ERROR_CODE,
    REASON_OF_FAILURE VARCHAR2 (4000)
    )
    /

    These tables are linked by the EXPENSE_INFO column.

    Complete the tables with the following data:

    Insert in the header (ErrorCode, EXPENSE_INFO, REASON_OF_FAILURE)
    values ('A', 0, 'SUCCESS');

    Insert (EXPENSE_INFO, EXPENSE_DATE, EXPENSE_CODE, EXPENSE_REF, GROSS_AMOUNT, TAX_AMOUNT, ERROR_CODE, REASON_OF_FAILURE) online
    values ('A', to_date (December 14, 2012 ', 'dd-mm-yyyy'), 'ABC', 'HOTEL', 100, 500, 0, 'SUCCESS');

    Insert (EXPENSE_INFO, EXPENSE_DATE, EXPENSE_CODE, EXPENSE_REF, GROSS_AMOUNT, TAX_AMOUNT, ERROR_CODE, REASON_OF_FAILURE) online
    values ('A', to_date (December 14, 2012 ', 'dd-mm-yyyy'), 'DEF', 'MOVIE', 10, 50, 1, "Cost Code does not exist.");

    Insert in the header (ErrorCode, EXPENSE_INFO, REASON_OF_FAILURE)
    values ('B', 1, "Emp Id does not exist.");

    Insert (EXPENSE_INFO, EXPENSE_DATE, EXPENSE_CODE, EXPENSE_REF, GROSS_AMOUNT, TAX_AMOUNT, ERROR_CODE, REASON_OF_FAILURE) online
    values ('B', to_date (December 14, 2012 ', 'dd-mm-yyyy'), "XYZ", "MILEAGE", 200, 300, 0, 'SUCCESS');



    I want to generate the XML following these tables:


    COSTS of <>
    < EXPENSE_DETAILS >
    < EXPENSE_INFO > is < / EXPENSE_INFO >
    < ERROR_CODE > 0 < / ERROR_CODE >
    SUCCESS of < REASON_OF_FAILURE > < / REASON_OF_FAILURE >
    < EXPENSE_LINES >
    < EXPENSE_LINE_REC >
    < EXPENSE_INFO > is < / EXPENSE_INFO >
    < EXPENSE_DATE > 14/12/2012 00:00:00 < / EXPENSE_DATE >
    ABC of < EXPENSE_CODE > < / EXPENSE_CODE >
    HOTEL < EXPENSE_REF > < / EXPENSE_REF >
    < GROSS_AMOUNT > 100 < / GROSS_AMOUNT >
    < > 500 TAX_AMOUNT < / TAX_AMOUNT >
    < ERROR_CODE > 0 < / ERROR_CODE >
    SUCCESS of < REASON_OF_FAILURE > < / REASON_OF_FAILURE >
    < / EXPENSE_LINE_REC >
    < EXPENSE_LINE_REC >
    < EXPENSE_INFO > is < / EXPENSE_INFO >
    < EXPENSE_DATE > 14/12/2012 00:00:00 < / EXPENSE_DATE >
    DEF < EXPENSE_CODE > < / EXPENSE_CODE >
    FILM of < EXPENSE_REF > < / EXPENSE_REF >
    < GROSS_AMOUNT > 10 < / GROSS_AMOUNT >
    < TAX_AMOUNT > 50 < / TAX_AMOUNT >
    < ERROR_CODE > 1 < / ERROR_CODE >
    < REASON_OF_FAILURE > fresh Code does not exist. < / REASON_OF_FAILURE >
    < / EXPENSE_LINE_REC >
    < / EXPENSE_LINES >
    < / EXPENSE_DETAILS >
    < EXPENSE_DETAILS >
    B < EXPENSE_INFO > < / EXPENSE_INFO >
    < ERROR_CODE > 1 < / ERROR_CODE >
    < REASON_OF_FAILURE > Employee Id does not exist. < / REASON_OF_FAILURE >
    < EXPENSE_LINES >
    < EXPENSE_LINE_REC >
    B < EXPENSE_INFO > < / EXPENSE_INFO >
    < EXPENSE_DATE > 14/12/2012 00:00:00 < / EXPENSE_DATE >
    XYZ < EXPENSE_CODE > < / EXPENSE_CODE >
    POINT MILE < EXPENSE_REF > < / EXPENSE_REF >
    < > 200 GROSS_AMOUNT < / GROSS_AMOUNT >
    < > 300 TAX_AMOUNT < / TAX_AMOUNT >
    < ERROR_CODE > 0 < / ERROR_CODE >
    SUCCESS of < REASON_OF_FAILURE > < / REASON_OF_FAILURE >
    < / EXPENSE_LINE_REC >
    < / EXPENSE_LINES >
    < / EXPENSE_DETAILS >
    < / SPENDING >


    I'm not able to generate the XML file. Kindly help me.

    Kind regards
    Sudhanshu

    I love working at the deepest level and then "wrap" with external level tags.

    You want to list all columns of each LINE by line. XMLFOREST is good for this:

    select xmlforest(
      expense_info, expense_date, expense_code, expense_ref,
      gross_amount, tax_amount, error_code, reason_of_failure
    )
    from line;
    
    A
    2012-12-14
    ABC
    HOTEL
    100
    500
    0
    SUCCESS
    ...
    

    Now you want to wrap this up in EXPENSE_LINE_REC

    select xmlelement("EXPENSE_LINE_REC",
      xmlforest(
        expense_info, expense_date, expense_code, expense_ref,
        gross_amount, tax_amount, error_code, reason_of_failure
      )
    )
    from line;
    
    
      A
      2012-12-14
      ABC
      HOTEL
      100
      500
      0
      SUCCESS
    
    

    So far, you have a XML fragment by line in the table of the LINE. You can use XMLAGG to put those together in a single fragment - or rather, a fragment by EXPENSE_INFO.

    Then you use XMLELEMENT again to give the name "EXPENSE_LINES" in this fragment.

    Then you gather the header values and the 'EXPENSE_LINES' fragment in "EXPENSE_DETAILS". This gives you all the information for each row header and associated lines of the LINE.

    Then, you gather all the information into one with XMLAGG header, and give everything a name with XMLELEMENT

    select xmlelement("EXPENSES",
      xmlagg(
        xmlelement("EXPENSE_DETAILS",
          xmlforest(expense_info, a.error_code, a.reason_of_failure),
          xmlelement("EXPENSE_LINES",
            xmlagg(
              xmlelement("EXPENSE_LINE_REC",
                xmlforest(
                  b.expense_date, b.expense_code, b.expense_ref,
                  b.gross_amount, b.tax_amount, b.error_code, b.reason_of_failure
                )
              )
            )
          )
        )
      )
    )
    from header a join line b using(expense_info)
    group by expense_info, a.error_code, a.reason_of_failure;
    

    _Note: _ with the GROUP BY clause, you can 'total' twice, once at the expense_info level and then overall. That's what I do with the two XMLAGGs: the second he puts just all the different stuff EXPENSE_DETAILS together in one package that I wrap "CHARGES" tag autour.

    Also, I omit EXPENSE_INFO of each LINE as it is already in the header information.

    Published by: stew Ashton on December 17, 2012 14:03

  • Using the XML instead of rowImpl class?

    Hello

    I have the following query.
    There is a class of VO1ViewObjectRowImpl in which I can access another method of the viewobjectRowImpl class. It works very well. My query is can I perform the same know to retrieve the values of all lines of the view object another without generating java class for it? In other words, is there a way to use the .xml rather than the VO2ViewObjectRowImpl class file? If so, please refer to the link where I can find the information.

    Please answer this.

    Thanks and greetings

    Hello

    You can still access a display object that is not a class Impl. Simply add custom methods or override default methods, a class of impl. If the VO is dependent on you can access them to the link view defined on the VO Campeau accessor. If they are not linked you can access AOS to find one instance of VO

    Frank

Maybe you are looking for