I'm using Flash MX6.
It seems if you want to scroll text in a box you have 2 options
1 - use a DTB and get some scroll buttons working (and maybe a slider too). But this makes the text aliased and ugly, and scrolls too fast usually
2 - use a TB full of any text you like, and mask only the area you want to read, and scroll the TB up/down behind the mask hole.
I've tried going for 2, but 1 - the textbox is visible completely, not masked, and worse than that 2 - my resizeStage function that runs at the beginning after loading the settings for the presentation, seems to take into account the big textbox despite the face the unseeable area that's masked shouldn't count towards the stagesize - as it is currently the stage is considered much bigger to accomodate the textbox you can't even see (should onyl see the bits scrolling past the masked hole area)
The resize function is this
This is where I draw the box area I want the text to appear in, along with the masks and borders etc
Now I draw the textbox and the masks for it
Some of this code may be using variables I read in previously so if you wanted to test it you'd have to set them yourself.
But hopefully someone just knows a solution or a better way to have a scrolling textbox/textarea
_________________________________
Leozack
It seems if you want to scroll text in a box you have 2 options
1 - use a DTB and get some scroll buttons working (and maybe a slider too). But this makes the text aliased and ugly, and scrolls too fast usually
2 - use a TB full of any text you like, and mask only the area you want to read, and scroll the TB up/down behind the mask hole.
I've tried going for 2, but 1 - the textbox is visible completely, not masked, and worse than that 2 - my resizeStage function that runs at the beginning after loading the settings for the presentation, seems to take into account the big textbox despite the face the unseeable area that's masked shouldn't count towards the stagesize - as it is currently the stage is considered much bigger to accomodate the textbox you can't even see (should onyl see the bits scrolling past the masked hole area)
The resize function is this
Code:
function resizeStage() {
var stageW = Stage.width;
var stageH = Stage.height;
stageH = stageH - (imgHeight)
if (stageW/stageH>ratio) {
containerMC._height = stageH;
containerMC._width = containerMC._height*ratio;
} else {
containerMC._width = stageW;
containerMC._height = containerMC._width/ratio;
}
containerMC._x = Math.floor((stageW-containerMC._width)/2);
};
Code:
infoMC = containerMC.createEmptyMovieClip("infoboxMC_mc", 5);
infoMC._x = margin;
infoMC._y = imgHeight + (margin * 2);
infoBG = infoMC.createEmptyMovieClip("infobox_mc", 1);
;Draw a box on infoBG with the background colours
infoHolderMC = infoMC.createEmptyMovieClip("infoboxholder_mc", 2);
infoMaskMC = infoMC.createEmptyMovieClip("infoboxmask_mc", 4);
infoBorderMC = infoMC.createEmptyMovieClip("infoboxborder_mc", 5);
infoMaskMC._visible = false;
;Draw a box on infoMaskMC to be a hole for the textbox area
;Draw a box on infoBorderMC with the border around it
Code:
infoHolderMC.createTextField("info_text",102,infoBorderWidth,infoBorderWidth,imgWidth,imgHeight);
infoHolderMC.info_text.multiline = true;
infoHolderMC.info_text.border = 1;
infoHolderMC.info_text.wordWrap = true;
infoHolderMC.info_text.html = true;
infoHolderMC.info_text.text = SampleText;//"Here's some info";
infoTF = new TextFormat();
infoTF.font = "Verdana";
infoTF.size = infoTxtSize;
infoTF.align = infoTxtAlign;
infoTF.color = infoTxtColour;
infoHolderMC.info_text.setTextFormat(infoTF);
infoHolderMC.setMask(infoMaskMC);
But hopefully someone just knows a solution or a better way to have a scrolling textbox/textarea
_________________________________
Leozack
Code:
MakeUniverse($infinity,1,42);