I also have another button inside one of the windows and i am getting 1120 errors.
Printable View
I also have another button inside one of the windows and i am getting 1120 errors.
ps. the button inside the windows has to close the window ones you click it, its part of the navigation like the rest of the windows, but you click products then this button is on the products window
does what I said make sense =p?
can anyone help me? I need to get this done soon.
Okay, Ignore the scale idea.
I just need to fixed the problem with my button that is in one of the windows that loads.
Please help asap!! :X
Hey FrozenGecko- you may want to check out greensock's work. The designer has an amazing set of tweening & timeline engines that make it very simple to do the transparency stuff. For the tween & timeline check out http://blog.greensock.com/v11beta/ for just the tween engine check out http://blog.greensock.com/tweenmaxas3/
They come with a couple of swf's that even write the code for you. If you need any help with it just google it the code is every where.
Heya Jasondefra!
Nice and simple code you have there. I was getting it working on a site of mine and though it seems simple I just can't get a response from the buttons. I've checked my instance names, nesting and such. I just can't see it. If you have any insight for me I would be eternally grateful. I had event listeners for a few buttons with ROLL_OVER, ROLL_OUT, CLICK, MOUSE_DOWN, MOUSE_UP and none of them respond. Cheers!
me code:
Man I hope I did that right...Its a bit long.Code:addEventListener(MouseEvent.CLICK, onCLICK,false,0,true);
addEventListener(MouseEvent.MOUSE_OVER, overBTN,false,0,true);
addEventListener(MouseEvent.MOUSE_OUT, outBTN,false,0,true);
addEventListener(MouseEvent.MOUSE_DOWN, downBTN,false,0,true);
addEventListener(MouseEvent.MOUSE_UP, upBTN,false,0,true);
var isTweening:Boolean=false;
function resetBool():void {
isTweening=false;
}
function onCLICK(e:MouseEvent):void {
if (!isTweening) {
isTweening=true;
switch (e.target) {
case homeOn_mc:
closeWindows();
TweenLite.to(homePage_mc,1,{alpha:1,overwrite:false, onComplete:resetBool});
break;
case whoWeAreOn_mc:
closeWindows();
TweenLite.to(whoWeArePage_mc,1,{alpha:1,overwrite:false, onComplete:resetBool});
break;
case makeAnAppointmentOn_mc:
closeWindows();
TweenLite.to(makeAnAppointmentPage_mc,1,{alpha:1,overwrite:false, onComplete:resetBool});
break;
case capabilitiesOn_mc:
// No onclick
break;
case newsOn_mc:
closeWindows();
TweenLite.to(newsPage_mc,1,{alpha:1,overwrite:false, onComplete:resetBool});
break;
default:
//do nothing
return;
} }
}
function overBTN(e:MouseEvent):void {
//if (!isTweening) {
//isTweening=true;
switch (e.target) {
case homeOn_mc:
var homeOverTimeline:TimelineMax = new TimelineMax();
homeOverTimeline.insertMultiple( [ TweenMax.to(homeOn_mc, 0, {tint:0xff9900, onComplete:resetBool}), TweenMax.to(homeOn_mc, 0, {blurFilter:{blurX:3, blurY:3, quality:1}, onComplete:resetBool})], homeOverTimeline.duration );
homeOverTimeline.play();
break;
case whoWeAreOn_mc:
var whoWeAreOverTimeline:TimelineMax = new TimelineMax();
whoWeAreOverTimeline.insertMultiple( [ TweenLite.to(whoWeAreOn_mc, 0, {tint:0xff9900}), TweenMax.to(whoWeAreOn_mc, 0, {blurFilter:{blurX:3, blurY:3, quality:1}, onComplete:resetBool})], whoWeAreOverTimeline.duration);
whoWeAreOverTimeline.play();
break;
case makeAnAppointmentOn_mc:
var makeAnAppointmenOverTimeline:TimelineMax = new TimelineMax();
makeAnAppointmenOverTimeline.insertMultiple( [ TweenLite.to(makeAnAppointmentOn_mc, 0, {tint:0xff9900}), TweenMax.to(makeAnAppointmentOn_mc, 0, {blurFilter:{blurX:3, blurY:3, quality:1}, onComplete:resetBool}) ], makeAnAppointmenOverTimeline.duration);
makeAnAppointmenOverTimeline.play();
break;
case capabilitiesOn_mc:
var capabilitiesOverTimeline:TimelineMax = new TimelineMax();
capabilitiesOverTimeline.append( TweenMax.to(capabilitiesOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1, remove:true}, onComplete:resetBool}) );
capabilitiesOverTimeline.append( TweenLite.to(capabilitiesMenu_mc, 0, { autoAlpha:1, onComplete:resetBool}) );
capabilitiesOverTimeline.play();
break;
case capabilitiesMenu_mc:
var capabilitiesMenuOverTimeline:TimelineMax = new TimelineMax();
capabilitiesMenuOverTimeline.append( TweenMax.to(capabilitiesOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1, remove:true}}) );
capabilitiesMenuOverTimeline.append( TweenLite.to(capabilitiesMenu_mc, 0, { autoAlpha:1, onComplete:resetBool}) );
capabilitiesMenuOverTimeline.play();
break;
case newsOn_mc:
var newsOverTimeline:TimelineMax = new TimelineMax();
newsOverTimeline.insertMultiple( [ TweenLite.to(newsOn_mc, 0, {tint:0xff9900}), TweenMax.to(newsOn_mc, 0, {blurFilter:{blurX:3, blurY:3, quality:1}, onComplete:resetBool})], newsOverTimeline.duration);
newsOverTimeline.play();
break;
default:
//do nothing
return;
} //}
}
function outBTN(e:MouseEvent):void {
//if (!isTweening) {
// isTweening=true;
switch (e.target) {
case homeOn_mc:
var homeOutTimeline:TimelineMax = new TimelineMax();
homeOutTimeline.insertMultiple( [ TweenMax.to(homeOn_mc, 0, {blurFilter:{blurX:3, blurY:3, quality:1, remove:true}}), TweenLite.to(homeOn_mc, 0, {removeTint:true, onComplete:resetBool})], homeOutTimeline.duration);
homeOutTimeline.play();
break;
case whoWeAreOn_mc:
var whoWeAreOutTimeline:TimelineMax = new TimelineMax();
whoWeAreOutTimeline.insertMultiple( [ TweenLite.to(whoWeAreOn_mc, 0, {removeTint:true}), TweenMax.to(whoWeAreOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1, remove:true}, onComplete:resetBool})], whoWeAreOutTimeline.duration);
whoWeAreOutTimeline.play();
break;
case makeAnAppointmentOn_mc:
var makeAnAppointmentOutTimeline:TimelineMax = new TimelineMax();
makeAnAppointmentOutTimeline.insertMultiple( [ TweenLite.to(makeAnAppointmentOn_mc, 0, {removeTint:true}), TweenMax.to(makeAnAppointmentOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1, remove:true}, onComplete:resetBool}) ], makeAnAppointmentOutTimeline.duration);
makeAnAppointmentOutTimeline.play();
break;
case capabilitiesOn_mc:
var capabilitiesOutTimeline:TimelineMax = new TimelineMax();
capabilitiesOutTimeline.insertMultiple( [ TweenLite.to(capabilitiesOn_mc, 0, {removeTint:true}), TweenMax.to(capabilitiesOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1, remove:true}, onComplete:resetBool}) ], capabilitiesOutTimeline.duration );
capabilitiesOutTimeline.play();
break;
case newsOn_mc:
var newsOutTimeline:TimelineMax = new TimelineMax();
newsOutTimeline.insertMultiple( [ TweenLite.to(newsOn_mc, 0, {removeTint:true}), TweenMax.to(newsOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1, remove:true}, onComplete:resetBool}) ], newsOutTimeline.duration);
newsOutTimeline.play();
break;
default:
//do nothing
return;
} //}
}
function downBTN(e:MouseEvent):void {
//if (!isTweening) {
// isTweening=true;
switch (e.target) {
case homeOn_mc:
var homeDownTimeline:TimelineMax = new TimelineMax();
homeDownTimeline.append( TweenMax.to(homeOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1}, onComplete:resetBool}) );
homeDownTimeline.play();
break;
case whoWeAreOn_mc:
var Timeline:TimelineMax = new TimelineMax();
Timeline.append( TweenMax.to(whoWeAreOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1}, onComplete:resetBool}) );
Timeline.play();
break;
case makeAnAppointmentOn_mc:
var makeAnAppointmentDownTimeline:TimelineMax = new TimelineMax();
makeAnAppointmentDownTimeline.append( TweenMax.to(makeAnAppointmentOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1}, onComplete:resetBool}) );
makeAnAppointmentDownTimeline.play();
break;
case capabilitiesOn_mc:
// no Mouse_Down
break;
case newsOn_mc:
var newsDownTimeline:TimelineMax = new TimelineMax();
newsDownTimeline.append( TweenMax.to(newsOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1}, onComplete:resetBool}) );
newsDownTimeline.play();
break;
default:
//do nothing
return;
} //}
}
function upBTN(e:MouseEvent):void {
//if (!isTweening) {
// isTweening=true;
switch (e.target) {
case homeOn_mc:
var homeUpTimeline:TimelineMax = new TimelineMax();
homeUpTimeline.append( TweenMax.to(homeOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1, remove:true}, onComplete:resetBool}) );
homeUpTimeline.play();
break;
case whoWeAreOn_mc:
var whoWeAreUpTimeline:TimelineMax = new TimelineMax();
whoWeAreUpTimeline.append( TweenMax.to(whoWeAreOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1, remove:true}, onComplete:resetBool}) );
whoWeAreUpTimeline.play();
break;
case makeAnAppointmentOn_mc:
var makeAnAppointmentUpTimeline:TimelineMax = new TimelineMax();
makeAnAppointmentUpTimeline.append( TweenMax.to(makeAnAppointmentOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1, remove:true}, onComplete:resetBool}) );
makeAnAppointmentUpTimeline.play();
break;
case capabilitiesOn_mc:
// no Mouse_up
break;
case newsOn_mc:
var newsUpTimeline:TimelineMax = new TimelineMax();
newsUpTimeline.append( TweenMax.to(newsOn_mc, 0, {blurFilter:{blurX:8, blurY:8, quality:1, remove:true}, onComplete:resetBool}) );
newsUpTimeline.play();
break;
default:
//do nothing
return;
} //}
}
function closeWindows():void{
//for each of these ifs we're looking for the object that is currently
//being displayed (we know this because it's alpha will be equal to 1)
//and then tweening its alpha property down to 0 over 1 second
if(homePage_mc.alpha==1) { TweenLite.to(homePage_mc,1,{alpha:0}); }
else if(whoWeArePage_mc.alpha==1) { TweenLite.to(whoWeArePage_mc,1,{alpha:0}) }
else if(makeAnAppointmentPage_mc.alpha==1) { TweenLite.to(makeAnAppointmentPage_mc,1,{alpha:0}) }
else if(newsPage_mc.alpha==1) { TweenLite.to(newsPage_mc,1,{alpha:0}) }
}
The stuff thats //'ed out just cause I was desperately testing everything. I'm really new at this too so I hope that code is not too embarassing.