-
1. Re: Before adding a new TF, remove any TF containing "Type Here"
kglad Sep 28, 2011 9:04 AM (in response to Ron Colmen):
newTF_btn.onRelease=function(){
createTF(anchor_mc._x+tl.anchor_mc._width/2,anchor_mc._y,"");
}
function createTF(x:Number,y:Number,s:String):Void{
for(var s:String in tl){
if(tl[s].tf){
if(tl[s].tf.text=="Type Here"){
tl[s].removeMovieClip();
}
}
}
var tfNum_mc:MovieClip = tl.attachMovie("tfID","tfNum_mc_",tl.getNextHighestDepth());
tfNum_mc.tf.text=s;
tfNum_mc.tf.border=true;
tfNum_mc.tf.background = true;
tfNum_mc.tf.backgroundColor = 0xffffff;
tfNum_mc.tf.text="Type Here";
}
}
Message was edited by: Ron Colmen
-
2. Re: Before adding a new TF, remove any TF containing "Type Here"
Ron Colmen Sep 28, 2011 9:37 AM (in response to kglad)Wow! Thanks Kglad.
1.
for(var s:String in tl){
if(tl[s].tf){ // what's the logic here?
2.
_root.mc1.mc2_mc3
Just one more question: Assuming the above code is inside mc3, How can I make tfNum_mc_ appear above all movieclips on the root?
var tfNum_mc:MovieClip = tl.attachMovie("tfID","tfNum_mc_",tl.getNextHighestDepth());
-
3. Re: Before adding a new TF, remove any TF containing "Type Here"
kglad Sep 28, 2011 3:41 PM (in response to Ron Colmen)for(var s:String in tl){
if(tl[s].tf){ // you're looping through every variable defined on tl using the for-loop. the if-statement is checking if any of those variables has a child, tf
2.
_root.mc1.mc2_mc3
Just one more question: Assuming the above code is inside mc3, How can I make tfNum_mc_ appear above all movieclips on the root?
i don't see an mc3. but tfNum_mc is created above everything in tl when it's created. if something is created after it and you want to move it back to the top, use swapDepths().
if tl is not the _root timeline, you can move tl so it's above everything else or attach tfNum_mc to a different timeline (eg, _root).
var tfNum_mc:MovieClip = tl.attachMovie("tfID","tfNum_mc_",tl.getNextHighestDepth());
-
4. Re: Before adding a new TF, remove any TF containing "Type Here"
Ron Colmen Sep 28, 2011 4:28 PM (in response to kglad)Thank you Kglad!
-
5. Re: Before adding a new TF, remove any TF containing "Type Here"
kglad Sep 28, 2011 4:33 PM (in response to Ron Colmen)you're welcome.



