Child is detecting click even though it shouldn't

Hello once again,
I technically know how to make this work right, but I'm trying to figure out what I want to do won't work right.
I have a Child ("treeToChopDetect") appear when a certain other child ("sceneArray[2]") appears on stage. However, I don't want "treeToChopDetect" to be clickable until another child "guy_Bridge"/ "sceneGuyArray[2]" (the character) reaches frame "guy_AtBridgeNormal" on his own timeline.
However, "treeToChopDetect" seems to be clickable even though the "manager" function is suppose to be constantly telling the "detectArray" that mouseEnabled = false until "sceneGuyArray[2].currentLabel == "guy_AtBridgeNormal"". I keep getting a trace as output if I click on "treeToChopDetect".
I can keep it from being clickable if I set the condition to include "canClickBoo == false" (which it is until the guy reaches the right frame), but I shouldn't have to do that.
For all my other arrays I've been able to use my "manager" function to run through them (via "for" loops) and turn mouseEnabled on and off depending on if the guy is on the right frame, but something isn't working correct with this array, for some reason.
Sorry if that's confusing. I can try to clarify or add more information if necessary. (I have 600+ lines of code so of course I tried to chop out whatever I could.)
The var and array:
var treeToChopDetect:TreeToChopDetect = new TreeToChopDetect;
treeToChopDetect.x = 355;
treeToChopDetect.y = 75;
detectArray = [treeToChopDetect];
The function to detect: (if I add in canClickBoo == true to the stipulation, it runs correctly; however I don't know why I have to do this)
function detectFunction(event:MouseEvent) {
                    if (treeToChopDetect.hitTestPoint(mouseX, mouseY, true)) {
                        trace("treeToChopDetect");
These two functions are run when called in other functions, and they turn on and off the ability to click.
function canClick() {
                canClickBoo = true;
                canFunBoo = true;
            function cantClick() {
                canClickBoo = false;
                canFunBoo = false;
main function that adds/removes "outside" children and defines what canClickBoo or canFunBoo means
function manager(event:Event) {
                //listen to see what should appear
                if (stage.contains(sceneArray[2])) {
                    addChild(detectArray[0]);
                    addChild(detectArray[1]);
                } else if (!stage.contains(sceneArray[2]) && stage.contains(detectArray[0]) && stage.contains(detectArray[1])) {
                    removeChild(detectArray[0]);
                    removeChild(detectArray[1]);
                //IF canClickBoo is true, able the mouse/turn on buttonMode
                if (canClickBoo == true) {
                    ... (various other arrays get turned on)
                    for (var im:uint=0; im<detectArray.length; im++) {
                        detectArray[im].mouseEnabled = true;
                        detectArray[im].buttonMode = true;
                    //ELSE IF canClickBoo is false, disable the mouse/turn off buttonMode
                    } else if (canClickBoo == false) {
                        for (var iy:uint=0; iy<detectArray.length; iy++) {
                            detectArray[iy].mouseEnabled = false;
                            detectArray[iy].buttonMode = false;
               //if the scene and frame are correct, clicks can be heard               
                for (var jk:uint = 0; jk<sceneArray.length; jk++) {
                    if (stage.contains(sceneArray[jk])
                        && sceneGuyArray[jk].currentLabel == "guy_At"+wordArray[jk]+"Normal") {
                        //trace("canClick");
                        canClick();
                                       // else clicks can't be heard               
                    } else if (stage.contains(sceneArray[jk])
                        && sceneGuyArray[jk].currentLabel != "guy_At"+wordArray[jk]+"Normal") {
                        trace("cantClick");
                        cantClick();

Hi, tytbone;
I'm not going to sort through your logic, because, frankly, it's way too complicated. Complicated logic is hard to debug, and the way you've done it is not likely to perform well.
Try something like this:
//Not sure what class you've actually applied to the parent,
//so this name is made up
//Not applying a Class? Maybe you should start.
public class ParentClass extends MovieClip {
     //Assuming you've got these on stage an you're going to let Flash populate them
     //mainly because logic to create, add, and position things is tedious and I refuse to write it
     public var treeToChopDetect:MovieClip;
     public var guy_Bridge:MovieClip;
     public function ParentClass() {
          super();
          //added to stage doesn't bubble, use capture
          addEventListener(Event.ADDED_TO_STAGE, initNewChild, true);
     protected function initNewChild(e:Event):void {
          var newChild:MovieClip = e.target as MovieClip;
          if (newChild) {
               switch(newChild.name) {
                    case 'treeToChopDetect':
                         mouseChildren = false;
                         mouseEnabled = false;
                         break;
                    case 'guy_Bridge':
                         //find relevant frame
                         var frameNum:int = -1;
                         for each (var frameLabel:FrameLabel in newChild.currentFrameLabels) {
                              if (frameLabel.name=='guy_AtBridgeNormal') {
                                   frameNum = frameLabel.frame -1;
                                   break;
                         if (frameNum > -1) {
                              //could do this on the timeline of the child mc or with 
                              //a base class...this is just for illustration purposes
                              //tell guy at bridge to dispatch this event when he gets to the frame
                              newChild.addFrameScript(frameNum, function(){dispatchEvent(new Event('guy_AtBridgeNormal'))});
                              //listen for that event so you can unlock the tree
                              newChild.addEventListener('guy_AtBridgeNormal', unlockTree);
                    }//end case
               }//end if the child was actually a movie clip
          }//end init
          protected function unlockTree(e:Event):void {
               guy_Bridge.removeEventListener('guy_AtBridgeNormal', unlockTree);
               treeToChopDetect.mouseEnabled = true;
               treeToChopDetect.addEventListener(MouseEvent.CLICK, onTreeChop);
          protected function onTreeChop(e:Event):void {
                //do stuff

Similar Messages

  • I am trying to use screens and it keeps telling me it cannot detect Java even though I have installed and updated Java?  What might be the problem?

    I am trying to use "screenr" and it keeps telling me it cannot detect Java even though I have downloaded and updated Java?  What is going on or what might I do to correct this?
    Thanks

    Firefox needs 32-bit plugins, so you'll need to install 32-bit Java for Firefox.
    No, you can't change Firefox from 32-bt to 64-bit. There is a Nightly 64-bit version (alpha) of Firefox, but it is used only to test for regressions until development is resumed.

  • Itunes doesnt detect music, even though the file wasnt moved or changed

    hi guys my itunes is annoying the **** out of me.... for some reason i get teh exclamation point next to my song files even though i never changed or move the actual song file....
    is it because i have too many songs in the folder?
    is there like a program that helps itunes search for the song??
    thanks

    Same thing, and it's driving me crazy too! It only happens to my Podcast files though. I haven't done anything special to the file (other than maybe listent to it), but then sometimes the file will get the exclamation point. Then when I click on CTRL-I / Get Info, and it let's me find the file. When I look in the folders, I notice that iTunes has RENAMED the file! What's up?!

  • Empty resultset even though it shouldn't be empty

    Dear experts,
    today i did experience a behaviour of hana that i cannot understand.
    In order to enable you to reenact the phenomenon i created the following demo code:
    ######################### PREPERATION
    -- creating a copy of a sap demo content table
    create column table "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST"
    like "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses" with data;
    -- set two columns to null
    Update "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST"
    set CITY = NULL;
    Update "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST"
    set POSTALCODE = NULL;
    ######################### / PREPERATION
    ######################### INITIAL
    -- returns an empty resultset (initial version)
    select col from (
    select 'CITY' as col, count(*) i from "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST" where CITY is not NULL union all
    select 'POSTALCODE', count(*) from "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST" where POSTALCODE is not NULL
    ) where i = 0;
    ######################### / INITIAL
    ######################### ALTERED VERSIONS
    -- returns the expected resultset (outer select contains i)
    select col, i from (
    select 'CITY' as col, count(*) i from "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST" where CITY is not NULL union all
    select 'POSTALCODE', count(*) from "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST" where POSTALCODE is not NULL
    ) where i = 0;
    -- returns the expected resultset (check for "is null")
    select col from (
    select 'CITY' as col, count(*) i from "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST" where CITY is NULL union all
    select 'POSTALCODE', count(*) from "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST" where POSTALCODE is NULL
    ) where i = (select count(*) from "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST");
    -- returns the expected resultset (now without where)
    select col from (
    select 'CITY' as col, count(CITY) i from "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST" union all
    select 'POSTALCODE', count(POSTALCODE) from "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST"
    ) where i = 0
    ######################### ALTERED VERSIONS
    The question is why does the initial statement return an empty resultset?
    And please consider that the initial version works just fine under rev68 (resultset is not empty), but returns an empty resultset when being executed on a rev70 system.
    Many thanks in advance for your feedback.

    Dear experts,
    today i did experience a behaviour of hana that i cannot understand.
    In order to enable you to reenact the phenomenon i created the following demo code:
    ######################### PREPERATION
    -- creating a copy of a sap demo content table
    create column table "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST"
    like "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses" with data;
    -- set two columns to null
    Update "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST"
    set CITY = NULL;
    Update "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST"
    set POSTALCODE = NULL;
    ######################### / PREPERATION
    ######################### INITIAL
    -- returns an empty resultset (initial version)
    select col from (
    select 'CITY' as col, count(*) i from "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST" where CITY is not NULL union all
    select 'POSTALCODE', count(*) from "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST" where POSTALCODE is not NULL
    ) where i = 0;
    ######################### / INITIAL
    ######################### ALTERED VERSIONS
    -- returns the expected resultset (outer select contains i)
    select col, i from (
    select 'CITY' as col, count(*) i from "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST" where CITY is not NULL union all
    select 'POSTALCODE', count(*) from "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST" where POSTALCODE is not NULL
    ) where i = 0;
    -- returns the expected resultset (check for "is null")
    select col from (
    select 'CITY' as col, count(*) i from "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST" where CITY is NULL union all
    select 'POSTALCODE', count(*) from "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST" where POSTALCODE is NULL
    ) where i = (select count(*) from "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST");
    -- returns the expected resultset (now without where)
    select col from (
    select 'CITY' as col, count(CITY) i from "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST" union all
    select 'POSTALCODE', count(POSTALCODE) from "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses_TEST"
    ) where i = 0
    ######################### ALTERED VERSIONS
    The question is why does the initial statement return an empty resultset?
    And please consider that the initial version works just fine under rev68 (resultset is not empty), but returns an empty resultset when being executed on a rev70 system.
    Many thanks in advance for your feedback.

  • After I use Siri the volume on my keyboard is all the way up and I can't hear the keyboard clicks even though keyboard clicks is on why does this happen after I use siri

    I need answers people please!!!!!!!!!!!!!!!!!!

    It sounds to me like your keyboard has been damaged and needs to be repaired or replaced.  Can you try an external keyboard?

  • 2nd try. 1) firefox isn't blocking popups even though its set to 2) firefox doesn't recognize when I click "allow"

    Firefox has been allowing all sorts of pop-ups even though I've established the block in the content. This is just one of the pop-up sites: http://partners.livingsocial.com/cities/soon?ref=cpxpop
    When I go to a website I'm interested in a ribbon comes up at the top of the screen telling me to "allow". But when I click this it disappears for a second and then comes right back asking again. I have to check the X in order to get it to go away and that doesn't always work. I've even "allowed" certain sites on the options pages but that doesn't seem to make a difference.

    There may be a problem with malware if unrelated pop-ups are opening or you are redirected to unrequested websites.
    Do a malware check with some malware scan programs.<br />
    You need to scan with all programs because each program detects different malware.<br />
    Make sure that you update each program to get the latest version of the database before doing a scan.<br />
    * http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    * http://www.superantispyware.com/ - SuperAntispyware
    * http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    * http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    * http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
    See also "Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked and [[Searches are redirected to another site]]

  • My apple tv no onger detects my windows computer even though home sharing is turned on  What do I have to do to fix this?

    My apple tv no longer detects my windows vista computer even though home sharing is turned on. What do I have to do to fix this?

    I have Windows 7 and Mcafee. Here is what worked for me:
    1. Remove Mcafee and install Microsoft Security Essentials (free from the Microsoft website), then
    2. Start the Windows Firewall from the Control Panel, then
    3. Click on the left pane click on "Allow a program or feature through the Windows firewall", then on the new window
    4. Click "Change Settings", click Yes to the pop up window, and
    5. Select both Bonjour Services one at a time, and check the box that says "Home/Work(private)" network. Click OK at the bottom and you are done. Good luck.

  • My macbook won't let me sync music or apps as it says my computer is not authorized, even though when I clicked to authorize it it says that it already is. how do i fix this?

    my macbook won't let me sync music or apps as it says my computer is not authorized, even though when I clicked to authorize it it says that it already is. can anybody tell me how i could fix this? iv already tried unarthorising the computer and re authorising it but it still doesnt seem to work

    Hey CarlyR_,
    Thanks for the question. I understand you are experiencing issues related to iTunes Store authorization. The following resources may help to resolve these issues:
    iTunes repeatedly prompts to authorize computer to play iTunes Store purchases
    http://support.apple.com/kb/TS1389
    iTunes: Missing folder or incorrect permissions may prevent authorization
    http://support.apple.com/kb/TS1277
    Thanks,
    Matt M.

  • I have several users in an exchange environment who cannot email a photo from the iPhone.  When the click on Email Photo, they are prompted to configure a mail account even though there is already an exchange account in place.  How do I remediate this?

    I have several users in an exchange environment who cannot email a photo from the iPhone.  When the click on Email Photo, they are prompted to configure a mail account even though there is already an exchange account in place.  How do I remediate this?  Not all of the users in our environment have this issue.  If the users having this issue, install a secondary email account, Gmail, Hotmail, etc, then they can send through those accounts.  Why would the exchange account not be seen to send photos?

    Sounds like it worked until the policies associated with the account that are creating the problem were fully pushed down.
    Try setting up a new (test) Exhange account and see if it behaves the same way on the phone (after removing the problem account from the phone, of course).

  • I want to create a new folder on my external hard drive for photos.  Even though I added the new folder button to the tool bar it is not highlighted so I cannot click on it to create a new folder on this drive.

    I have an external hard drive that I would like to pre-make a new folder before I import photos into it.  Even though I added the new folder app to by toolbar, it is not highlighted and I cannot use it.  It will only let me create new folders if I upload to iPhoto.  That is not where I want to store everything.  So I need to figure out how to turn on or activate New Folder on my toolbar for all possible downloading options.

    If it's a drive that you've previously used with a PC, just double-check the format - click the drive once on the desktop to highlight it, and click cmd-i (the command key and the i key together) to see the Info window. That will tell you, under Format, how it's formatted.
    If it's "NTFS", that's the current Windows format. You can read but not write to it with a Mac. If you want full read/write access, you should look into Paragon NTFS, which allows you to do both. Note that some features of te Mac (Time Machine, for example) will only work with Mac-formatted drives.
    Matt

  • HT5622 When setting up an apple ID for a child in family sharing, the verification questions appear in French, even though the iPhone setting is in English...

    Possible bug?  Setting up apple id for child, under icloud, family sharing, and the 3 questions come up in Frnech, even though the phone is set to English and the remainder of screens have all been in English,
    Is this a bug or is there a way to display the questions in English please,
    thanks

    I agree.
    I found this 'bug' out the other day when getting ready for my new iPhone I was setting up my iPad with some new apps too and wanted to work with Find My iPhone.
    Here's the deal; my main AppleID is just a simple 'Username' not a '[email protected]' AppleID.
    I've had this since the need for AppleIDs were used for these forums and the iTunes Store, AppStore, etc.
    So it works fine and well with that stuff but not with find my iphone on my iPad as it wants a full email account, either a '@me.com' or a '[email protected]' AppleID which I did create but I think it was used as Job profile or something other along those lines (NOT used for a MobileMe account or .mac either).
    And I only have access to one email now and I dont feel comfortable having multiple email addresses that I dont check or have no use for, call my simple or naive but thats just how it goes.
    What I'd like to do is be able to use either AppleID for my Find My iPhone app and everything else.
    And I think thats a good point, '@me.com's for all. make it a whole lot easier in my opinion.
    merge all the apple accounts you created into a MobileMe, simplifies the situation and makes it easier connect to all Apple Services.
    My itunes account, apple.com store account, appstore account, main AppleID for the past couple years it "Maxwell Stanley" but it does NOT work with Find My iPhone. So i created [email protected] (example.com is in place of my true email domain for privacy reasons) and that doesnt work as it statse it Cannot Be used.
    My 'Maxwell Stanley" Apple ID's email associated with it was [email protected] i tried changing it to [email protected] but still doesnt recognize that as an AppleID even though its associated with "Maxwell Stanley".
    I event ried to use the SAME email that is associated with my 2nd AppleID '[email protected]' with the appleid 'Maxwell Stanley' and no dice.
    running out of options it seems.
    Any idea on the best solution?
    Thank you!

  • How can I print a full frame photo from iPhoto 11?  Even though I click on scale to fit paper size, it crops both ends of the photo in landscape set up.  I have an Epson R1800 with the latest drivers.

    How can I print a full frame photo from iPhoto 11?  Even though I click on scale to fit paper size, it crops both ends of the photo in landscape set up.  I have an Epson R1800 with the latest drivers. (I'm also 3 days new to iMac and iPhoto 11 from an eMac and iPhoto 6.)

    " Hello Jeff. Here at Oki Data, we do not support programming.  I would recommend contacting Adobe for further assistance. You can also browse their website at http://www.adobe.com/products/postscript/.

  • My iPhone no longer works with my wi-fi network.  It detects the network but can't communicate, even though it did so until today for months.

    My iPhone no longer works with my wi-fi network.  It detects the network but is unable to communicate, even though until today it worked great for months.  The network is Verizon FiOS Internet on an M1424WR router.  PCs and iPad continue to work with the same network without any problem.  Any ideas?

    have you upgraded to the new ios5 software? if so that could be the issue and contact apple.

  • I preordered One Direction's new album Midnight Memories, but did not purchase it. It is not in my downloads or purchases even though it says it's purchased. I can't even buy it because it says purchased and will not let me click the button. Please help!

    I preordered One Direction's new album Midnight Memories, but did not purchase it. It is not in my downloads or purchases even though it says it's purchased. I can't even buy it because it says purchased and will not let me click the button. Please help!

    Try:
    HT2519 Pre-ordered album, it says...: Apple Support Communities

  • My daughter had completed a chart in pages. I saved it and then clicked on other chart types. Now I can't go back to the original chart she made even though I have not re-saved the file. How can I go back to her original chart with data?

    My daughter had completed a chart in pages. I saved it and then clicked on other chart types. Now I can't go back to the original chart she made even though I have not re-saved the file. How can I go back to her original chart with data?

    I don't get what you are saying.
    Is this all the same document?
    What version of Pages?
    Have you tried to revert to a previous version?
    Peter

Maybe you are looking for

  • Blue Screen of Death -- Datebook gone, Addressboo​k in danger

    Having some major addressbook/datebook issues with HotSync. I am using a Handspring Visor (the original, old model), Palm Desktop 4.0.1, Windows XP Home. I have not updated any of the hardware/software lately. A couple days ago, when I synced my Hand

  • Error while extracting the data from R/3

    HI all, I am extracting HR data from R/3 system. It is throwing the below error message. Error: Splitting error User Exit employee/date/hrs 00100545 20071106 2.000 I am not sure how to rectify this error. Is this issue with data in R/3? Does it have

  • How to Run a form in Web browser?!

    Hi, 1- Is it possible to run a .fmx file in web browser? if yes how to do so? if no. what do I need to do to make it possible? Many thanks

  • Inheritance component controller

    Hi all! Usually I use my methods of component controller(like work with popup or display messages) in every WD component. After create new WD component I copy my methods from another controller to current. How can I call methods from "parent" compone

  • Additional ICloud/Me

    Can I create another icloud/me account including email address? Is there a charge for this service? Thank you.