Hi
I have a nice working Galery function.
There is just one thing that drives me crazy.
If one of the button is clicked, the picture is loaded and the transition out/in is started.
I you click quick another button during the transition is still going on, it will stop at this point and the next will also go just until here.
I mean if you choose “Zoom” as mx.Transition, and you click another Button, when the zooming is at 75%, the next transition will also stop at 75%.
Example which I used as starting point can be seen -here- (the red one).
Is there a case sensitive way to say to flash something like: “don’t do anything else until the transition is finished”?
Main script
import mx.transitions.*;
var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success) {
if (success) {
var gallery = this.firstChild;
for (var i = 0; i<gallery.childNodes.length; i++) {
tArray.push(gallery.childNodes*.attributes.title);
picArray.push(gallery.childNodes*.attributes.source);
}
trace(picArray);
loader_mc.loadPic(picArray[0]);
} else {
title_txt.text = "Error!";
}
};
gallery_xml.load("gallery.xml");
//--------------------------------
var picArray:Array = new Array();
//--------------------------------
MovieClip.prototype.loadPic = function(pic) {
attachMovie("prel", "prel", getNextHighestDepth(), {_x:0, _y:50});
loader_mc.loadMovie(pic);
counter_mc = createEmptyMovieClip("c", getNextHighestDepth());
counter_mc.onEnterFrame = function() {
perc = Math.round((this._parent.loader_mc.getBytesLoaded()/this._parent.loader_mc.getBytesTotal())*100);
prel.perc_txt.text = "loading"+this._parent.perc;
if (this._parent.loader_mc.getBytesLoaded()>20 && this._parent.loader_mc.getBytesLoaded() == this._parent.loader_mc.getBytesTotal()) {
delete this.onEnterFrame;
prel.removeMovieClip();
this._parent.loader_mc._visible = false;
transIn();
}
};
};
function transIn():Void {
var myTM:TransitionManager = new TransitionManager(loader_mc);
myTM.startTransition({type:Squeeze, numStrips:0, direction:0, duration:0.6, shape:empty, startPoint:4, xSections:0, ySections:0, dimension:0, easing:easing.Strong.easeOut, shape:empty});
}
function transOut(pic:String):Void {
if (loader_mc.getBytesTotal() == 100) {
var myListener:Object = new Object();
myListener.allTransitionsOutDone = function() {
loadPic(pic);
};
var myTM:TransitionManager = new TransitionManager(loader_mc);
myTM.addEventListener("allTransitionsOutDone", myListener);
myTM.startTransition({type:Fade, numStrips:0, direction:1, duration:0.3, shape:empty, startPoint:4, xSections:0, ySections:0, dimension:0, easing:easing.Strong.easeOut, shape:empty});
} else {
loadPic(pic);
}
}
cur = 0;
nextb.onRelease = function() {
if (cur == picArray.length-1) {
cur = 0;
} else {
cur += 1;
}
transOut(picArray[cur]);
trace(picArray[cur]);
};
Buttons
for (var i = 1; i<=15; i++) {
var ref:MovieClip = this.NAVIX["button"+i];
ref.ID = i-1;
ref.onRollOver = function() {
if (this != _root.clicked) {
this.gotoAndStop("over");
}
};
ref.onRollOut = ref.onReleaseOutside=function () {
if (this != _root.clicked) {
this.gotoAndStop("normal");
}
};
ref.onRelease = function() {
if (this != _root.clicked) {
transOut(picArray[this.ID]);
cur = this.ID;
this.gotoAndStop("pressed");
_root.clicked.gotoAndStop("normal");
_root.clicked = this;
};}
}
stop();
Thanks for helping!