Here’s a quick’n’dirty method that does the basic navigation trick.
example:[COLOR=“Blue”][U]http://www.byrographics.com/AS3/calendar/calendar.html[/U][/COLOR]
Generating the graphics in a loop would probably be a better approach, though.
The popups could be easily be done using a single movieclip linked to a set of external text files or XML file.
The popup, (which would be located within the schedule movieclip to use the local coordinates for the event targets) would simply move to coordinates relative to the event.target on click.
ie: popup.x = event.target.x
stop();
import gs.TweenMax;
import fl.motion.easing.*;
import flash.display.StageScaleMode;
import flash.display.StageAlign;
import flash.events.Event;
stage.scaleMode = StageScaleMode.NO_SCALE;
buttonGroup.mouseEnabled = false;
buttonGroup.buttonMode = true;
buttonGroup.addEventListener(MouseEvent.CLICK, action, false, 0, true);
buttonGroup.addEventListener(MouseEvent.MOUSE_OVER, action, false, 0, true);
buttonGroup.addEventListener(MouseEvent.MOUSE_OUT, action, false, 0, true);
var button:String = "";
function action(event:MouseEvent):void {
button = event.target.name;
switch (event.type) {
case MouseEvent.MOUSE_OVER :
buttonGroup.setChildIndex(event.target as MovieClip, buttonGroup.numChildren-1);
TweenMax.to(event.target, .8, {scaleX:1.2, scaleY:1.2, dropShadowFilter:{color:0x000000, alpha:0.5, blurX:8, blurY:8, angle:45, distance:0}, ease:Elastic.easeOut});
break;
case MouseEvent.MOUSE_OUT :
TweenMax.to(event.target, .4, {scaleX:1, scaleY:1, dropShadowFilter:{color:0x000000, alpha:0, blurX:0, blurY:0, angle:45, distance:0}, ease:Cubic.easeOut});
break;
case MouseEvent.CLICK :
switch (button) {
case "btn1" :
TweenMax.to(schedule, 1, {x:150, ease:Cubic.easeInOut});
break;
case "btn2" :
TweenMax.to(schedule, 1, {x:-310, ease:Cubic.easeInOut});
break;
case "btn3" :
TweenMax.to(schedule, 1, {x:-770, ease:Cubic.easeInOut});
break;
case "btn4" :
TweenMax.to(schedule, 1, {x:-1230, ease:Cubic.easeInOut});
break;
case "btn5" :
TweenMax.to(schedule, 1, {x:-1690, ease:Cubic.easeInOut});
break;
}
break;
}
}