Ok, so here’s how I have my movie set up.
frame 1, i have a loadVariables(“varList.dat”, this);
frame 9 I have an if statement that checks to see if the data is loaded, if not, it loops back to frame two, otherwise, it gotoAndStop(10); which is where my content is displayed.
Now, on frame 10, there is a movieclip, and in that movieclip, on frame one is another script that dynamically creates a whole bunch of empty movieclips depending on a variable that is loaded in from the data file. Now here’s where I encounter said “bug”. the script mentioned above creates the clips depending on the variable “myNumber”. Now, I assigned “myNumber” a value of “_root.noOfFiles” (myNumber = _root.noOfFiles; ) which is the variable that is loaded in from the text file. When I do this however, it “Makes this movie run slowly” and ultimately… does NOT work. BUT when I assign myNumber a real number, (ie myNumber = 12; ) everything is hunky-dory, no problems. So what is going on here? Can I not assign a variable the value of a variable that is loaded in from a textfile? this doesn’t make sense, because I finished the project, and no glitches, and I didn’t change a thing, and then all of a sudden, I get the error message that some script is making the movie run slowly. Any ideas on how I can change the scripts I have/write new ones to make this thing work??
Here is the code that makes everything work, if this is of any use…
//-----------Creates the windows-------------
function createWindows() {
yPos = this.window._y;
for (c=1; c<=myNumber; c++) {
clipCounter = c;
duplicateMovieClip("backing", "backing"+clipCounter, this.getNextHighestDepth());
duplicateMovieClip("window", "window"+clipCounter, this.getNextHighestDepth());
//-------------Text---------------------
this.createTextField("Text2"+clipCounter, this.getNextHighestDepth(), this["window"+(clipCounter-1)]._x+this["window"+clipCounter]._width+Spacing, this["window"+clipCounter]._height, this["window"+clipCounter]._width, 40);
this["Text2"+clipCounter].type = "dynamic";
this["Text2"+clipCounter].multiline = "true";
this["Text2"+clipCounter].wordWrap = "true";
this["Text2"+clipCounter].selectable = false;
var my_fmt:TextFormat = new TextFormat();
my_fmt.align = "center";
my_fmt.font = "Verdana";
my_fmt.bold = true;
my_fmt.color = 0x666666;
this["Text2"+clipCounter].setNewTextFormat(my_fmt);
this["Text2"+clipCounter].text = _root["load"+clipCounter];
this.Text21._x = this.Text1._x+1;
//--------------------------------------
this["window"+clipCounter]._alpha = 100;
if (clipCounter == (r*10)+1) {
this["window"+clipCounter]._x = xPos;
} else {
this["window"+clipCounter]._x = this["window"+(clipCounter-1)]._x+this["window"+clipCounter]._width+Spacing;
this["backing"+clipCounter]._x = this["backing"+(clipCounter-1)]._x+this["backing"+clipCounter]._width+Spacing;
}
this["window"+clipCounter].loadMovie(clipCounter+".jpg");
}
xPos = this.window._x;
this.window._alpha = 100;
}
** myNumber = _root.noOfFiles; // <=--- Here is the problem**
Spacing = -1;
moveSpeed = 5;
createWindows();
//----------This moves the images left and right-----------------------
_root.startX = _root.imageClip._x;
clipWidth = myNumber*90;
xPosition = 18-clipWidth+720+moveSpeed;
function moveRight() {
if (_root.imageClip._x>=(xPosition)) {
_root.imageClip._x -= moveSpeed;
} else {
_root.imageClip._x += 0;
}
}
function moveLeft() {
if (_root.imageClip._x<17) {
_root.imageClip._x += moveSpeed;
} else {
_root.imageClip._x += 0;
}
}
this.onEnterFrame = function() {
if (moveRightVar eq "true") {
moveRight();
} else {
_root.imageClip._x += 0;
}
if (moveLeftVar eq "true") {
moveLeft();
} else {
_root.imageClip._x += 0;
}
};
_root.mcLeft.onPress = function() {
moveLeftVar = "true";
};
_root.mcLeft.onRelease = function() {
moveLeftVar = "false";
};
_root.mcRight.onPress = function() {
moveRightVar = "true";
};
_root.mcRight.onRelease = function() {
moveRightVar = "false";
};