How can I test if a given DisplayObject is obscured by any other DisplayObject on the same stage?

I'm trying to write a function
    internal function isObscured(o: DisplayObject, p: DisplayObject): Boolean;
which tells whether the given object o is partially or completely obscured by the object p. I already tried using hitTestObject and hitTestPoint; the latter would actually do what I want if I tested every point in the bounding rectangle of the object at hand - not very efficient. I also tried using setChildIndex but it doesn't seem to help either since it's possible that an object isn't obscured even though it does not have the largest child index.
My current approach is to test whether any bounding rectangle of the objects with larger child indices than the object at hand intersects with the bounding rectangle of the object at hand, however I suspect that this will only work for testing whether any sibling overlaps my object. I also looked at the 'depth' property of UIComponent but it seemed from the same issue (the depth is relative among all siblings).
Does anybody know whether there's a better way to check whether a Flex control is obscured by another?

Some other alternatives for testing:
Use the rectangle approach you mentioned, just make sure you call localToGlobal() on each of the points (rectangle coordinates) before doing the check. That will make all of your comparisons happen in the stage's coordinate system rather than each display object's parent's coordinate system.
Another option that may work is DisplayObject.hitTestObject():
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayOb ject.html#hitTestObject()
Finally, I found this  link that has a hitTestRect() method that may help you:
http://www.as3gamegears.com/misc/actionscript-toolkit/

Similar Messages

  • HT5649 how can you add a previous playlist from a different apple Id  both belong to the same person

    how can you add a previous playlist form a different apple ID, both belong to the same person

    It's ok to share the same AppleID for iTunes.  Use Separate ID's for iCloud, iMessage, and Facetime. 

  • Hi, I have a macbook air os x 10.9.5 and I have problems with the app store. It doesn't open anyway. so, how can I install it again or update. I have problems with preview too, the same, doesn't open the application

    Hi, I have a macbook air os x 10.9.5 and I have problems with the app store. It doesn't open anyway. so, how can I install it again or update. I have problems with preview too, the same, doesn't open the application

    Reinstalling OS X Without Erasing the Drive
    Boot to the Recovery HD: Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Reinstalling OS X Without Erasing the Drive
    Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the main menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility and press the Continue button. After Disk Utility loads select the Macintosh HD entry from the the left side list.  Click on the First Aid tab, then click on the Repair Disk button. If Disk Utility reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit Disk Utility and return to the main menu.
    Reinstall OS X: Select Reinstall OS X and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.
    Alternatively, see:
    Reinstall OS X Without Erasing the Drive
    Choose the version you have installed now:
    OS X Yosemite- Reinstall OS X
    OS X Mavericks- Reinstall OS X
    OS X Mountain Lion- Reinstall OS X
    OS X Lion- Reinstall Mac OS X
         Note: You will need an active Internet connection. I suggest using Ethernet
                     if possible because it is three times faster than wireless.

  • How can I uninstall Maverick and reinstall snow leopard? My mac hasn't been the same since I upgrading to maverick. Runs slow, crashes, can't cope with normal functions.... Help, please help

    How can I uninstall Maverick and reinstall snow leopard?
    My mac hasn't been the same since I upgrading to maverick. Runs slow, crashes, can't cope with normal functions....
    I need to go back to leopard or buy a new MacBook Pro!
    Help, please help

    Revert to a Previous OS X
    Revert to former OS from Mavericks
    Revert to Snow Leopard

  • How can I get iTunes to update play counts and file additions between users on the same computer?

    I have placed my iTunes library in /Users/Shared/iTunes along with iTunes Music Library.XML  
    When I open iTunes, all the music is displayed correctly with playcounts etc...
    The problem is, when a playcount or album info is updated it does not carry over to the other user on the same computer. The same with adding new files to the iTunes library...
    How can I get iTunes to auto-update between users?
    Thanks

    Tempeleton Peck
    I understand how to do that, I was looking to share all fodlers or a bunch of folders.  I found out how to do it.
    Paul

  • How can I export an .PLT file from Illustrator without using any other software but Illustrator

    I'm in the URGENT need of exporting a file to .PLT and no using any other software like the producer's software.

    You can't. AI doesn't produce .PLT files.

  • How can I move a task from a Summary Task to another Summary Task in the same task list?

    Hey, I tried to move tasks through the SP UI from one Summary Task to other in the same task list, but I didn't find possibility for it.
    Then I spent time to learn the SP Client Object Model and now I can read tasks form the list. I see every task has a "FileRef" and a "FileDirRef" field. If I think right these fields show the relation between list elements for example between
    a Task and a Summary Task elements.
    I changed these fields' values and I tried to Update the ListItem but I got this error message: "Invalid data has been used to update the list item. The field you are trying to update may be read only."
    I really need to move tasks what were created below a wrong Summary Task so please explain a method or pattern how I can do this. (I can create a new Task below to any Summary Task and I can set field values but I hope there is a way to really move tasks (I
    mean I should change the right field values somehow.).
    I can reach the Task List both on the server and client side so I'm very interested in every solution. PowerShell solution is also good for me.
    I'm using SharePoint 2010 SP2.
    Thank you for your answer and your time. :)
    Csaba Marosi

    Hi,
    According to your post, my understanding is that you want to move a task from one summary task to another in the same task list.
    We can do it like this:
    We can create a Gantt View for this task list, then copy your tasks inside a summary task, then navigate back to the other summary and paste, then go back to original and delete.
    Here is another way for your reference:
    SharePoint vs Powershell – Moving List Items between folders
    http://sharepointstruggle.blogspot.in/2010/07/sharepoint-vs-powershell-moving-list.html
    Best Regards
    Dennis Guo
    TechNet Community Support

  • How can I share my itunes libraries between two users on different log ins on the same PC?

    Ive recently bought my wife and iPhone 4, and we have a shared library. But she clearly downloads her own apps and music choices direct from the store to her phone, so wants to maintain her own log in etc. How can I share the library in my iTunes on my log in on the same PC to her iTunes on her log I'm on the same PC. its windows Xp machine with latest itunes version.
    Ive followed the online instructions for sharing thus far, and the share library does not appear in either iTunes. ie It aint working!
    Thanks in advance

    When you say you have a shared library... you mean you have a networked external hard drive that you are sharing?
    In iTunes, generally...when the term Shared Library is used, it's speaking to sharing a specific computer's library over the network with different computer.
    I would think it would be better to do what ya'll have been doing (one log in acct/one computer) and have her create her own Apple acct and each of you log in and out whenever purchasing music apps etc. and then setup individual playlists and pick specific playlists to sync with each individual iPhone.
    If you don't want each other to know what you're buying then...disregard what I just said

  • HT204088 How how can I synch my ipod + iphone music to my new computer? I get the same error  "my ipod or iphone is synched with another itunes library.An Ipod can be synched with only one itunes library at a time. What would I like to do Erase and Synch

    How can I synch my ipod & iphone music (purchased from itunes on my old laptop) to my new laptop? I keep getting the same message on my itunes on my new laptop: " The ipod/Iphone is synched with another itunes library. An ipod/iphone can be synched with only one itunes library at a time. What would you like to do - Erase and Synch or Transfer Purchases?" What do I do?
    A couple of other items:
    1) I am guessing Apple does not keep a history of all my music purchases? As I did not have my entire library backed-up anywhere, and relying on the music I have on my ipod and my iphone as my only source of itunes music....I have lost over 500 songs!!!
    2) I used to have an Apple account under another account name, and since have switched to a new account name. Is there anyway to find the history of purchases from my old Apple account name and transfer these over to my new account name and onto my new laptop?
    I hope someone can help, I am having a very difficult time trying to obtain answers. Angie

    The iphone/ipod is NOT a storage/backup device.  Not maintaining a backup copy is a big mistake.
    You can transfer itunes purchases from your iphone/ipod to your computer:
    Authorize your computer for all accounts and then click  File>Transfer Purchases

  • How can I download apps on my Ipad4 without having it on my Iphone in the same time?

    Why when I download new apps on my Ipad 4 the apps goes on my Iphone too? I know this is the same Apple id but how can I resolve this? Do I have to have anothe apple id for each ?

    Do you currently have automatic downloads turned 'on' for apps on your iPhone : Settings > iTunes & App Stores (Settings > Stores if it's not on iOS 6) ? If you do then try turning it off, that should then mean that any apps that you buy on your iPad don't automatically download on your phone as well.
    Or if it happens when you sync the phone to your computer's iTunes, then when you next connect the phone on its Apps tab make sure that the 'automatically sync new apps' tickbox under the listbox of apps is unticked

  • How can we make one view field value to be copied to other field of the the

    Hi   
       I am new  in CRM2007 I have enhanced sap component & enhanced SAP View but I wanted the field value of the enhanced view to be mapped to the field value of the same view which is added from EEWB
    Pls tell me if the added new field can be made as Dropdown list box without fixed values & Design Layer customizing I mean to say through coding can we made the input field as Dropdown
    Appreciate any help in advance
    Thanks
    Neel

    Hi,
    You can write your own ligic in GET_V_<FIELD> method. Select the values which needs to be displayed in the drop down list based on your own condition. Some sample code is given below:
    METHOD get_v_zzverksomr.
      DATA: lt_ddlb           TYPE bsp_wd_dropdown_table,
              ls_ddlb           TYPE bsp_wd_dropdown_line,
              lv_display_only   TYPE string,
              gr_ddlb_verksomr  type ref to CL_CRM_UIU_DDLB,
              ls_verksomr_values  TYPE LINE OF vrm_values.
        SELECT verksomr verksomrtxt FROM zkb_verks
           INTO TABLE lt_ddlb.
        IF sy-subrc EQ 0.
          INSERT INITIAL LINE INTO lt_ddlb INDEX 1.
        ENDIF.
      IF gr_ddlb_verksomr IS NOT BOUND.
        FREE gr_ddlb_verksomr.
        CREATE OBJECT gr_ddlb_verksomr
          EXPORTING
            iv_source_type = 'T'.
        LOOP AT gt_verksomr_values INTO ls_verksomr_values.
          ls_ddlb-key   = ls_verksomr_values-key.
          ls_ddlb-value = ls_verksomr_values-text.
          APPEND ls_ddlb TO lt_ddlb.
        ENDLOOP.
        gr_ddlb_verksomr->set_selection_table( it_selection_table = lt_ddlb ).
      ENDIF.
      rv_valuehelp_descriptor = gr_ddlb_verksomr.
    ENDMETHOD.
    Thanks
    Swagatika

  • How can i sync my old ipod without knowing my old password and dont have the same email without loosing everything??

    How can I sync my old Ipod without loosing everything? I dont remember my old password and dont have the same email. I have many pics stored on there of many trips we took over the years and songs as well please help...

    What are you wanting to do exactly?  Are you trying to sync this older iPod with a new/different iTunes library from the one you originally set it up with?
    B-rock

  • How can I use both high def (16:9) and regular def (4:3) in the same video?

    I'm editing a load of video, some of it was shot in 16:9 high-def and some in 4:3 regular-def. Id really hate to see the 4:3 footage go to waste. What can I tack on to the black sidebars on either end of this footage to fill in the gaps? I've also seen on TV where the sidebars on old 4:3 footage is blurred out by video from that particular frame. How can I do this?

    Just duplicate the footage and superimpose.
    Stretch the underlaying footage to fill the screen and add a blur.

  • How can I install WinPE on a MacBook Pro? (or any other way to repair Win7 boot sector on a MacBook Pro?)

    Hello,
    I run MacOS X 10.8.5 and Win7 SP1 installed on a MacBook Pro (model summer 2010).
    I used to run Win7 using Parallels desktop. I have version 9.0.23036 installed.
    Unfortunately, the boot sector for Win7 got corrupted or erased (???)
    I have many professional apps installed on Win7, not easy to re-install...
    => I try to find a way to use WinPE to solve the issue.
    But I cannot boot directly from WinPE (v3.n?) on a USB memory stick. It stops when loading the system files.
    Is there a way to run WinPE anyway? Using Boot Camp? Using Parallels desktop? by copying some Parallels drivers onto the WinPE system? (but which ones? where to copy them?)
    Is there any other way to re-create the boot sector for Win7 without a full re-install?
    Many thanks for any help.

    Thank you very much.
    I could make a bootable clone of the Ma OS side using Carbon Copy Cloner. This point is OK.
    I sill get trouble with the WinRE environment: I cannot boot directly from the Win7 DVD: the loading of the system files stops at a certain point and I cannot get the Windows menu.
    I could read a procedure on the Parallels.com support site (http://kb.parallels.com/en/5223) and tried to follow it (my Windows was installed using Boot Camp). The problem is that, unliked described on step 2 (Choose to "Start Windows Installation"), I can't get this choice in the Boot Camp menu. I only have two choices : "Download the latest Windows support software" or "Remove Windows 7 or later version". Do you know how I can get the "Start Windows Installation" choice, so that I can launch the Windows DVD through Boot Camp?
    Thank you in advance

  • How can I record an Audio Instrument (saxophone) and listen to a reference track at the same time?

    How can I record an Audio Instrument, and listen to a reference track at the same time?

    Are you using an external audio controller or the line-in and headphone jacks on the side of your computer? You shouldn't have an issue using headphones when you're recording through the line-in but you may want to make sure you have monitoring on and it's going to the right place.
    If you're using an external audio controller, try making an aggregate device combining the controller and the "built-in output" into the same device. Go to Applications/Utilities/Audio MIDI Setup, click the "+" sign at the bottom left to make a new device and check the "use" boxes to the left of the physical devices you want to use as part of that aggregate device. That is how I use the computer's speakers or headphones to monitor my input as opposed to only being able to use the output on my audio controller.
    Now that I see some of the questions on the side of this page I realize that the 13" MBPs seem to have only one combined input/output jack... That is an incredibly stupid feature. What on Earth could possibly justify that design decision? I suppose if that's the problem you're having you'll have to buy some sort of splitter (if they even make them) or get an external audio controller like an Apogee Duet or something along those lines. I would be furious if they combined those two jacks on all of the MBPs.

Maybe you are looking for

  • Can you change the line spacing in the legend?

    Is there a way to change the line spacing in the legend? I have a pie chart with text and I can't change the line spacing for its legend like you would in a regular text. Is there a way to change it?

  • Flex 2 Builder: Variables view pane & AS3 component debugging.

    The problem is as follows: A supposed ComponentA (ActionScript 3.0 class component in package components.* & extending mx.coreUIComponent) is placed in the main application: // script <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns:c

  • Gamma levels on MacMini/Mountain Lion

    I have migrated my FCP 7 over to a MacMini, upgrading the OS to 10.8 in the process.  The first time, I just used my time machine to copy to the new computer, but all may Final Cut Material showed up with significantly altered gamma levels.  I had to

  • KEEP GETTING PDF REJECTED

    I've been trying unsuccessfully to upload a PDF book file to BookSurge, but they keep saying all of the 250+ images in my book file are low resolution and will print blurry and pixelated. Here are the stats: The original document was produced in InDe

  • Accessing user libraries from deployed JSP. Problem

    I've created a workspace and project contining 1 web bean "AQABeanPK1.AQATableView" . I then used the 'manage libaries' to add it to Jdeveloper as a library. I also added the webbean to Jdeveloper via the manage web objects tool In my jsp project I i