XML attribute change depends on the level of chindren attributes

var = my XML

< principal >
< id module = "m0" visited = "" >
< visited lesson = "m0l1" id = "" >
< section id = "m0l1t01" visited = "" >
< page id = "m0l1t01p01" visited = "true" / >
< page id = "m0l1t01p02" visited = "true" / >
< / section >
< section id = "m0l1t02" visited = "" >
< page id = "m0l1t02p01" visited = "true" / >
< page id = "m0l1t02p02" visited = "true" / >

< / section >
< / lesson >
< visited lesson = "m0l2" id = "" >
< / lesson >
< / module >
< / hand >

I am currently at day level page "visited = true" by programming/runtime. I wanted to roll for topic level (all parent levels) once I showed visited state 'true' to all the pages in the section.

You can use a recursive function to go through all the nodes in your XML to check attributes:

// recursive function to check "visited" attribute
function checkVisited(xml:XML):void {
            var visitedCount:uint = 0;
            for(var i:uint = 0, childCount:uint = xml.children().length(); i < childCount; i++){
                checkVisited(xml.child(i)[0]);
                if(xml.child(i).@visited == "true") ++visitedCount;
            }
            if(visitedCount == xml.children().length()) xml.@visited = "true";
            return;
}

var myXML:XML = 
; checkVisited(myXML.module[0]); // run recursive function trace(myXML);

Trace

--

Kenneth Kawamoto

http://www.materiaprima.co.UK/

Tags: Adobe Animate

Similar Questions

  • What is the icon on the far right that looks like a circle and a small number that changes depending on the page of the site? in the lower right part of the

    I wonder what this thing.
    It's an icon to the far right of the page next to the search toolbar. It has the shape of a circle with a number on the bottom right edge. The number changes depending on which tab I opened. A blank tab has no number. This page gives a 1. I have another open page which translates as a 4. The number shows white in a little orange box. The circle is described with a thick black line. What does this icon?

    Thank you.

    John

    Hi John, I'm guessing that this icon is created and updated by an extension. I do not know that, though. Maybe something that keeps track of the Tracker, like Lightbeam? Have you tried pointing your mouse over the icon to see if a ToolTip is displayed, or by clicking on it?

  • Script to include a background color change depends on the answer

    I previously got help from a user here to create a script that autopopulates field based on the options selected in two sets of radio buttons:

    var result = this.getField("Consequence").valueAsString;

    probability of var = this.getField("Likelihood").valueAsString;

    If (result == 'Negligible' & & probability == 'Rare') event.value = "Low";

    Else if (result == 'Negligible' & & probability == 'Unlikely') event.value = "Low";

    ElseIf (result == 'Negligible' & & probability == 'Moderate') event.value = "Low";

    Else if (result == 'Negligible' & & probability == 'Probably') event.value = "Low";

    ElseIf (result == 'Negligible' & & probability == "almost certain") event.value = "moderate."

    Else if (result == 'Minor' & & probability == 'Rare') event.value = "Low";

    Else if (result == 'Minor' & & probability == 'Unlikely') event.value = "Low";

    ElseIf (result == 'Minor' & & probability == 'Moderate') event.value = "moderate."

    ElseIf (result == 'Minor' & & probability == 'Probably') event.value = "moderate."

    Else if (result == 'Minor' & & probability == "almost certain") event.value = "high";

    Else if (result == 'Moderate' & & probability == 'Rare') event.value = "Low";

    ElseIf (result == 'Moderate' & & probability == 'Unlikely') event.value = "moderate."

    ElseIf (result == 'Moderate' & & probability == 'Moderate') event.value = "high";

    ElseIf (result == 'Moderate' & & probability == 'Probably') event.value = "high";

    Else if (result == 'Moderate' & & probability == "almost certain") event.value = "critical";

    Else if (result == "Major" & & probability == 'Rare') event.value = "Low";

    ElseIf (result == "Major" & & probability == 'Unlikely') event.value = "moderate."

    ElseIf (result == "Major" & & probability == 'Moderate') event.value = "high";

    Else if (result == "Major" & & probability == 'Probably') event.value = "critical";

    ElseIf (result == "Major" & & probability == "almost certain") event.value = "Extreme";

    ElseIf (result == "Catastrophic" & & probability == 'Rare') event.value = "moderate."

    Else if (result == "Catastrophic" & & probability == 'Unlikely') event.value = "high";

    Else if (result == "Catastrophic" & & probability == "Moderate") event.value = "critical";

    ElseIf (result == "Catastrophic" & & probability == 'Probably') event.value = "Extreme";

    ElseIf (result == "Catastrophic" & & probability == "almost certain") event.value = "Extreme";

    etc.

    else event.value = "";

    I wonder if its possible to have the color of the field that uses the script above, change based on the input. For example if the response is weak; make the background color green. If its moderate, make orange etc. ?

    I know it of asking a big but thought I would check.

    Thanks in advance.

    Of course, it is possible. Add at the end of your code:

    if (event.value=="Low") event.target.fillColor = color.green;
    else if (event.value=="Moderate") event.target.fillColor = ["RGB", 1, 0.5, 0]; // = Orange
    else if (event.value=="High") event.target.fillColor = color.red;
    // etc.
    else event.target.fillColor = color.white;
    
  • Is there a way to make the background color of a check box change depending on the State, in that it is?

    As: Green background when checked and white background (neutral), while not controlled.  Management wants to draw attention to areas that have been selected.

    If you create a script by right-clicking form1 object in your hierarchy (which is the subform above) and click on create a Script object and then insert into the function below script object:

    function changeColor (rootObject) {/ /}<--Refers to="" the="" object="" itself="">

    If (rootObject.rawValue! = null: rootObject.rawValue! = 0) {}

    rootObject.border.fill.presence = 'hidden ';

    } else {}

    rootObject.border.fill.presence = "visible";

    }

    }

    From there the Action Builder, you can use 'A Script object function call' then choose your item and choose the function changeColor. This should do the trick for you. This will show or hide the background color of your field.

    If you want to change the color instead of hide or show, you can use this function at the bottom and change the RGB value to your liking:

    function changeColor (rootObject) {/ /}<--Refers to="" the="" object="" itself="">

    If (rootObject.rawValue! = null: rootObject.rawValue! = 0) {}

    rootObject.border.fill.color.value = "255,255,255"; 255,255,255 represents white, no colour

    } else {}

    rootObject.border.fill.presence = "0,255,64";

    }

    }

  • Column display depends on the user?

    Hi all

    My requirment must show some report fields depends on the user access. Is this possible in OBI? either I have a report with 20 columns and depends on the level of user access, he can only see columns that are related to him for example 5 of 20 and another user can see 10 20.

    If possible, could some explain to me how?

    Thank you.

    Hello
    We can achieve this by using column-level security

    http://obieeblog.WordPress.com/2009/01/15/OBIEE-data-security-column-level-security/

    Thank you
    Angelique

  • Where to add the transitional attribute at the level of the entities or view level? And where to use {return getTransientAttribute()} in the entity or view?

    Mr President

    JDev 12.2.1.

    Where to add the transitional attribute at the level of the entities or view level?

    And where to use {return getTransientAttribute()} in the entity or view?

    public Number getAmount()  
      {  
        return getTransientAttribute();  
        //return (Number) getAttributeInternal(AMOUNT);  
      }  
    
    

    Concerning

    A difference I could think: place a transient attribute on EO level will make transaction dirty (DBTransaction.isDirty returns true) when the field is changed.

    From a design point of view, I tend to place the transient fields at the level VO, because most of the time they are for the presentation of the data in the user interface.

    Only when the transient fields are involved in DML operations (for example when you call a stored procedure EntityImpl.doDML) I place the transitional area on EO.

  • Drop down the list in the grid depends on the drop-down list at level 0

    Hi all

    In my subpage, there are three areas of drop-down list D1, D2 and D3.

    D3 is grid to level 1 on a secondary page and the quick Table in D3 have 3 Keys.Key 1 and 2 keys are the same field as D1 and D2. As the D3 is dependent on the D1 and D2.
    The first time, D3 empty remains same I selects values D1 and D2, but when I EndModal (1) and then come back, D3 has values.

    What is going on?

    What is the solution for this scenario?

    Thank you for your help in advance.

    Yes, this seems ok, as D3 is dependent on the key high level D1 and D2 and you delete all lines, which leaves a new line empty.
    I thought that if you select auto on on your grid values of D1 and D2 should automatically be copied at level 1.
    If this isn't the case, it has no harm to set these values as you.

    Note that this will change the buffer and the user receives a message that the changes have been made and if the user want to continue or go back and save.
    So a DoSave() somewhere in your code would be nice.

  • How to dynamically change the image depend on the input parameter

    Hi all

    I have a running report depend on the particular organization, I have 15 operating unit and 15 different logo for each operating unit.

    How to change the Logo depend dynamically on the entrance past the user.

    If I have three or four logo I can add to my disposal help if another statement and his works fine but I have more than 10 logos so it was not possible to keep these in my RTF model.

    Is it possible to change the logo according to the entry without keeping this model.

    I saw this link but its not very well

    http://erpschools.com/articles/display-and-change-images-dynamically-in-XML-Publisher

    Concerning
    Srikkanth.M

    Can u send me the files?

  • Change the level of Logger ADF 11g

    Gurus,

    Is it possible to change the level of ADF Logger in one place in the application so that the newspaper above the threshold values are recorded, similar to the way that we do in Log4j.

    thnks
    11.1.1.5 Jdev

    You use the logging.xml for this file. In the "Application Server Navigator" open the integrated WLS, right-click on it and select "Configure Oracle Diagnostig slaughter". Small opens the correct logging.xml file that you changed through the built-in user interface.

    Timo

  • How are the changes/updates on the attributes target system are reconciled?

    Hello

    How are the changes/updates on the attributes target system reconciled within IOM automatically? Suppose if the userpassword in OID is changed via external SSO application by the user. How these changes at the end of the target system can be reconciled in IOM? Annex which task should be scheduled for the same? I understand that we can configure reconciliation the target system. But suppose that happens if a another example; a group of groups are removed from the OID; How these changes will be reconciled within the IOM? It is done in real time?

    Response to most early would be really useful.

    Thank you
    -oidm.

    The only changes that are made in time real are push systems. For example, Peoplesoft has an Integration Broker that when a change occurs, the events is pushed to the listener that then creates the recon event to IOM. Synchronization of Active Directory password is also a push system where the domain controller has a dll that is triggered when the password is changed to push to the IOM.

    Other targets are reonconciled to an interval defined in your task scheduler. Most of the targets have some form of variable change so that only the entries that are updated in the target are reconned in. Values such as passwords should not be reconciled however because they will be in clear text in the recon Manager and in the database.

    As for your example, it does not really have that IOM criteria. IOM does not manage the OID groups to a group level, it manages the permissions of the user level. So if you continue to run the recon OID group Lookup on an interval of schedueld, it would update the list of choices that is used to define the groups available on the child table. Then when the recon is run agaisnt these OID of the user that have been changed (assuming that a change to a membership in a group is an update to the user, which is not in Active Directory) and then you would get their current list of groups they have right to.

    -Kevin

  • I need to generate 3.3 V logic level Digital train of pulses with the NI PCI-6221. Can I change the level of 6221 OR logic output?

    I need to generate 3.3 V logic level Digital train of pulses with the NI PCI-6221. Can I change the level of 6221 OR logic output?

    The output cannot be changed. 5V to 3, 3V level controllers are readily available (Maxim, I think). As long as the scanning speed (etc.) is fast enough for your pulse train, even 3, 3V regulator would work. I don't know if NEITHER offers a module to condition TTL levels.

  • Minesweeper - can't change the levels - always goes back to 'Intermediate' as the first chosen

    Minesweeper - I started on 'Intermediary', and now I can't seem to change the levels - it boils down to "Intermediary" as the first chosen

    Hello

    I suggest tryuninstalling and reinstall the game and check to see if it helps:

    a. click the Start button, select Control Panel, click programs and then click turn on turn Windows features on or off. If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.

    b. click girls games, uncheck the Minesweeper and click ok.
    3. restart the computer, follow the same procedure and check the Minesweeper.

    For more information, connect to:
    http://Windows.Microsoft.com/en-us/Windows7/turn-Windows-features-on-or-off

    It will be useful.

  • MY QUESTION: IS IT POSSIBLE TO CHANGE THE LEVEL OF DIFFICULTY OF THE GAME OF CHESS TITANS? Thanks in advance.

    I got the game "Chess Titans" runs under Vista 32 bit. It works OK. But it seems impossible to change the difficulty level"of the game. The only time I was able to change the "level of difficulty" is when I installed MS Vista. I tried 'Options' - but it does not contain something immediately useful in this regard.

    Hi Provob,

    Thanks for posting on Microsoft Answers!
     
    Certainly, you can change the difficulty level of Chess Titans.
    1. Once you start the game.
    2. click on the game and then go to options.
    3. in the new window that opens, in the top right of windows, you can cursor diffculty.
    4. move the slider from left to right to increase the difficulty. There are 10 levels of difficulty from 1 to 10.
    5. Once you have customized your settings click Ok.

    * If the slider is dimmed or crashes, you can try to uninstall and reinstall the game using "turn Windows Feature On or Off.
    You can consult the following links for assistance.
    http://Windows.Microsoft.com/en-us/Windows-Vista/Chess-Titans-how-to-play
    http://Windows.Microsoft.com/en-us/Windows-Vista/turn-Windows-features-on-or-off

    Please let us know if this helps you resolve the problem or if assistance is needed.
    It will be useful.

    Thank you, and in what concerns:
    Shekhar S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Have lost the ability to change the level of difficulty on the games of Freecell. It was there originally, but is now set to the hardest level? can anyone help please?

    Until recently, I was able to choose several levels of difficulty for Freecell card game using the 'Options '. Now there is no choice available under 'Option' or any other position. The game is stuck at the highest level with all combinations of 4. How can I get games with least difficulty IE 1 or 2 costumes? Please can someone help?

    Hello

    1. Since when are you facing this problem?

    2. are you aware of the changes made to the computer before the show?

    Method 1: Try to turn off the game by going to enable or disable the functionality of Windows and later the tower and check if that helps. Follow the link given below for the same thing.

    Enable or disable Windows features:

    http://Windows.Microsoft.com/en-us/Windows-Vista/turn-Windows-features-on-or-off

    Method 2: Run the (SFC.exe) System File Checker tool to determine which file is causing the issue, and then replace the file. To do this, follow the form of measures the following link:

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

    I hope this helps.

  • Windows 7 action center &#62; security &#62; I can't change the uac user account at the level of the control window freezes / uac rest!

    PROBLEM: ACTION CENTER > SECURITY > USER ACCOUNT CONTROL FREEZES AND REMAINS OFF - I CAN'T CHANGE THE UAC LEVEL. When access to the center of the Action (Windows 7-32 bit) > Security > UNDER USER ACCOUNT CONTROL IS OFF > said UAC will be NEVER NOTIFIER > and below it in blue is the option to click on "Choose your level of UAC" > I click it and it opens a window "DECIDE if he MUST BE INFORMED of CHANGES to YOUR COMPUTER" with a feature of landslide to choose the level > I DRAG to ALWAYS NOTIFY ME AND EACH TIME the SCREEN is IT FREEZES LET ME HIT OK - so I can not change this setting. It won't let me change to always warn me - the recommended setting, and I can't go beyond that! The window closed either! I'm trying to close the window by clicking end task in Task Manager - it takes several attempts before / if it can close this frozen window... BUT THE KEY IS THAT I CAN'T CHANGE THE UAC LEVEL - THE SCREEN FREEZES AS SOON AS I GLIDE TO ALWAYS WARN ME - HELP? * NOTE: a few times after the Task Manager tried to close the window without success, I saw a box pops up that says: Manager of COM surrogate has stopped responding... he tries to fix - as if Windows stops responding, and he tries to recover or fix the problem. I would like any help or information please, as to why I can't change this setting, even after I give an administrator password, you are prompted, to say good make - when I am logged in as a standard user. Help? Thank you!

    Hi Shellzak,

    Thanks for posting this question in the Microsoft Community!

    I understand that you can not change the UAC settings on the computer and the system hangs. I'm sorry for the inconvenience caused to you. Rest assured that I will do my level best to help you.

    Did you of recent changes to the computer before the show?

    I suggest the following method and check if it helps to solve the problem.

    I suggest you try to activate UAC from the command line and check if it helps.

    (a) open an elevated command prompt. To do this, click Start, click programs, accessories principally made, right-click Guest, and then click Run as administrator. If you are prompted for an administrator password or a confirmation, type the password, or click on allow.

    (b) run this command

    Reg.exe ADD HKLM/v EnableLUA /t REG_DWORD /d 1/f

    Registry warning: Important this section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base: http://support.microsoft.com/kb/322756/

    It will be useful. For any other corresponding Windows help, do not hesitate to contact us and we will be happy to help you.

    Kind regards!

Maybe you are looking for

  • MacBook hard drive failure

    The hard drive on my MacBook (2011) crashed. I could not successfully reinstall OS X (it try to install Mountain Lion - perhaps because of the age of the MacBook). Bit then it crashes when it does real settle. Can I create a new partition and try to

  • Firefox works suddenly freezes and then continues to crash in the opening

    This has happened a lot lately. I was reading online, when Firefox crashed. When I try to 'Restart Firefox' after the Mozilla Crash Reporter comes, it hangs just at the start. I write from my (hated!) Internet Explorer browser. This has happened four

  • Re: Vista UAC always request authorization to run Tempro times Satellite Boote

    I installed utility "Tempro" from Toshiba, which is very useful to talk about updates etc. TEMPRO is installed as one of my startup programs, and I'm happy to do. However, whenever I restart my computer, control Vista application user account permiss

  • Easiest way to implement a network wide lock/semaphore

    I was trying to think of a way to implement a network wide lock a semaphore. The application is that there are two computers on a network running TestStand. There is a common resource that one can use both. What is the best way to keep "up-to-date on

  • Committed FSX activation number

    I am trying to activate FSX in South Africa, but the number condition () is engaged. What should I do?