Hello :hugegrin:
I’m trying to create a function in the main timeline that I can use on 26 unique movieclip objects that will simply create a text field and populate each with one of the 26 letters of the alphabet. I’ve been studying functions, variables and how to set them all up and pass parameters using functions and the use of the createTextField method.
So far, I’ve got the following code (which of course does not work) in the main timeline:
function createLetter(sLetter:String):String{
this.createTextField("alphaMC", this.getNextHighestDepth(), 0, 0, 35, 35);
this.alphaMC.text=sLetter;
return;
}
(error message to the above said it required a return statement so I put one in… Why does it ask for one?)
and on the movieclip test object, I’ve placed the following code on the MC:
onClipEvent(load){
createLetter(a);
}
The idea being that on each MC, I could just copy and paste the same code and replace the “a” with the next letter of the alphabet.
The result is… NOTHING! I’ve been at this for quite some time now, so any help would be appreciated.