-
1. Re: Load movie clip with a conditional dynamic text. IF...else...
kglad Oct 30, 2014 12:37 PM (in response to DSierra)assuming you meant they're input textfields, use Event.CHANGE listeners to determine when a user changes the text property of those textfields.
tf1.addEventListener(Event.CHANGE,textF);
tf2.addEventListener(Event.CHANGE,textF);
function textF(e:Event):void{
if(!isNaN(Number(tf1.text)) && !isNaN(Number(tf2.text))){
var mc:MovieClip;
if(Number(tf1.text)<Number(tf2.text){
mc=new MovieClip1();
} else {
mc=new MovieClip2();
}
addChild(mc)
}
}
-
2. Re: Load movie clip with a conditional dynamic text. IF...else...
DSierra Oct 30, 2014 4:24 PM (in response to kglad)Please, imagine that the name os the dynamic texts are called text1 and text2, how can I do that? Is not necessary to use the width, I mean, the positions.
Can you help me with that?
-
3. Re: Load movie clip with a conditional dynamic text. IF...else...
kglad Oct 31, 2014 8:06 AM (in response to DSierra)first, are they dynamic or input textfields?
-
4. Re: Load movie clip with a conditional dynamic text. IF...else...
DSierra Oct 31, 2014 10:23 AM (in response to kglad)They are dynamic texts
-
5. Re: Load movie clip with a conditional dynamic text. IF...else...
kglad Oct 31, 2014 2:10 PM (in response to DSierra)if they're dynamic, you're changing the textfield text properties so when you make a change, compare the two numbers and use:
if(Number(text1.text)<Number(text2.text){
mc=new MovieClip1();
} else {
mc=new MovieClip2();
}
addChild(mc)
}


