Correct function/xml game

Hi.

I am new to this forum, so please forgive me if I am not following proper posting protocol.

I need some serious help. I am making a matching game for my company.

I created an xml document to load in flash of medications and their descriptions. I used a dropdown menu component to load the categories the user can choose from and randomly load a med from that category. If they match it correctly, I want that item to disappear from the list to randomly load in that category.

However, the way it is working is…it does not randomly load a med (it loads the first item in the list [0]), it does not keep looping through the categories, nor does it remove an item from the list.

I imagine if I can get direction to properly/initially load and randomize the data, that I can figure out the rest from there. I have been working on this for a long time…and I am stumped.

var Answer:Array;

var checkAnswer:Array;

//------------------Load the XML,populate the combo box and load med info into categories---------------------------------

import mx.utils.Delegate;

var chemomeds:Array;

_global.style.setStyle(“fontFamily”, “Verdana”);

var xml:XML = new XML();

function onXmlLoaded(success:Boolean) {

        if (success) {

                    var mainnode:XMLNode = xml.firstChild;

                    var chemomedsnodes:Array = xml.firstChild.childNodes;

                    for (var i:Number = 0; i<chemomedsnodes.length; i++) {

                                //var growthfactors:Array = xml.firstChild.childNodes[0].childNodes*.attributes.name+xml.firstChild.childNodes[0].childNodes[1].firstChild;

                                //var antimetabolites:Array = xml.firstChild.childNodes[1].childNodes*.attributes.name+xml.firstChild.childNodes[1].childNodes[1].firstChild;

                                //var miscellaneous:Array = xml.firstChild.childNodes[2].childNodes*.attributes.name+xml.firstChild.childNodes[2].childNodes[1].firstChild;

                                //var antiangiogenics:Array = xml.firstChild.childNodes[3].childNodes*.attributes.name+xml.firstChild.childNodes[3].childNodes[1].firstChild;

                                //var targetedtherapies:Array = xml.firstChild.childNodes[4].childNodes*.attributes.name+xml.firstChild.childNodes[4].childNodes[1].firstChild;

                                var monoclonalantibodies:Array = xml.firstChild.childNodes[5].childNodes*.attributes.name+xml.firstChild.childNodes[5].childNodes[1].firstChild;

                                var categorynode:XMLNode = chemomedsnodes*;

                                chemomeds.push({i:i+1,cname:categorynode.attributes.name,

                                medDesc:categorynode.childNodes[0].firstChild,

                                medname:categorynode.childNodes[0].attributes.name});

                    }

                    setup();

                    trace (medDesc);

                    } else {

                    trace('error reading XML');

        }

}

//-----------------function to set up dropdown menu--------------------

function setup() {

        choosecat.labelField = "cname";

        choosecat.dataProvider = chemomeds;

        choosecat.addEventListener("change", Delegate.create(this, loadScreen));

}

//-----------------variable and function to randomize the meds of the selected category---------

var randomNum = 0;

//Math.floor(Math.random() * (2 - 1)) + 1;

//-----------------function to load a medDesc text and answer variable once a category is chosen--------------------

function loadScreen(evt:Object) {

        var thisitem:Object = evt.target.selectedItem;

        medDescript.text = thisitem.medDesc;

        Answer = thisitem.medname;

        trace (Answer);

}

//-----------------function to load the xml and dropdown menu--------------------

function init() {

        chemomeds = [{cname:"Choose one"}];

        xml.ignoreWhite = true;

        xml.onLoad = Delegate.create(this, onXmlLoaded);

        xml.load("chemomeds.xml");

}

//-----------------initalize the loading of the xml--------------------

init();

//-----------------function to remove item from list--------------------

function removeItem(){

thisitem.medname.removeNode();

};

----------------------------------------------XML---------------------------------------------

<?xml version=“1.0” encoding=“iso-8859-1”?>
<chemomeds lastupdate=“9/14/2006” dir="">
<category name=“growth factors”>
<med name=“filgrastim”>
Indicated to decrease the incidence of infection and episodes of febrile neutropenia
Most common side effect is bone pain
Should not be administered within 24 hours of chemotherapy
Available in 300mcg and 480mcg doses
Given as a daily injection
</med>
<med name=“pegfilgrastim”>
Bone pain, injection site reaction
6 mg subcutaneous fixed dose
Once per course dosing
Administered 24 hours after chemotherapy and at least 14 days before next chemotherapy dose
Decreases incidence of infection in patients receiving myelosuppressive chemotherapy
</med>
<med name= “palifermin”>
Oral toxicities, skin reactions
IV bolus administration
A total of six doses are given, three before chemotherapy and three after the reinfusion of stem cells
Attaches to keratinocyte growth factor receptor
Prevent and treat severe mucositis in patients with hematologic malignancy undergoing stem cell transplant
</med>
</category>

<category name=“antimetabolites”>
<med name=“pemetrexed”>
Myelosuppression
Dexamethasone to prevent skin rash
Vitamin B12 and folic acid supplementation decrease side effects
Given IV over 10 minutes
Treatment of patients with mesothelioma who are not surgical candidates and with locally advanced or metastatic NSCLC
</med>
<med name=“azacitadine”>
Myelosuppression
Administer reconstituted solution within one hour at room temperature
Subcutaneous injection
Re-suspend solution immediately before administering
Treatment of patients with myelodysplastic syndrome (MDS)
</med>
<med name=“clofaribine”>
Myelosuppression, nausea and vomiting
Dermatitis, pruritis
Tumor lysis syndrome
IV over 2 hours daily times 5 days
Treatment of pediatric patients (1-21y.o.) with relapsed or refractory ALL
</med>
<med name=“decitabine”>
Myelosuppression
Hyperglycemia, hypomagnesemia, hypokalemia
Must be used within 15 minutes of reconstitution
Administered by 3-hour infusion q8hrs for 3 days every 6 weeks
Treatment of MDS
</med>
<med name=“nelarabine”>
Myelosuppression, nausea and vomiting
Monitor for tumor lysis syndrome
Neurotoxicity is dose-limiting
Discontinue for neurologic events grade 2 or greater (NCI Common Toxicity Criteria)
Treatment of pediatric or adult patients with refractory or relapsed T-ALL and T-LBL
</med>
</category>

<category name=“miscellaneous”>
<med name=“bortezomib”>
Side effects include thrombocytopenia, peripheral neuropathy, diarrhea or constipation
Given IV bolus over 3 to 5 seconds
Contraindicated in patients who are hypersensitive to mannitol
Proteasome inhibitor
Indicated for treatment of multiple myeloma in patients who have received 1 prior therapy
</med>
<med name=“paclitaxel protein-bound” >
Alopecia, diarrhea, N&V, neutropenia, ?liver enzymes, arthralgia, myalgia, asthenia, sensory neuropathy
2nd line for metastatic breast or if relapse within 6 months of previous chemotherapy
Requires ANC of 1500, dose adjustments for ANC 500-1500 or neuropathy
No premed required, inline filter or PVC free tubing
Limit infusion to 30 minutes and assess for extravasation
</med>
</category>

<category name=“antiangiogenics”>
<med name=“thalidomide”>
Oral medication
Side effects include: birth defects, constipation, peripheral neuropathy
Indicated for treatment of multiple myeloma
Antiangiogenic agent
Requires registration in the STEPS program
</med>
<med name=“arsenic trioxide” >
Side effects include leukocytosis, QT interval prolongation, pulmonary infiltrates
Pretreatment with anti-emetics usually NOT needed
Needs pretreatment ECG
Possibly causes cell apoptosis
Indicated for treatment of relapsed APL
</med>
<med name=“lenalidomide”>
Side effects include DVT & PE
Indicated to treat MDS
Oral medication
Potential teratogen
Analogue of thalidomide
</med>
<med name=“bevacizumab”>
Common side effects include hypertension and proteinurea
Inhibits angiogenesis by binding to VEGF
Indicated for treatment of metastatic colorectal CA
Rare but potentially lethal side effects include GI perforation and hemorrhage
Initial rate of 90 minutes is reduced to 60 minutes with second dose, if tolerated, and then 30 minutes for subsequent doses
</med>
</category>

<category name=“targeted therapies”>
<med name=“gemtuzumab ozogamicin”>
Hypersensitivity reaction, myelosuppression
Administer through a filter every 14 days for a total of 2 doses
Observe hazardous drug precautions
Protect from light during preparation and administration
CD33+ AML with first relapse if over 60 y.o.
</med>
<med name=“dasatinib”>
Myelosuppression, fluid retention, risk of bleeding
2nd line therapy for CML after imatinib.
Oral tablets taken bid.
Avoid concurrent anticoagulants
Monitor calcium levels
</med>
<med name=“erlotinib”>
Rash, diarrhea, anorexia, N&V, conjunctivitis, keratitis, fatigue, bleeding if taking anticoagulant
2nd line for NSCLC locally advanced or metastatic
Oral preparation taken 1 hour before or 2 hours after food
Assess for and discontinue if interstitial lung disease
Contraindicated if hypersensitivity to gefitinib
</med>
<med name=“sorafenib”>
Hand-foot syndrome/ rash
Monitor BP weekly during first six weeks of treatment
Decreases tumor cell proliferation and reduces tumor angiogenesis
Oral medication taken twice daily on empty stomach
Treatment of advanced renal cell carcinoma
</med>
<med name=“sunitinibMalate”>
Oral medication
Skin discoloration, depigmentation of hair
Hypertension, bleeding, edema
Treatment of advanced renal cell carcinoma
Treatment of GIST after disease progression on or intolerance to imatinib mesylate
</med>
</category>

<category name=“monoclonal antibodies”>
<med name=“trastuzumab”>
Side effects include cardiac toxicity, nausea & vomiting, tumor pain
Store in refrigerator, do not shake
First infusion symptom complex of fever and/or chills seen in 40% of patients
Recent research findings have shown improved disease free survival and overall survival in early stage breast CA
Indicated for metastatic breast CA which over expresses HER-2
</med>
<med name=“alemtuzumab”>
Side effects include potentially fatal opportunistic infection, hematological complications and infusion reaction which includes bronchospasm & hypotension
Requires slow dose escalation initially and if treatment is held for 7 days or more
Indicated for patients with CLL who have received at least 1 prior therapy and have failed fludarabine
Binds to the CD52 antigen found on surface of B & T lymphocytes
</med>
<med name=“cetuximab”>
Side effects cmmnly include rash but rarely include interstitial lung disease
IV tubing is primed with this drug and flushed with 0.9% saline after infusin
Requires in-line 0.22 micrmeter filter
Indicated fr metastatic clrectal CA
Binds t the extracellular dmain f the EGFR
</med>
<med name=“Caprmab pendetide”>
May nt be cvered if used t assess respnse t treatment
Bne scan is mre accurate t detect bne mets
High rate f false psitives and negatives s require ther studies t cnfirm
Uses Indium (In 111)
Diagnstic imaging agent fr newly diagnsed r after surgery when micrmetastasis suspected r if PSA is rising
</med>
<med name=“ibritummab tiuxetan”>
Relapsed/refractry lw-grade, fllicular r transfrmed B-cell NHL with CD 20 antigen
Rituximab is first part f this therapy with its assciated high risk fr hypersensitivity
Cntraindicated if > r = 25% f lymphma in bne marrw
Indium 111 fr diagnstic phase after rituximab
Uses Yttrium 90 fr treatment 7 t 9 days after initial treatment
</med>
<med name=“tsitummab I-131”>
Relapsed/refractry, lw-grade, fllicular, r transfrmed NHL with CD20 antigen
Single curse f treatment
Hypersensitivity, prlnged cytpenias, fevers, chills, sweating, nausea, hyptensin, dyspnea, brnchspasm
Cntraindicated if >25% f bne marrw invlved
Requires sme radiatin precautins & thyrid blcking agent
</med>
</category>
</chemomeds>