Hi everyone!
I am currently creating an online portfolio using Slideshowpro (www.slideshowpro.net).
For some of my pictures I am using (external) captions from a XML file, inserted into a dynamic textfield. As some of the captions contain a lot of text I decided to add a UIScrollBar. However, when there is no text (no caption) available, I want the scrollbar to be hidden. Also if there is not enough text to warrant a scrollbar it would be great if it could be hidden!
Please if you feel you can help, take a look at my current code below. If you have any pointers as to how I can accomplish this then please let me know! All help is much appreciated
Code below, note that “t_txt” is the instance name of my dynamic textfield:
import flash.text.TextField;
import net.slideshowpro.slideshowpro.*;
import fl.controls.UIScrollBar;
XML.ignoreWhitespace = true;
//remove scrollbar from stage, scrollbar component must be in library
var sbContent:UIScrollBar = new UIScrollBar();
sbContent.move(t_txt.x+t_txt.width,t_txt.y);
sbContent.setSize(t_txt.width, t_txt.height);
sbContent.scrollTarget = t_txt;
addChild(sbContent);
function onImageData(event:SSPDataEvent) {
if (event.type==“imageData”) {
t_txt.htmlText=event.data.caption;
sbContent.update();
}
}
slide.addEventListener(SSPDataEvent.IMAGE_DATA, onImageData);