# Combobox control load graph

**URL:** <https://forum.kirupa.com/t/combobox-control-load-graph/237299>\
**Category:** Uncategorized\
**Created:** [August 29, 2007, 4:03am UTC](https://forum.kirupa.com/t/combobox-control-load-graph/237299 "2007-08-29T04:03:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![little\_prince41](https://avatars.discourse-cdn.com/v4/letter/l/0ea827/32.png) [@little\_prince41](https://forum.kirupa.com/u/little_prince41)\
**Post date:** [August 29, 2007, 4:03am UTC](https://forum.kirupa.com/t/combobox-control-load-graph/237299/1 "2007-08-29T04:03:47Z")

</div>

hello…  
I have problem about combobox.  
I have one combobox and in labels is “Underdamped,Overdamped,Undamped,Crittally damped”  
if then select sameone in combobox .It plot graph line and then I select new other in combox it dont work. I must close its and open it again.  
I want it work continous.I select someone in combobox it plot graph one line and I select new other in combobox it done work and line of any graph dont lose.  
can sameone help me?  
Thanks you.  
  
then select sameone in combobox . in example I select “Critally damped”

I select new other in combox it dont work.I must close its and open it again

this code

> 

this.createEmptyMovieClip(“graph\_mc”,this.getNextHighestDepth());  
this.createEmptyMovieClip(“graph1\_mc”,this.getNextHighestDepth());  
this.createEmptyMovieClip(“graph2\_mc”,this.getNextHighestDepth());  
this.createEmptyMovieClip(“graph3\_mc”,this.getNextHighestDepth());  
LO = new Object();  
LO.change = function(EO)  
{  
c1Value= c1.getSelectedItem().label;  
checkValue();  
};  
graph\_mc.moveTo(100,300);  
graph1\_mc.moveTo(100,300);  
graph2\_mc.moveTo(100,300);  
graph3\_mc.moveTo(100,300);  
graph\_mc.lineStyle(2,0xFF0000);  
graph1\_mc.lineStyle(2,0xFFFF00);  
graph2\_mc.lineStyle(2,0xFFCCFF);  
graph3\_mc.lineStyle(2,0x9900FF);  
var t:Number = 0;  
var i:Number =-98;  
this.onEnterFrame=function()  
{

if(i\<148&&c1Value==“Critically damped”)  
{  
Go=(3_Math.exp(-3_t)+Math.exp(-3_t))/5;  
graph\_mc.lineTo(201+i,140-260_Go/150\*i);  
t+=1/12;  
i=i+3;

}  
if(i\<139&&c1Value==“Undamped”)  
{  
G1=(1+Math.sin(3_t-19.4));  
graph1\_mc.lineTo(209+i,300-80_G1);  
t+=1/20;  
i=i+3;

}

if(i\<148&&c1Value==“Underdamped”)  
{  
Go=1.5\*(1.06\*Math.exp(-t)_Math.cos(Math.sqrt(8)t-19.47));  
graph2\_mc.lineTo(198+i,140-190Go/150_i);  
t+=1/7;  
i=i+3;

}  
if(i\<148&&c1Value==“Overdamped”)  
{  
Go=(0.171_Math.exp(-7.854_t)+1.171_Math.exp(-1.146_t))/1.8;  
graph3\_mc.lineTo(202.5+i,140-260_Go/150_i);  
t+=1/12;  
i=i+3;

}  
}

\_root.c1.addEventListener(“change”, LO);
