AW: Text stat Bilder laden
des muss ja auch noch scroll bar sein
hier die scripts:
comfig:
Stage.scaleMode = "noScale";
Stage.align = "TL";
//import do engine fuse
import com.mosesSupposes.fuse.*;
ZigoEngine.simpleSetup(Shortcuts, ******Easing, Fuse, FuseFMP);
vars:
var upBottombar:Boolean = undefined
var controlFloat:Boolean = false
var imagesArr:Array = new Array();
var cursorArr:Number = 0;
toStage:
mainmenu._x = Math.floor (Stage.width + 425);
mainmenu._y = Math.floor (Stage.height / 2);
mainmenu.menuBars._height = Stage.height;
imageContainer._x = 0;
imageContainer._y = 0;
bgContainer._x = 0
bgContainer._y = 0
onRezise:
var stageListener:Object = new Object ();
stageListener.onResize = function () {
bgContainer._x = 0;
bgContainer._y = 0;
if (mainmenuOpen == false) {
mainmenu._x = Stage.width + 400;
mainmenu._y = Math.floor (Stage.height / 2);
hitUp._x = Stage.width;
hitUp._y = 0;
hitUp._width = 25;
hitUp._height = Stage.height;
}
else if (mainmenuOpen == undefined) {
mainmenu._x = Stage.width + 425;
mainmenu._y = Math.floor (Stage.height / 2);
}
else {
mainmenu._x = Stage.width;
mainmenu._y = Math.floor (Stage.height / 2);
hitDown._x = 0;
hitDown._y = 0;
hitDown._width = Stage.width - 425;
hitDown._height = Stage.height;
}
mainmenu.menuBars._height = Stage.height;
imageContainer._x = 0;
imageContainer._y = 0;
ZigoEngine.doTween (loaderMC,'_x,_y',[Stage.width / 2, Stage.height / 2],1,"easeOutExpo");
setPositions ();
};
Stage.addListener (stageListener);
functions:
import flash.display.*;
//If you are using this photoGallery as a module of
//Full XML Website delete this line of code to disable the background.
// This module will assume the template background.
//loadMovie("backgrounds/background.swf",bgContainer);
//--------------------------------------------------------------------
loadTmbs ();
function setPositions () {
if (imageContainer._height > Stage.height) {
imageContainer._width = Stage.width;
imageContainer._yscale = imageContainer._xscale;
}
if (imageContainer._height <= Stage.height) {
imageContainer._height = Stage.height;
imageContainer._xscale = imageContainer._yscale;
}
if (imageContainer._width < Stage.width) {
imageContainer._width = Stage.width;
imageContainer._yscale = imageContainer._xscale;
}
imageContainer._x = (-(imageContainer._width - Stage.width) / 2);
imageContainer._y = Stage.height - imageContainer._height;
}
function intro () {
ZigoEngine.doTween (mainmenu,'_x',Stage.width,1,"easeInOutExpo",0,function () {
mainmenuOpen = true;
controlMainmenu ();
});
}
function controlMainmenu () {
if (mainmenuOpen == false) {
attachMovie ("hitUp","hitUp",0);
hitUp._x = Stage.width;
hitUp._y = 0;
hitUp._width = 25;
hitUp._height = Stage.height;
hitUp.useHandCursor = false;
hitUp.onRollOver = function () {
mainmenuOpen = true;
ZigoEngine.doTween (mainmenu,'_x',Stage.width,1,"easeOutExpo");
controlMainmenu ();
};
}
else if (mainmenuOpen == true) {
attachMovie ("hitDown","hitDown",0);
hitDown._x = 0;
hitDown._y = 0;
hitDown._width = Stage.width - 425;
hitDown._height = Stage.height;
hitDown.useHandCursor = false;
initFloat (mainmenu.containerTmbs);
hitDown.onRollOver = function () {
mainmenuOpen = false;
ZigoEngine.doTween (mainmenu,'_x',Stage.width + 400,0.5,"easeOutExpo");
controlMainmenu ();
};
}
}
function loadTmbs () {
var tmbs:XML = new XML ();
tmbs.ignoreWhite = true;
tmbs.onLoad = function (success) {
if (success) {
var root:XMLNode = this.firstChild;
for (i = 0; i < root.childNodes.length; i++) {
var titleTxt:String = root.childNodes.childNodes[0].childNodes[0].nodeValue;
var descTxt:String = root.childNodes.childNodes[1].childNodes[0].nodeValue;
var thumbs:String = root.childNodes.childNodes[2].childNodes[0].nodeValue;
var images:String = root.childNodes.childNodes[3].childNodes[0].nodeValue;
imagesArr.push (images);
mainmenu.containerTmbs.attachMovie ("tmb","tmb" + i,i);
mainmenu.containerTmbs["tmb" + i]._y = i * 80;
loadMovieClip (thumbs,mainmenu.containerTmbs["tmb" + i].containerTmb);
mainmenu.containerTmbs["tmb" + i].titleLabel.titleText.htmlText = titleTxt
mainmenu.containerTmbs["tmb" + i].descLabel.descText.htmlText = descTxt
mainmenu.containerTmbs["tmb" + i].bt.idInstance = i;
mainmenu.containerTmbs["tmb" + i].bt.onRelease = function () {
cursorArr = this.idInstance;
ZigoEngine.doTween (imageContainer,'_alpha',0,1,"easeOutExpo",0,function () {
loadBitmapSmoothed (imagesArr[cursorArr],imageContainer);
});
};
}
}
loadBitmapSmoothed (imagesArr[cursorArr],imageContainer);
intro ();
mainmenu.containerTmbs._y = 0 - mainmenu.containerTmbs.height / 2;
};
tmbs.load ("photoGallery.xml");
}
function updateMovies () {
d = 10;
mov = _root._ymouse;
coef = (Stage.height - (mainmenu.containerTmbs._height + 180)) / Stage.height;
mainmenu.containerTmbs._y -= (((mainmenu.containerTmbs._y-35) + Stage.height/2) - coef * mov) / d;
}
function initFloat (mc:MovieClip) {
temp = mc;
temp.onEnterFrame = this.updateMovies;
}
function loadBitmapSmoothed (url:String, target:MovieClip) {
var bmc:MovieClip = target.createEmptyMovieClip ("bmc", target.getNextHighestDepth ());
var listener:Object = new Object ();
listener.tmc = target;
listener.onLoadStart = function () {
attachMovie ("loaderMC","loaderMC",1);
loaderMC._x = Stage.width / 2;
loaderMC._y = Stage.height / 2;
};
listener.onLoadProgress = function (mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
//percent = Math.round (bytesLoaded / bytesTotal * 100);
//trace (percent);
};
listener.onLoadInit = function (mc:MovieClip) {
imageContainer._alpha = 0;
var bitmap:BitmapData = new BitmapData(mc._width, mc._height, true, 0);
this.tmc.attachBitmap(bitmap,1,"auto",true);
bitmap.draw(mc);
attachMovie ("clock","clock",1);
setPositions ();
};
var loader:MovieClipLoader = new MovieClipLoader ();
loader.addListener (listener);
loader.loadClip (url,bmc);
}
function loadMovieClip (externalTarget:String, targetRoot:MovieClip, action:String) {
var mcLoader:MovieClipLoader = new MovieClipLoader ();
var listenerLoad:Object = new Object ();
listenerLoad.onLoadStart = function (target:MovieClip) {
//trace("Thumbnails Load Start")
};
listenerLoad.onLoadProgress = function (target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
//*percent = Math.round(bytesLoaded/bytesTotal*100);
//trace("Thumbnails Load Progress")
};
listenerLoad.onLoadComplete = function (target:MovieClip):Void {
//trace("Thumbnails Load Complete")
};
mcLoader.addListener (listenerLoad);
mcLoader.loadClip (externalTarget,targetRoot);
}