Hi,
I have the following code which I need to call it again and again. How can I create a function which can be called in another function.
MainContainer.EHSSNav.Area.addEventListener(MouseEvent.CLICK,AreaClickHandler);
function AreaClickHandler(event:MouseEvent):void {
TweenLite.to(MainContainer.OrganizationNav, 0.5, {alpha:0});
TweenLite.to(MainContainer.ScheduleNav, 0.5, {alpha:0});
TweenLite.to(MainContainer.FormsNav, 0.5, {alpha:0});
TweenLite.to(MainContainer.EHSSNav, 0.5, {y:440});
TweenLite.to(MainContainer.OrganizationNav, 0.5, {y:440});
TweenLite.to(MainContainer.ScheduleNav, 0.5, {y:440});
TweenLite.to(MainContainer.FormsNav, 0.5, {y:440});
navigateToURL (new URLRequest ("http://MyServer/info/Docs/Area.pdf"));}
MainContainer.Logistic.addEventListener(MouseEvent.CLICK,LogisticClickHandler);
function LogisticClickHandler(event:MouseEvent):void {
TweenLite.to(MainContainer.OrganizationNav, 0.5, {alpha:0});
TweenLite.to(MainContainer.ScheduleNav, 0.5, {alpha:0});
TweenLite.to(MainContainer.FormsNav, 0.5, {alpha:0});
TweenLite.to(MainContainer.EHSSNav, 0.5, {y:440});
TweenLite.to(MainContainer.OrganizationNav, 0.5, {y:440});
TweenLite.to(MainContainer.ScheduleNav, 0.5, {y:440});
TweenLite.to(MainContainer.FormsNav, 0.5, {y:440});
navigateToURL (new URLRequest ("http://MyServer/info/Docs/Logistic.pdf"));}
I need to call the following code several times, so how can I avoid it using one function and calling it another functions?
TweenLite.to(MainContainer.OrganizationNav, 0.5, {alpha:0});
TweenLite.to(MainContainer.ScheduleNav, 0.5, {alpha:0});
TweenLite.to(MainContainer.FormsNav, 0.5, {alpha:0});
TweenLite.to(MainContainer.EHSSNav, 0.5, {y:440});
TweenLite.to(MainContainer.OrganizationNav, 0.5, {y:440});
TweenLite.to(MainContainer.ScheduleNav, 0.5, {y:440});
TweenLite.to(MainContainer.FormsNav, 0.5, {y:440});
Please help.