My event.result may or may not return a node in the xml file. How can I avoid that TypeError: Error #1009:

My event.result may or may not return a node in the xml file. How can I avoid that TypeError: Error #1009: cannot access a property or method of a null object reference.

I have a very simple question. I want to take the value of

Event.Result.Item.nodeindex1.nodeindex2.Row.MyValue;

and assign it to a text field

mytextTi.text = event.result.item.nodeindex1.nodeindex2.row.myvalue;

But if a part of the tree is missing, which is also valid, so I get TypeError: Error #1009: cannot access a property or method of a null object reference.

I tried various solutions such as the following. Is there any simple way to do this?

If (event.result.item.nodeindex1.nodeindex2.row.myvalue! = undefined)-does not work

Unfortunately, one must test all levels to ensure that it is not null before the reference to it. You can take advantage of the short-circuit evaluation in tying together, for example

if (event.result.item
    && event.result.item.nodeindex1
    && event.result.item.nodeindex1.nodeindex2
    && event.result.item.nodeindex1.nodeindex2.row
    && event.result.item.nodeindex1.nodeindex2.row.myvalue)
{
    // access the variable
}
else
{
    // one of the XML nodes in the path is null
}

Or you could stay away from her a little hacky and wrap the reference in a try/catch block.

-Tom

Flex SDK engineer

Tags: Flex

Similar Questions

  • Now when I open my email in Outlook Express, it opens in full screen and will not restore down on a smaller size. How can I reset that?

    Already when I opened my email open in small size.  Now when I open my email in Outlook Express, it opens in full screen and will not restore down on a smaller size.  How can I reset that?

    Then, you need to ask in this forum I posted above. I have not used it myself and can be useful.
     

     
     
  • I bought photoshop CS5 in 2011 and my laptop crashed and I bought a new one and had to re install the program. How can I do that I have my original email with the confirmation number ETC, but it does not appear on my order history?

    I bought photoshop CS5 in 2011 and my laptop crashed and I bought a new one and had to re install the program. How can I do that I have my original email with the confirmation number ETC, but it does not appear on my order history?

    Download from products of CS5 download

    Install and enter your serial number.

  • Current default got accidentally updated Firefox to the ".lnk" files How can I cancel it and return to default unknown?

    Control Panel > programs > by default of the programs > set Associations:

    type of file (LNK file) .lnk says unknown under current by default.  I double clicked it and the Menu recommended programs showed only Firefox.  I chose what has changed all the icons for all quick links for Firefox symbol.  Double click on them now opens a tab in the browser to open the appropriate program.  How to return to the settings and the appropriate links? Larry Johnson

    pajldj wrote:

    Control Panel > programs > by default of the programs > set Associations:

    PhilipsJason wrote:

    Open Control Panel.  In the upper right corner, there is an option for "Category view" or small/large icons.  Change the option for now on small icons.  (you can change this return later, all this for ease of use)  Now that you have quite a few icons, open "Default programs".  Then, using the 'Set the Associations' option, you can adjust how Windows manages any type of single file.  :)

    Try Nice PhilipsJason, but I have the impression that this is exactly pajldj changed file association before selecting Firefox accidentally, and it is impossible to undo this change because all Associations does not "Unknown Application" as an option to choose ;)

    Hi pajldj,

    Try this:

    1. Press the Windows key + R > type regedit and press enter
    2. Go to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.lnk
    3. OpenWithList should contain only:
      • (Default) | REG_SZ | (value not set)
    4. OpenWithProgids should contain only:
      • (Default) | REG_SZ | (value not set)
      • LNKFILE | REG_NONE. (binary value of length zero)
    5. Make sure that there is no subkey/subfolder UserChoice (if you see him, do a right-click on UserChoice > delete )
    6. Restart your system

    This is what the mentioned key should look like:

  • How can I avoid that this case WordPerfect win 7 having to ask for permission to start a program all the time!@#!@#@!#__In. He did not this in the draft.

    None

    Hello arcangelbc,

    Right-click on the executable of Wordperfect.  There, select Properties.  Select the Compatibility tab.  Check the box for run as admin.  This should prevent UAC from prompting the user each time you.  It is essentially a method of cheating to get around UAC.  It is not advisable to do so, but this is how you do it.  Bypassing UAC can leave you open system for security risks.

    Kind regards
    ~ Alex T. ~.
    ~ MVP Windows desktop experience ~

  • I know not how it happened, but my screen and icons returned to a style of portrait. How can I get that back to her former landscape format?

    My screen turned to the right so that it becomes impossible to use correctly. Maybe, I did something when I was working with my photos?

    Can you help me?

    Press Ctrl & Alt keys and use the arrows to rotate back.
     
    According to the graphics card on your computer, these can be alternatives.
     
    Right click on the desktop | Graphics options | Rotation.
     
    Right click on the desktop | Screen resolution | Orientation.
     
  • After downloading firefox 4, I lost my discount and return to the House. How can I get that back. Thank you

    How I got my menu bar back, with the circle of discounting and the return at home

    In Firefox 4 Home button will have been moved to the right side of the navigation bar.

    By default the Stop, Go and Reload (Refresh) buttons are combined and attached on the right edge of the address bar.

    When you type in the address bar, it will show the Go button. When loading a site is it shows the Stop button. Sometimes it shows the button reload.

    If you want separate buttons, right-click on a toolbar and select Customize, you can then drag the stop or reload buttons and place them elsewhere. If you place them in the order 'Reload-Stop' on the right side of the address bar they will be together again. You can also move the home button also if you wish. For more information about customizing the toolbar, see https://support.mozilla.com/kb/How+to+customize+the+toolbar

  • Why have I not lack of photos in the collections. How can I sort this. It's so boring after a number of collections to find a lot of missing pictures when you turn on the computer again.

    Why do I get "missing photos" in the collections of bridge. and how to use them.   so boring after the construction of a few collections to find the photos missing when you restart the computer.

    Aare move you or rename the pictures or folders having a collection? Bridge is a file browser, not an asset manager, so everything you do have an impact on the file names and locations can invalidate the elements stored in a collection.

    Mike

  • Since the evolution of firefox today, the Refresh button is not at the top of the page. How can I get that back?

    I thought that the Refresh button was a Windows icon, then why has it disappeared from my page since the evolution of Firefox?

    Firefox 4 and later versions use a combined Stop/Reload/Go button that is placed at the right end of the address bar.

    During the process of loading page it shows as a stop button and once the charging button is replaced by a reload button.

    If you type in the address bar this button would then become a button go.

    Click the Reload button to duplicate the current tab in a new tab.

  • I have 44 GB in my icloud, but only 59 MB in my iphone. I want to transfer all my photos to my icloud, but the iphone cannot send it because there is not enough space (this is the message). How can I do to fix this?

    I have 1400 photos in my iphone (4, 7 GB) and I want to transfer my icloud. Can someone help me?

    To increase the available space, go settings/iCloud/Photos and select optimize iPhone/iPad storage. That will reduce the space required by 90% when it is fully effective.

  • When you apply for jobs, the police don't rest not the same thing, how can you correct that if the application is done correctly?

    I'm filling out a job application.  The police are everywhere, it changes in different areas and I don't know how to fix it.  How is that possible?

    Press Ctrl + E. If it allows you to change the font settings, do so. If this isn't the case, then there is nothing you can do about it with the player. It's the fault of the authors of the file. You can report it to their...

  • May not be able to Shrink tables (data files)

    Hi all

    Oracle 10.2.0.3.0 on HP - UX

    I've restored the cold backup of size 1.5 to. All tables are present in a single schema.

    SQL > SELECT SUM (bytes) / 1024/1024/1024 "GB" FROM WHERE user_segments;

    GB
    ----------
    1496.96539

    Application user is past the tables of all the useless lines.

    SQL > SELECT SUM (bytes) / 1024/1024/1024 "GB" FROM WHERE user_segments;

    GB
    --------
    677.87667

    After letting down the paintings, I try to reduce the tables to reduce the HWM. For this, I have the query on all of the tables below.

    change the movement line of table_name enable;

    ALTER table table_name retractable space compact;

    I check with a script available in metalink to analyze the data files how can I reduce the size of the file of data manually

    After running script. I found there is that no boom of the data file cannot be done. When I try to reduce the data file using

    SQL > alter data < datafile > size < size >;

    It throws error as

    ORA-03297: file contains data beyond the requested value of RESIZING

    When I check my size of the database, this is the same I checked with the tables, that is to say 1.5 to.

    Could you please suggest what would be the problem?

    Thank you
    KSG

    Published by: KSG on 15 March 2010 14:01

    Hello

    But I have no space left to create the tablespace or move the tables. Export of more than 1.5 TB of data is not allowed for me to move forward.

    So it will be difficult, but it is not impossible.

    First published as previously you must use option SHRINK SPACE, as you could see in the link below
    in order to free up space in your Tablespace:

    http://www.Oracle.com/technology/oramag/Oracle/05-may/o35tuning.html

    With the request that I posted, you can locate the last block in your data file.

    You can follow the Segment that has this block by changing the query as follows (assuming that your block size is * 8192 * bytes, else you will need to change)
    This value in the query):

    select a.tablespace_name, a.file_name, b.owner, b.segment_name, ceil( (nvl(hwm,1)*8192)/1024/1024 ) "Mo"
    from dba_data_files a, ( select file_id,
                             max(block_id+blocks-1) hwm
                             from dba_extents
                             group by file_id
                           ) b
    where a.file_id = b.file_id(+)
    order by tablespace_name;
    

    Then, MOVE you (or RECONSTRUCTION if there is an Index) the segment corresponding in a different Tablespace.
    And revert to the original.

    Check again where is your last block with the above query.

    And Segment-by-Segment basis, you can move the HWM of the data file and reduce its size without
    use too much space.

    But you need time, so be patient. Time or space, you can choose :-).

    Hope this helps;
    Best regards
    Jean Valentine

    Published by: Lubiez John Valentine on March 14, 2010 10:44

  • IMAQdx attributes listed in the xml file not found in labview

    Hello

    Some attributes of my camera our watch camera (DALSA CamExpert) software but are not displayed in MAX.

    When I opened the xml file, I don't see a difference between the attributes shown and hidden.

    Why LabView displays all possible attributes?

    The sml file has specific requirements?

    Any ideas?

    Hello Eric,

    I solved the problem yesterday!

    I use a DALSA camera. Dalsa software downloads the XML file and saves it in a directory 'dalsa"on my local disk.

    National instruments software (MAX) downloaded XML file and saves it in another directory. The 2 files were not equal. I replaced the XML file OR the XML of Dalsa file and now I'm able to get all attributes.

    But thanks for your response!

    Kind regards

    Kim

  • Windows cannot access the specified device, path or file. May not permissions to access you the item. Can someone tell me how to overcome this problem.

    Windows cannot access the specified device, path or file. May not permissions to access you the item. This message appears when I try to access also anti programs anti-virus will not play CD in windows media player. Can someone give me advice on what to do to remedy the problem.

    Hi Lee,.

    • You did any computer change?
    • What anti-virus program is installed on the machine?
    • What is the full and an error code error message when you access the CD through Windows Media Player?

    Follow the steps mentioned below:

    Start your computer in safe mode

    http://Windows.Microsoft.com/en-us/Windows7/start-your-computer-in-safe-mode

    Note: try to access Cd rom drive and antivrirus program and see that you get an error

    Perform a clean boot according to the link below:

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/kb/929135

    Note: Follow step 7 in order to his usual manner once completed troubleshooting computer

    The analysis of Microsoft Security Essentials online according to the LienSuivant:

    http://OneCare.live.com/site/en-us/default.htm

    Reply back with the results

  • There is NO selection update software on my phone! How are Iphone 3 # IOS updated? It may not be this difficult OR the answer is "It cannot be upgraded" - which is?

    There is NO selection update software on my phone! How are Iphone 3 # IOS updated?

    It may not be this difficult OR the answer is "It cannot be upgraded" - which is?

    The model number you have listed is an iPhone 4, which can be upgraded to iOS 7.1.2. To have the option to update software on the phone, you need at least iOS 5, otherwise you will need to use iTunes on your computer sync to perform the upgrade.

Maybe you are looking for

  • Iphone6 contacts

    How to recover/restore my contacts from a backup computer PC to my iphone more than 6? No backup icloud. I lost my most recent contacts (after 2 years), after I turned my yahoo email account and have not been able to recover my recent contacts (after

  • How to order the recovery for my Satellite A660-149 disk?

    I'm trying to drive recovery order for my A660-149 of the https://support.toshiba.com/support/serviceUnitVerification?orderType=SFFBut it says my series or my part is not valid. I know that this model is old enough, but I can't find anything about it

  • any other cox cable subscribers having trouble with a wi - fi connection?

    Cox admits they changed their signal and is originally from airport to plant networks, how people treat this?

  • Compaq Presario SR1522X HELP power switch!

    Help! For the life of me, I can't understand the switch on the front panel. How the hell does it work? My switch will not turn on the computer. I took the front panel off, and I'm completely baffled works even in the switch. Any help would be appreci

  • WAG325N V1 updates?

    For about a week, the light of the internet on my WAG325N is disabled for most of the time, even though I have a approx. 8000 kbps connection internet (download); correct ping test. My ISP is TalkTalk. Support for LInksys says it may need an upgrade,