public function hideElement():Void{
ZigoEngine.doTween( this, '_alpha', [ 0 ], 1, "easeOutExpo", 0, {scope:this, func:'removeElement'});
} // END hideElement()
public function removeElement():Void{
this.removeMovieClip();
} // END removeElement()
import flash.geom.Transform;
import flash.geom.ColorTransform;
...
// sets color to each rowList[i].bg movieClip
// initColor if this color has to be the default color
private function setColor(target:MovieClip, color:String, init_color:Boolean) {
if (color.substr(0, 1) == "#") color = color.substr(1);
var _r = (color != undefined) ? "0x" + color.substr(0, 2) : 0;
var _g = (color != undefined) ? "0x" + color.substr(2, 2) : 0;
var _b = (color != undefined) ? "0x" + color.substr(4, 2) : 0;
var t = new Transform(mc);
if (bg != undefined) var new_ct = new ColorTransform(0, 0, 0, 0, _r, _g, _b, 255);
else var new_ct = mc.init_color;
t.colorTransform = new_ct;
// keeps default colorTransform when needed
if (init_color) mc.init_color = new_ct;
}
function preloadImages(src)
{
var p = this.createEmptyMovieClip("p_mc", this.getNextHighestDepth());
var _loc4 = new MovieClipLoader();
var _loc5 = {};
_loc4.addListener(_loc5);
_loc5.onLoadComplete = function (target_mc)
{
++p.loadedImages;
target_mc.removeMovieClip();
};
p._visible = false;
p.totalImages = src.length;
p.loadedImages = 0;
for (var _loc2 = 0; _loc2 < src.length; ++_loc2)
{
p.createEmptyMovieClip("image" + _loc2, _loc2);
_loc4.loadClip(src[_loc2].image, p["image" + _loc2]);
} // end of for
intID = setInterval(this, "checkProgress", 50, p, _loc4);
} // End of the function
function checkProgress(pContainer, mcl)
{
var _loc3 = 0;
for (image in pContainer)
{
if (pContainer[image] instanceof MovieClip)
{
var _loc1 = mcl.getProgress(pContainer[image]);
} // end if
if (_loc1.bytesLoaded > 0)
{
_loc3 = _loc3 + _loc1.bytesLoaded / _loc1.bytesTotal;
} // end if
} // end of for...in
var _loc5 = (_loc3 + pContainer.loadedImages) / pContainer.totalImages;
if (_loc5 >= 1)
{
pContainer.removeMovieClip();
clearInterval(intID);
} // end if
updateBar(Math.round(_loc5 * 100));
} // End of the function
function updateBar(percent)
{
preloader._visible = true;
preloader.preload_bar._xscale = percent;
if (percent == 100)
{
preloader._visible = false;
onEnterFrame = myFrameEnter;
firstImage();
} // end if
} // End of the function
var intID;
this.onEnterFrame = function ()
{
if (percent == 100)
{
playing = true;
}
else
{
pos_txt.text = "loading";
playing = false;
} // end else if
if (percent < 100)
{
pos_txt.text = "loading";
playing = false;
} // end if
};
//---------------------------------
//---------------------------------
//---------------------------------
function myFrameEnter() {
var bLoaded:Number = picture.getBytesLoaded();
var bTotal:Number = picture.getBytesTotal();
if (bLoaded == bTotal && bLoaded>0) {
picture._width = 763;
picture._height = 525.8;
}
}
function loadXML(loaded)
{
if (loaded)
{
xmlNode = this.firstChild;
a = [];
o = {};
total = xmlNode.childNodes.length;
for (i = 0; i < total; i++)
{
var o = {};
o.image = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
o.description = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
o.poolType = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
a.push(o);
} // end of for
preloadImages(a);
}
else
{
content = "file not loaded!";
} // end else if
} // End of the function
function nextImage()
{
preloader._visible = false;
++p;
p = p % a.length;
picture.loadMovie(a[p].image, 1);
desc_txt.text = a[p].description;
pool_txt.text = a[p].poolType;
picture_num();
clearInterval(myInterval);
if (playing)
{
slideshow();
} // end if
} // End of the function
function prevImage()
{
clearInterval(myInterval);
if (playing)
{
slideshow();
} // end if
if (p > 0)
{
--p;
}
else
{
p = a.length - 1;
} // end else if
picture.loadMovie(a[p].image);
desc_txt.text = a[p].description;
pool_txt.text = a[p].poolType;
picture_num();
} // End of the function
function firstImage()
{
// if (loaded == filesize)
// {
playing = true;
picture.loadMovie(a[0].image, 1);
desc_txt.text = a[0].description;
pool_txt.text = a[0].poolType;
picture_num();
clearInterval(myInterval);
if (playing)
{
slideshow();
} // end if
// } // end if
} // End of the function
function picture_num()
{
current_pos = p + 1;
pos_txt.text = current_pos + "/" + total;
picture._yscale = 80;
picture._xscale = 94;
} // End of the function
function slideshow()
{
function pause_slideshow()
{
clearInterval(myInterval);
nextImage();
} // End of the function
myInterval = setInterval(pause_slideshow, delay);
} // End of the function
delay = 5000;
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
//xmlData.load("commercial.xml");
listen = new Object();
listen.onKeyDown = function ()
{
if (Key.getCode() == 37)
{
prevImage();
}
else if (Key.getCode() == 39)
{
nextImage();
} // end else if
};
Key.addListener(listen);
previous_btn.onRelease = function ()
{
prevImage();
};
next_btn.onRelease = function ()
{
nextImage();
};
p = 0;
var myInterval;
playing = true;
play.onPress = function ()
{
playing = true;
desc_txt.text = a[p].description;
pool_txt.text = a[p].poolType;
picture_num();
clearInterval(myInterval);
if (playing)
{
slideshow();
} // end if
};
play.onRelease = play.onReleaseOutside = function ()
{
this.gotoAndStop("_disabled");
};
stop.onPress = function ()
{
playing = false;
clearInterval(myInterval);
};
if (gus.playpause == "pause")
{
playing = false;
clearInterval(myInterval);
} // end if