Getting sleepy, working out bugs.
I have a beta site in which there are two gallery pages set up so far, "FOR CHAINS" and "FOR OBJECTS":
http://thomasleargrace.com/new/
The pages navigate from one another just fine, but if you attempt to re-navigate mid-sequence, then it get's f'd. The sequence goes from a text box appearing, sliding down the page, and then a gallery appearing.
I'v tried a few things that you'll see in my code here, but they don't work because of how the functions call to proceeding functions.
Basically, I need the click to include a kill for the function that calls to the other gallery: function playChainGallery and playObjectsGallery (these are the last functions in each sequence.
BTW: I bet there are some ways of working this using TimelineMax. Hmmmm....
This should be a fun one to work out
This is the CLICK sequence:
/*Chains*/
hitZone1.addEventListener(MouseEvent.CLICK, navClick2);
/*Objects*/
hitZone2.addEventListener(MouseEvent.CLICK, navClick3);
/*Chains*/
function chainsGalleryFade(evt:Event):void {
chainsGallery.gotoAndStop(1);
}
function navClick3(evt:Event):void {
if (textBox1.alpha>=.01) {
TweenMax.to(chainsGallery, .5, {alpha:0, ease:Linear.easeNone, onCompleteListener: chainsGalleryFade, overwrite:2});
TweenMax.to(textBox1, .5, {alpha:0, ease:Linear.easeNone, overwrite:2});
TweenMax.to(chainContent, .5, {alpha:0, ease:Linear.easeNone, overwrite:2});
}
if (objectsGallery.alpha==1) {
} else {
TweenMax.fromTo(objectsContent, .20, {y:283},{y:233.6, ease:Cubic.easeOut});
TweenMax.fromTo(textBox2, .20, {y:283},{y:238.8, ease:Cubic.easeOut});
TweenMax.to(textBox2, .25, {alpha:.8, startAt:{alpha:0}, ease:Linear.easeNone});
TweenMax.from(textBox2, 1, {scaleY:.01, startAt:{xscaleY:1}, blurFilter:{blurY:40}, ease:Cubic.easeOut});
TweenMax.to(objectsContent, 1, {delay:.4, alpha:1, startAt:{alpha:0}, ease:Linear.easeNone, onCompleteListener: enterObjectsGallery});
}
}
function enterChainGallery(evt:Event):void {
TweenMax.to(textBox1, 2, {delay:3, y:705, startAt:{y:238.8}, ease:Cubic.easeInOut});
TweenMax.to(chainContent, 2, {delay:3, y:700, startAt:{y:233.6}, ease:Cubic.easeInOut, onCompleteListener: playChainGallery});
}
function playChainGallery(evt:Event):void {
chainsGallery.gotoAndPlay(2);
TweenMax.to(chainsGallery, 1, {alpha:1, ease:Linear.easeNone});
}
/*Objects*/
function chainsGalleryFade(evt:Event):void {
chainsGallery.gotoAndStop(1);
}
function navClick3(evt:Event):void {
if (textBox1.alpha>=.01) {
TweenMax.to(chainsGallery, .5, {alpha:0, ease:Linear.easeNone, onCompleteListener: chainsGalleryFade, overwrite:2});
TweenMax.to(textBox1, .5, {alpha:0, ease:Linear.easeNone, overwrite:2});
TweenMax.to(chainContent, .5, {alpha:0, ease:Linear.easeNone, overwrite:2});
}
if (objectsGallery.alpha==1) {
} else {
TweenMax.fromTo(objectsContent, .20, {y:283},{y:233.6, ease:Cubic.easeOut});
TweenMax.fromTo(textBox2, .20, {y:283},{y:238.8, ease:Cubic.easeOut});
TweenMax.to(textBox2, .25, {alpha:.8, startAt:{alpha:0}, ease:Linear.easeNone});
TweenMax.from(textBox2, 1, {scaleY:.01, startAt:{xscaleY:1}, blurFilter:{blurY:40}, ease:Cubic.easeOut});
TweenMax.to(objectsContent, 1, {delay:.4, alpha:1, startAt:{alpha:0}, ease:Linear.easeNone, onCompleteListener: enterObjectsGallery});
}
}
function enterObjectsGallery(evt:Event):void {
TweenMax.to(textBox2, 2, {delay:3, y:705, startAt:{y:238.8}, ease:Cubic.easeInOut});
TweenMax.to(objectsContent, 2, {delay:3, y:700, startAt:{y:233.6}, ease:Cubic.easeInOut, onCompleteListener: playObjectsGallery});
}
function playObjectsGallery(evt:Event):void {
objectsGallery.gotoAndPlay(2);
TweenMax.to(objectsGallery, 1, {alpha:1, ease:Linear.easeNone});
}
Thanks for any help!