-
Duplicated text MCs and variables
I am trying to create a looping display text. The goal is that each loop creates a new MC and the MC shows a specific variable (or array element).
I have tried this with text buried in an MC, actionscript created text boxes... precreating the needed MCs and then placing them... nothign works
This variation creates the MCs at the right time, but the text area always displays the current variable... I think it comes down to binding the variable to the item, but for the life of me, I can't get it to work - and I knwo I have done it somewhere before!
Frame 1
//set current jump to 0, set max jumps
nowJump = 0;
maxJumps = 5;
//item count
item = 0;
//walls
boxL = 0;
boxB = 566;
boxR = 35.4;
boxT = 0;
// sub texts
var subText = new Array();
subText[0] = "http://";
subText[1] = "html";
subText[2] = "internet";
subText[3] = "actionscript";
subText[4] = "www";
subText[5] = "php";
subText[6] = "Flash";
//fianl locations
var finalX = new Array();
var finalY = new Array();
finalX[0] = 24;
finalY[0] = 212;
finalX[1] = 0;
finalY[1] = 0;
finalX[2] = 0;
finalY[2] = 0;
finalX[3] = 0;
finalY[3] = 0;
finalX[4] = 0;
finalY[4] = 0;
finalX[5] = 0;
finalY[5] = 0;
finalX[6] = 0;
finalY[6] = 0;
Frame 2: JumpsStart
// number of jumps
jumps = Math.ceil(Math.random()*maxJumps);
duplicateMovieClip(subTextBox, "subTextBox"+item, item+1);
currBox = "subTextBox"+item;
Frame 3:JumpTo
// random X and Y
jumpX = Math.round(Math.random()*(boxR-boxL))+boxL;
jumpY = Math.round(Math.random()*(boxT-boxB))+boxB;
eval(currBox)._x = jumpX;
eval(currBox)._y = jumpY;
// set content
-->>> this si where I need to set the content and nothing works
Frame 7
if (nowJump <= maxJumps){
gotoAndPlay("jumpTo");
nowJump++;
}
else{
eval(currBox)._x = finalX[item];
eval(currBox)._y = finalY[item];
play();
};
Frame 11
item++;
gotoAndPlay("jumpStart");
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|