import TextField.StyleSheet;
var css_str:String = _root.textstyle;
var btext:String = '';
var ftext:String = '';
if(_root.textstyle){
var css_str = "p {" +css_str+ " }";
var my_styleSheet:StyleSheet = new StyleSheet();
my_styleSheet.parseCSS(css_str);
myDescription.styleSheet = my_styleSheet;
btext = '<p>';
ftext = '</p>';
}
var myxmlpath = _root.myxmlpath;
myFlow.contentXML = myxmlpath;
if (_root.flowFadeSpace){
myFlow.flowFadeSpace = int(_root.flowFadeSpace);
}
var flowAnimationTweenType:String = _root.flowAnimationTweenType;
myFlow.flowAnimationTweenType = flowAnimationTweenType;
var flowAnimationSpeed = _root.flowAnimationSpeed;
myFlow.flowAnimationSpeed = int(flowAnimationSpeed);
var slideShowTime = _root.slideShowTime;
if (slideShowTime) {
myFlow.slideShowTime = int (slideShowTime);
}
var slideShow = int (_root.slideShow);
if(slideShow == 0){
var slideShow:Boolean = false;
myFlow.slideShow = slideShow;
}
var slideShowLoop = int(_root.slideShowLoop);
if(slideShowLoop == 0){
var slideShowLoop:Boolean = false;
myFlow.slideShowLoop = slideShowLoop;
}
var selectionInterval:Number;
function onFirstImageLoad(event:Object)
{
if (_root.decription=='1') {
myDescription.text = btext+myFlow.getSelectedItem().description+ftext;
}
selectionInterval = setInterval(getSelectedItem, event.target.slideShowTime, event.target);
event.target.removeEventListener("ITEM_LOAD_COMPLETE", onFirstImageLoad);
}
myFlow.addEventListener("ITEM_LOAD_COMPLETE", onFirstImageLoad);
function getSelectedItem()
{
if (myFlow.slideShowLoop==false){
if(myFlow.getTotalItems() == myFlow.getSelectedItemNum()+1){
clearInterval(selectionInterval);
}
}
//myFlow.selectNextItem();
if (_root.decription=='1') {
myDescription.text = btext + myFlow.getSelectedItem().description + ftext;
}
}
var imagePadding = _root.imagePadding;
if (imagePadding) {
myFlow.imagePadding = int (imagePadding);
}
if (_root.angle){
myFlow.imagePerspective.angle = int(_root.angle);
}
if (_root.vertical){
myFlow.imagePerspective.vertical = parseFloat(_root.vertical);
}
if (_root.iwidth){
myFlow.imageSize.width = int(_root.iwidth);
}
if (_root.iheight){
myFlow.imageSize.height = int(_root.iheight);
}
if (_root.listheight){
myFlow.height = int(_root.listheight);
}
if (_root.alpha){
myFlow.reflectionSetting.alpha = int (_root.alpha);
}
if (_root.clipAlpha){
myFlow.reflectionSetting.clipAlpha = int (_root.clipAlpha);
}
if (_root.distance){
myFlow.reflectionSetting.distance = int (_root.distance);
}
if (_root.matrixRatio){
myFlow.reflectionSetting.matrixRatio = int (_root.matrixRatio);
}
if (_root.matrixDropOff){
myFlow.reflectionSetting.matrixDropOff = int (_root.matrixDropOff);
}
if (_root.startItem){
myFlow.startItem = int(_root.startItem);
}
var eventListener = new Object();
eventListener.XML_LOAD_COMPLETE = function(evnt){
myUiloader.source = myFlow.startItem(num);
}
myFlow.addEventListener("XML_LOAD_COMPLETE", eventListener);
//Display image description text
if (_root.descordinate) {
myDescription._y = parseFloat (_root.descordinate);
}
function dspText(event:Object){
myFlow.selectItem(event.target);
if (_root.decription=='1') {
myDescription.text = btext + myFlow.getSelectedItem().description + ftext;
}
}
//myFlow.previewClip = "holder_mc";
// display first image description
//myFlow.addEventListener("ITEM_LOAD_COMPLETE",dspText);
// display description once image is clicked
myFlow.addEventListener("ITEM_ON_PRESS", dspText);
// load selected item
myFlow.addEventListener("ITEM_ON_PRESS", this);
function ITEM_ON_PRESS(evnt:Object) {
var item:Object = myFlow.getSelectedItem();
if (_root.type == "content"){
if(item.path == evnt.target.path){
var my_url:Array = evnt.target.data.split("&");
getURL(my_url.join('&'), "_self");
}
}
}