hi im having some trouble with my code, everything works fine, i just cant get the grid for the images to grid correctly, i was hoping someone could help
stop();
#include "mc_tween2.as"
var El:XML = new XML();
var aa = 0;
El.ignoreWhite = true;
/////////////////////////////////////////////////////////////////////////////
function mystyless(tc, xc) {
var myStyl:TextField.StyleSheet = new TextField.StyleSheet();
myStyl.onLoad = function(success:Boolean) {
if (success) {
tc.styleSheet = myStyl;
tc.htmlText = xc;
//tc._visible = true;
//tc._alpha=20
}
};
myStyl.load("sample.css");
tc.styleSheet = myStyl;
tc.text = xc;
}
///////////////////////////////////////////////////////////////////////////
numn = 0;
col = 4;
row = 2;
scale = 100;
space = 5;
function window(mc) {
//mc._visible=false
var c = this.attachMovie("extended", "extended", this.getNextHighestDepth);
var xx = c.attachMovie("txxtmovie", "txxtmovies", c.getNextHighestDepth);
var yy = xx.attachMovie("txxtmovie", "txxtmoviet", xx.getNextHighestDepth);
mk.duplicateMovieClip("mmk", 998);
mmk._alpha = 0;
mmk._height = 444;
this.setMask(mmk);
yy._width = 370;
c._x = holder._x;
yy._alpha = 0;
c._alpha = 0;
c._y = 0;
xx.bk._alpha = 0;
yy._y = 22;
//(this._height-5)/i;
//*i;
c.createTextField("my_txta", 44, 24, 24, 370, 100);
c.createTextField("my_d1", 45, 44, 24, 370, 100);
c.createTextField("my_d2", 46, 24, 60, 370, 100);
c.createTextField("my_d3", 47, 24, 80, 370, 100);
c.createTextField("my_web", 48, 24, 100, 370, 44);
xx.createTextField("my_exit", 45, 280, 24, 370, 100);
c.my_txta.selectable = false;
c.my_d1.selectable = false;
c.my_d1.selectable = false;
c.my_d2.selectable = false;
c.my_d3.selectable = false;
c.my_web.selectable = false;
var exit:TextField = xx.my_exit;
var tff:TextField = c.my_txta;
var dtl1:TextField = c.my_d1;
var dtl2:TextField = c.my_d2;
var dtl3:TextField = c.my_d3;
var web1:TextField = c.my_web;
//xx._y=22
xx._x = tff._x;
dtl1._x = 522;
dtl2._x = 522;
dtl3._x = 522;
web1._x = 522;
dtl1._alpha = 0;
dtl2._alpha = 0;
dtl3._alpha = 0;
web1._alpha = 0;
var txx = tff._x;
var exity = txx;
var myStyle:TextField.StyleSheet = new TextField.StyleSheet();
myStyle.onLoad = function(success:Boolean) {
if (success) {
tff.styleSheet = myStyle;
tff.htmlText = mc.shows;
dtl1.styleSheet = myStyle;
dtl2.styleSheet = myStyle;
dtl3.styleSheet = myStyle;
web1.styleSheet = myStyle;
dtl1.htmlText = mc.detail1;
dtl2.htmlText = mc.detail2;
dtl3.htmlText = mc.detail3;
web1.htmlText = mc.WEB;
exit.styleSheet = myStyle;
exit.selectable = false;
exit.htmlText = "<p class='preview1'>GO BACK >>></p>";
tff._visible = false;
tff._x = 144;
exit._y = -44;
}
/////////////////////
var loadListener:Object = new Object();
loadListener.onLoadComplete = function(target_mc:MovieClip, httpStatus:Number):Void {
trace(">> loadListener.onLoadComplete()");
trace(">> =============================");
trace(">> target_mc._width: "+target_mc._width);
//
// 0
trace(">> httpStatus: "+httpStatus);
};
loadListener.onLoadInit = function(target_mc:MovieClip):Void {
trace(">> loadListener.onLoadInit()");
trace(">> =============================");
trace(">> target_mc._width: "+target_mc._width);
_global.targc = target_mc;
var thumb = mc.thumb;
for (l=0; l<col; l++) {
for (j=0; j<row; j++) {
if (numn<thumb.length) {
var sht:String = "_level0.extended.mcc.mclip"+numn;
var myArrayj:Array = Array();
myArrayj[numn] = sht;
var mcdjj:MovieClip = eval(myArrayj[numn]);
//with (eval(mcdj)) {
mcdjj._x = ((mcdjj._width+space)*scale/100)*l;
mcdjj._y = ((mcdjj._height+space)*scale/100)*j;
mcdjj._xscale = mcdjj._yscale=scale;
//mcdjj._visible = true;
trace(mcdjj);
//}
numn++;
}
}
}
// 315
};
var thumb = mc.thumb;
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(loadListener);
for (ii=0; ii<thumb.length; ii++) {
var img:String = thumb[ii].firstChild;
//trace(img);
var mcdmain:MovieClip = c.createEmptyMovieClip("mcc", c.getNextHighestDepth());
mcdmain._x = 52;
mcdmain._y = 133;
var mcd:MovieClip = c.mcc.createEmptyMovieClip("mclip"+ii, c.mcc.getNextHighestDepth());
//mcd._x = 322;
//mcd._y = 133;
mcd._alpha = 0;
mcd.glowTo(0x000000, 1, 6, 1000, 2, true, false, .5);
mcLoader.loadClip(""+img+"", mcd);
trace(mcd);
}
//for (var a:Number = 0; a<sh.length; a++) {
//if (a != selMenu) {
//novoItem = eval("holder.txxtmovie"+a);
//novoItem.txt_mc.colorTo("0x666666", 1);
//novoItem.tween("_x", 521, 0.7, "easeOutExpo", a/sh.length);
//trace(novoItem);
//} else {
//}
//}
/////////////////
c.alphaTo(100, .4, "linear", 0, function () {
//this.setMask(mk);
tff.tween("_x", txx, 0.7, "easeOutExpo", 0, function () {
trace(thumb.length);
dtl1.tween("_alpha", 100, 0.7, "easeOutExpo", .1);
dtl2.tween("_alpha", 100, 0.7, "easeOutExpo", .2);
dtl3.tween("_alpha", 100, 0.7, "easeOutExpo", .3);
web1.tween("_alpha", 100, 0.7, "easeOutExpo", .4, function () {
for (u=0; u<thumb.length; u++) {
var st:String = "_level0.extended.mcc.mclip"+u;
var myArray:Array = Array();
myArray[u] = st;
var mcdj:MovieClip = eval(myArray[u]);
//mcdj._alpha=100
var tr = mcdj.tween("_alpha", 100, 0.7, "easeOutExpo", u/thumb.length);
//mcdj.tween("_x", (mcdj._width+15)*u, 0.7, "easeOutExpo", u/thumb.length);
//trace(mcdj);
ff=mcdj._y
mcdj.onRollOver = function() {
//this.colorTo(0xFFFFFF, 0.3, "linear");
this.tween("_y", this._y-7, .5, "easeOutBounce");
this.glowTo(0x000000, 1, 2, 1000, 2, true, false, .5);
};
mcdj.onRollOut = function() {
//this.colorTo(0xCCCCCC, 0.5, "linear");
this.tween("_y", ff, .3, "easeOutBounce");
this.glowTo(0x000000, 1, 6, 1000, 2, true, false, .5);
};
}
});
dtl1.tween("_x", 44, 0.7, "easeOutExpo", .1);
dtl2.tween("_x", 24, 0.7, "easeOutExpo", .2);
dtl3.tween("_x", 24, 0.7, "easeOutExpo", .3);
web1.tween("_x", 24, 0.7, "easeOutExpo", .4);
yy.alphaTo(100, 1, "easeOutExpo");
});
exit.tween("_y", exity, 0.7, "easeOutExpo");
tff._visible = true;
});
};
myStyle.load("sample.css");
//tff.styleSheet = myStyle;
//tff.htmlText = mc.shows;
//trace(mc);
yy.onRollOver = function() {
yy.bk.colorTo(0xFFFFFF, 0.5, "linear");
exit.colorTo(0xCC0000, 0.5, "linear");
};
yy.onRollOut = function() {
yy.bk.colorTo(0xCCCCCC, 0.5, "linear");
exit.colorTo(0x000000, 0.5, "linear");
};
yy.onRelease = function() {
var aa = mc.thumb.length;
for (u=0; u<mc.thumb.length; u++) {
var st:String = "_level0.extended.mcc.mclip"+u;
var myArray:Array = Array();
myArray[u] = st;
var mcdjj:MovieClip = eval(myArray[u]);
//mcdj._alpha=100
mcdjj.tween("_alpha", 0, 0.5, "easeOutExpo", u/mc.thumb.length);
mcdjj.tween("_x", mcdjj._x-55, 0.5, "easeOutExpo", u/mc.thumb.length);
}
trace(mcdjj);
//Slctd()
exit.tween("_y", -44, 0.7, "easeInExpo");
tff.tween("_x", 134, 0.7, "easeInExpo");
tff.tween("_alpha", 0, 0.7, "linear");
dtl1.tween("_x", 555, 0.7, "easeOutExpo", .1);
dtl2.tween("_x", 555, 0.7, "easeOutExpo", .2);
dtl3.tween("_x", 555, 0.7, "easeOutExpo", .3);
web1.tween("_x", 555, 0.7, "easeOutExpo", .4);
dtl1.tween("_alpha", 0, 0.7, "easeOutExpo", .1);
dtl2.tween("_alpha", 0, 0.7, "easeOutExpo", .2);
dtl3.tween("_alpha", 0, 0.7, "easeOutExpo", .3);
web1.tween("_alpha", 0, 0.7, "easeOutExpo", .4);
c.alphaTo(0, .7, "linear", 0, function () {
meuScroll.tween("_alpha", 100, 1, "easeOutExpo");
meuScroll.tween("_y", holder._y, 0.7, "easeOutBounce");
for (var zz:Number = 0; zz<shh; zz++) {
novoItem = eval("_root.holder.txxtmovie"+zz);
novoItem._alpha = 0;
//trace(novoItem);
novoItem.tween("_x", 0, 0.7, "easeOutBounce", zz/shh);
novoItem.tween("_alpha", 100, 0.7, "easeOutBounce", zz/shh);
}
//tff.tween("_y", txx, 0.7, "easeOutExpo", 0, function () {
//yy.alphaTo(100, 1, "easeOutExpo");
//tff._visible = true;})
//novoItem.txt_mc.colorTo("0x666666", 1);
// holder.alphaTo(100, .1, "linear");
// holder._visible = true;
c.removeMovieClip(extended);
});
};
}
/////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
this.attachMovie("mkk", "mk", 999);
mk._width = 435;
mk._height = 220;
mk._x = holder._x;
mk._y = holder._y;
holder.setMask(mk);
//mk.colorTo(0x000000, 0.3, "linear");
El.onLoad = function(success:Boolean) {
var childs:XMLNode = this.firstChild;
// Número total de nós
var childTotal:Number = childs.childNodes.length;
var sh:Array = this.firstChild.childNodes;
trace(childTotal);
_global.shh = childTotal;
for (i=0; i<sh.length; i++) {
var s:Array = sh*.childNodes;
ids = sh*.firstChild;
preview1 = i+" <p class='preview1'>"+s[1].firstChild+"</p>";
preview2 = "<p class='preview2'>"+s[2].firstChild+"</p>";
preview3 = "<p class='preview3'>"+s[3].firstChild+"</p>";
_global.detail1 = "<p class='detail1'>"+s[4].firstChild+"</p>";
detail2 = "<p class='detail2'>"+s[6].firstChild+"</p>";
detail3 = "<p class='detail3'>"+s[7].firstChild+"</p>";
WEB = "<a href='"+s[5].firstChild+"'>"+s[5].firstChild+"</a> ";
var thumb = s[8].childNodes;
//for (h=0; h<thumbdd.length; h++) {
//var thumb:Array = thumbdd[h].firstChild;
//trace(thumb[0])
//}
var image = s[9].firstChild;
var a = holder.attachMovie("txxtmovie", "txxtmovie"+i, aa++);
var shows = preview1+" "+preview2+" "+preview3;
var shows2 = "<U>"+ids+" </U>";
//+newline+detail1+newline+detail2+newline+detail3+newline+WEB+newline+newline;
a.createTextField("my_txt", aa++, 0, 0, 110, 20);
a.createTextField("my_txt2", aa++, 122, 0, 200, 20);
a.createTextField("my_txt3", aa++, 272, 0, 120, 20);
var tf:TextField = a.my_txt;
var tft:TextField = a.my_txt2;
var ttt:TextField = a.my_txt3;
a.thumb = thumb;
a.image = image;
//tft.text = preview2;
//tf.text = preview1;
//ttt.text = preview3;
tft.html = true;
tf.html = true;
ttt.html = true;
//tfslide = 0
//tf._x = -33
meuScroll._alpha = 0;
meuScroll._x = mk._x+mk._width-38;
novoItem = eval(a);
novoItem.iDD = i;
//trace(novoItem.iDD)
//this.alphaTo(100, .5, "easeInExpo", i/sh.length, function () {
//3
meuScroll._y = 350;
a._visible = false;
a._alpha = 0;
a._x = +533;
a.alphaTo(0, .5, "easeInExpo", i/sh.length, function () {
this._visible = true;
this.tween("_x", 0, 0.7, "easeOutBounce");
this.alphaTo(100, .2, "easeInExpo", 0, function () {
meuScroll.tween("_alpha", 100, 2, "easeOutExpo", .1);
meuScroll.tween("_y", mk._y, 0.7, "easeOutBounce", 0);
});
});
//a.my_txt.setNewTextFormat(my_fmt1);
//a.my_txt2.setNewTextFormat(my_fmt1);
a.detail1 = detail1;
a.detail2 = detail2;
a.detail3 = detail3;
a.WEB = WEB;
a.shows = shows2;
var my_:TextFormat = new TextFormat();
my_.underline = true;
my_.color = 0xFF9900;
//a.my_txt.border = true;
a.onRollOver = function() {
myStyl.clear();
var replacement;
var replacement = "<u><p class='preview2'>"+s[2].firstChild+"</p></u>";
this.my_txt2.htmlText = replacement;
//mystyless(tft, preview2);
this.my_txt2.textColor = 0x000000;
//.scaleTo(200, 1, "easeoutelastic");
this.bk.colorTo(0xFFFFFF, 0.3, "linear");
};
a.onRollOut = function() {
this.bk.colorTo(0xCCCCCC, 0.5, "linear");
this.my_txt2.htmlText = tft.htmlText;
this.my_txt2.textColor = 0xCC0000;
};
a.onRelease = function() {
var ss:MovieClip = this;
meuScroll.tween("_alpha", 0, 1, "easeOutExpo");
meuScroll.tween("_y", 355, 0.7, "easeOutBounce");
//a.enabled=false
_global.selMenu = this.iDD;
//trace(this.iDD);
for (var a:Number = 0; a<sh.length; a++) {
//if (a != selMenu) {
novoItem = eval("holder.txxtmovie"+a);
//novoItem.txt_mc.colorTo("0x666666", 1);
novoItem.tween("_x", 521, 0.7, "easeOutExpo", a/sh.length);
//trace(novoItem);
//} else {
//}
}
window(ss);
//ss.alphaTo(0, .5, "easeInExpo", i/sh.length, function () {})
//_root.holder.alphaTo(0, 1, "linear", 0, function () {
//_root.holder._visible = false;
//trace(ss);
//});
//}
};
mystyless(tf, preview1);
mystyless(tft, preview2);
mystyless(ttt, preview3);
//window(ss);
a._y = (a._height+5)*i;
aa++;
}
};
El.load("ample2.xml");