Hi all,
i am facing a problem right now, i wanted to stop the tween from happening until the image is loaded from the XML. how can i do that ?
by using this if condition wont stop it. My motive is not to show the preloader …
[COLOR=#000000][COLOR=#007700] if([/COLOR][COLOR=#0000BB]loaded[/COLOR][COLOR=#007700]>=[/COLOR][COLOR=#0000BB]filesize[/COLOR][COLOR=#007700])
{
new [/COLOR][COLOR=#0000BB]mx[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]transitions[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]Tween[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]picture[/COLOR][COLOR=#007700], [/COLOR][COLOR=#DD0000]"_x"[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]mx[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]transitions[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]easing[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]Strong[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]easeInOut[/COLOR][COLOR=#007700], -[/COLOR][COLOR=#0000BB]550[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]7[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]true[/COLOR][COLOR=#007700]);
new [/COLOR][COLOR=#0000BB]mx[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]transitions[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]Tween[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]picture2[/COLOR][COLOR=#007700], [/COLOR][COLOR=#DD0000]"_x"[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]mx[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]transitions[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]easing[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]Strong[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]easeInOut[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]550[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]7[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]true[/COLOR][COLOR=#007700]); [/COLOR][/COLOR]
}
anyone can help me …
// import classes
import mx.transitions.*;
import mx.transitions.easing.*;
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
p = 0;
o = 0;
i = 0;
this.onEnterFrame = function() {
if(i==0)
{
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize)
{
preloader.preload_bar._xscale = 100*loaded/filesize;
}
else
{
preloader._visible = false;
if (picture._alpha<100)
{
picture._alpha += 10;
}
}
desc_txt.text = filesize;
}
/////////////////////
if(i==1)
{
filesize2 = picture2.getBytesTotal();
loaded2 = picture2.getBytesLoaded();
preloader._visible = true;
if (loaded2 != filesize2) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture2._alpha<100) {
picture2._alpha += 10;
}
}
if(filesize>4000)
dtxt.text = "lamer2";
desc_txt.text = filesize2;
}
///////
//desc_txt.text = o++;
};
function nextImage() {
i=0;
if(p==(total-1))
{
p=-1;
}
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
if(loaded>=filesize)
{
new mx.transitions.Tween(picture, "_x", mx.transitions.easing.Strong.easeInOut, -550, 0, 7, true);
new mx.transitions.Tween(picture2, "_x", mx.transitions.easing.Strong.easeInOut, 0, 550, 7, true);
//desc_txt.text = p;
//desc_txt.text = description[p];
pause2();
}
}
}
}
function nextImage2() {
i=1;
if(p==(total-1))
{
p=-1;
}
if (p<(total-1)) {
p++;
if (loaded2 == filesize2) {
picture2._alpha = 0;
picture2.loadMovie(image[p], 1);
if(loaded2>=filesize2)
{
new mx.transitions.Tween(picture2, "_x", mx.transitions.easing.Strong.easeInOut, -550, 0, 7, true);
new mx.transitions.Tween(picture, "_x", mx.transitions.easing.Strong.easeInOut, 0, 550, 7, true);
//desc_txt.text = description[p];
//desc_txt.text = p;
pause();
}
}
}
}
function firstImage() {
i=0;
//if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
//desc_txt.text = description[0];
pause2();
//}
}
function pause2()
{
pauseInterval = setInterval(pause_slideshow, 8000);
function pause_slideshow()
{
clearInterval(pauseInterval);
nextImage2();
}
}
function pause()
{
pauseInterval = setInterval(pause_slideshow, 8000);
function pause_slideshow()
{
clearInterval(pauseInterval);
nextImage();
}
}