Package and Reusable Classes

I’m really trying to learn packages and reusable classes.

What I have currently is an .fla with two buttons (btn1 and btn2) and three other movie clips: square, circle, polygon.

My goal is to have all the animations for square, circle and polygon reside in one function. I then want the buttons to decide which movie clip(s) to animate based on some type of association with those movie clips.

Here is my code (not pretty or functional at this point)

package testpackages { 
	import caurina.transitions.Tweener
	import flash.display.MovieClip;
    import flash.events.MouseEvent;
	
    public class TestNav {
        //private var _clip:MovieClip;
		private var _btn1:MovieClip;
		private var _btn2:MovieClip;
		private var _circle:MovieClip;
		private var _square:MovieClip;
		private var _polygon:MovieClip;
		
        public function TestNav(btn2:MovieClip,btn1:MovieClip,circle:MovieClip,square:MovieClip) {
			 
			 _btn1 = btn1;
			 _btn2 = btn2;
			 _circle = circle;
			 _square = square;
			 _polygon = polygon;
			
            _btn1.addEventListener(MouseEvent.MOUSE_OVER, scaleElementUp);
            _btn1.stage.addEventListener(MouseEvent.MOUSE_OUT, scaleElementNormal);
			
			_btn2.addEventListener(MouseEvent.MOUSE_OVER, scaleElementUp);
            _btn2.stage.addEventListener(MouseEvent.MOUSE_OUT, scaleElementNormal);

        }
		
        private function scaleElementUp(event:MouseEvent) {
			
			Tweener.addTween(_circle, {scaleX:2, scaleY:2, alpha:1, time:1.5, delay:0, transition:"easeOutExpo"});
			Tweener.addTween(_square, {scaleX:2, scaleY:2, alpha:1, time:1.5, delay:0, transition:"easeOutExpo"});
			Tweener.addTween(_polygon, {scaleX:2, scaleY:2, alpha:1, time:1.5, delay:0, transition:"easeOutExpo"});
		}
		
        private function scaleElementNormal(event:MouseEvent) {
			Tweener.addTween(_circle, {scaleX:1, scaleY:1, alpha:0.3, time:0.5, delay:0, transition:"easeInOutExpo"});
			Tweener.addTween(_square, {scaleX:1, scaleY:1, alpha:0.3, time:0.5, delay:0, transition:"easeInOutExpo"});
			Tweener.addTween(_polygon, {scaleX:1, scaleY:1, alpha:0.3, time:0.5, delay:0, transition:"easeInOutExpo"});
        }

For example, btn1 could refrence only the animations that have _circle in the tweener code for the MOUSE_OVER and MOUSE_OUT functions.

btn2 could refrence only the animations that have both _square and _polygon in the tweener code…

Here the code I have in frame 1 of the .fla:

import testpackages.TestNav;

var myVar1:TestNav = new TestNav(btn1,circle);
var myVar2:TestNav = new TestNav(btn2,square,polygon);

I’d like to get away from having any code in the .fla itself, other than the import function…

Thank you
Damon