PDA

View Full Version : createTextField() problems


mrand01
04-29-2004, 06:31 PM
This function runs, but when the "loading" text comes up, you only see half of it, the bottom half is cut off. Its like the movieclip it is in can't make space for it...I tried to resize the movieclip it is in, but then the text didn't show at all. What gives?


function loadPictures(arrImages:Array) {
var mcImage:MovieClip = mcImages.createEmptyMovieClip("mcImage1", mcImages.getNextHighestDepth());
var mclPreload:MovieClipLoader = new MovieClipLoader();
var objPreload:Object = new Object();
var strPath:String = "../images/logos/";
var numCounter:Number = 0;

objPreload.onLoadStart = function(mcTarget:MovieClip) {
if (numCounter == 0) {
var mcLoading:MovieClip = mcImages.createEmptyMovieClip("mcLoading", mcImages.getNextHighestDepth() + arrImages.length);
var numLoading:Number = 0;

mcLoading.createTextField("txtLoading", mcLoading.getNextHighestDepth(), 0, 138, 214, 14);

mcLoading.onEnterFrame = function() {
switch (numLoading) {
case 0:
this.txtLoading.text = "Loading";
numLoading++;
break;
case 1:
this.txtLoading.text += ".";
numLoading++;
break;
case 2:
this.txtLoading.text += ".";
numLoading++;
break;
case 3:
this.txtLoading.text += ".";
numLoading = 0;
break;
}
}
}
}

objPreload.onLoadProgress = function(mcTarget:MovieClip, loadedBytes:Number, totalBytes:Number) {

}

objPreload.onLoadComplete = function(mcTarget:MovieClip) {

}

objPreload.onLoadInit = function(mcTarget:MovieClip) {

}

objPreload.onLoadError = function(mcTarget:MovieClip, strErrorCode:String) {

}

mclPreload.addListener(objPreload);
trace (strPath + arrImages[numCounter][0]);
mclPreload.loadClip("../images/logos/cpc.jpg", mcImage);
}

Cyanide
04-30-2004, 08:19 PM
txtLoading.autoSize = true;

That should make the box fit itself to the text.