A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Wife in coma

  1. #1
    Junior Member
    Join Date
    Feb 2002
    Location
    Manchester UK
    Posts
    4

    Wife in coma

    Hi can anybody help...

    When somebody is in a coma theres a scale called 'The Glasgow Coma Scale'
    http://www.sfar.org/scores2/glasgow2.html

    I'm trying to build a small application that has 3 separate selection fields which gives a score all 3 must be used (default therefore would be 1 per column) ... the end score gives a result in figures... the score gives a text result.
    ie.
    3 column's a b c
    a 1st column has selectable scores of 1,2,3,4
    b 2nd column has selectable scores of 1,2,3,4,5
    c 1st column has selectable scores of 1,2,3,4,5,6

    a selected 2 + b selected 4 + c selected 5 score = 11 = shows corresponding text result for 11 etc

    there will be text results for scores 3 through to 15

    thanking you in anticipation...

    Gary
    Manchester UK

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    using radio buttons as displayed in your link ?
    here's some code to get you going in Flash 8.

    drag a RadioButton component into your Library.
    add main timeline code to attach radio buttons to stage.
    each loop assigns placement and groupNames,
    label and scale are indexed from each columns array.
    each group uses a listener to send its scale value to a function
    that shows the variable total in the output window.
    display this variable in your textfield and use it to select your text output.
    PHP Code:
    //column1///////////
    col1 = ["Spontaneously (4)","To speech (3)","To pain (2)","None (1)"];

    for(var 
    n=0;n!=col1.length;n++){
    refCol1 this.attachMovie("RadioButton","col1_"+n,n+100,
    {
    _x:25,_y:25*n+30,_width:200,groupName:"col_1",label:col1[n]});
    refCol1.sca col1[n].charAt(col1[n].length-2);
    }

    var 
    column1:Object = new Object(); 
    column1.click = function(evt1:Object){
    c1 col_1.selection.sca;
    scale(c1,c2,c3);
    };  
    col_1.addEventListener("click"column1); 

    //column2///////////
    col2 = ["Orientated (5)","Confused (4)","Inappropriate words (3)","Incomprehensible sounds (2)","None (1)"];

    for(var 
    n=0;n!=col2.length;n++){
    refCol2 this.attachMovie("RadioButton","col2_"+n,n+200,
    {
    _x:160,_y:25*n+30,_width:200,groupName:"col_2",label:col2[n]});
    refCol2.sca col2[n].charAt(col2[n].length-2);
    }

    var 
    column2:Object = new Object(); 
    column2.click = function(evt2:Object){
    c2 col_2.selection.sca;
    scale(c1,c2,c3);
    };  
    col_2.addEventListener("click"column2);
     
    //column3///////////
    col3 = ["Obeys commands (6)","Localizes pain (5)","Withdraws to pain (4)","Flexion (abnormal) to pain (3)","Extension to pain (2)","None (1)"];

    for(var 
    n=0;n!=col3.length;n++){
    refCol3 this.attachMovie("RadioButton","col3_"+n,n+300,
    {
    _x:360,_y:25*n+30,_width:200,groupName:"col_3",label:col3[n]});
    refCol3.sca col3[n].charAt(col3[n].length-2);
    }

    var 
    column3:Object = new Object(); 
    column3.click = function(evt3:Object){
    c3 col_3.selection.sca;
    scale(c1,c2,c3);
    };  
    col_3.addEventListener("click"column3); 
    //total/////////////

    function scale(c1,c2,c3){
    !
    c1 c1=c1;  !c2 c2=c2;  !c3 c3=c3;
    total parseInt(c1)+parseInt(c2)+parseInt(c3);
    trace("Glasgow coma scale = "+total);
    }; 
    hope this helps you on your way

  3. #3
    Junior Member
    Join Date
    Feb 2002
    Location
    Manchester UK
    Posts
    4
    wow...
    I really cant judge but I'm very appreciative of your response, unfortunately my level of knowledge is way below your supplied help...
    I do however thank you very sincerely for the obvious time spent on my behalf
    many thanks.

    regards
    Gary
    Manchester
    UK

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center