CS3 / AS3 quetsions

I’m taking a new approach on trying to figure Flash out (i’m clearly new at this). I got a list going of all the things that i want to do with a website i am working, and i’m just going to ask them all here in one thread so anyone who knows how to and is interested in giving me a little help, can answer. i’ll be on the hunt for the answers to these questions, but i figured that this would be a good place to start since you guys helped me out a lot so far.

a little background. i’m using Flash CS3 and AS3 (i’m slowing learning AS3). i am putting together a website. I have a background layer, actions layer, and contents layer. the contents layer is divided into 8 “pages” marked by keyframes. as of now (this number will be going up soon) so here we go, i want to know how to…

  1. have reoccurring animations/swfs on each web page. for example: I want to have an opening text box that opens each time the user is directed to a new page and there is new text. (i made the animation as a movie clip, saved a as a swf and imported into the project)

  2. have “random” blinking squares in the background of the entire site, on very page, at all times.

  3. have boxes that seem to be unfolding, or “growing” onto the page. my problem here is, i made the boxes, use a mask over them, but the number of frames for the mask is more then the number of frames alloted in the contents timeline. is there any way to make it in a separate file, save and import it into the main site file? will there be a transparent background so it can be laid on top of the main background?

  4. how to make an image expand on mouse roll over

  5. how to make an image/button change color when a separate object is moused over.

  6. how to make an infinite slide show, or a panel of images that when i have the cursor on the right side, the images slide to the left, and vice versa.

  7. how to make an e-mail form.

i know its a lot, and i would greatly appreciate anything you guys have to help me out. thanks in advance!!

Here’s my 2¢, based on my own experience learning Flash.

Start by forgetting about frame-based navigation and timeline tweens.
They’re nice for absolute newcomers to Flash, but they will only serve to overly complicate your project.
You’ll outgrow this method of building Flash projects very quickly.
You’ll be grateful if you don’t have too many klunky starter projects to rebuild.

Everything you’ve listed here can be done easily with a single actionscript on frame1 of the timeline, without frame labels, and without nested timeline tweens.
Simply stack your objects on frame1 using layers to help you manage the objects.

stop();
import gs.TweenMax;
import fl.motion.easing.*;

/*------------------------------------------------------------------------------------------------------------
fla setup instructions:
this script goes on frame1, layer "actions"
"pageGroup" is movieclip wrapper for movieclips "page1" "page2" "page3" - frame1, layer "pageGroup"
"buttonGroup" is movieclip wrapper for movieclip buttons "btn1" "btn2" "btn3" - frame1, layer "buttonGroup"
frame-based naviagation is not necessary for this setup
------------------------------------------------------------------------------------------------------------*/
buttonGroup.mouseEnabled = false;
buttonGroup.buttonMode = true;
buttonGroup.addEventListener(MouseEvent.MOUSE_OVER, action, false, 0, true);
buttonGroup.addEventListener(MouseEvent.MOUSE_OUT, action, false, 0, true);
buttonGroup.addEventListener(MouseEvent.CLICK, action, false, 0, true);

var pageArray:Array = [pageGroup.page1, pageGroup.page2, pageGroup.page3];
TweenMax.allTo(pageArray, 0, {autoAlpha:0, onCompleteAll:loadHome, overwrite:false});

function loadHome():void {
	TweenMax.to(pageGroup.page1, .4, {delay:.4, autoAlpha:1});
}

var button:String = "";

function action(event:MouseEvent):void {
	button = event.target.name;
	switch (event.type) {
		case MouseEvent.MOUSE_OVER :
			TweenMax.to(event.target, .8, {scaleX:1.3, scaleY:1.3, ease:Elastic.easeOut});
			break;
		case MouseEvent.MOUSE_OUT :
			TweenMax.to(event.target, .8, {scaleX:1, scaleY:1, ease:Cubic.easeOut});
			break;
		case MouseEvent.CLICK :
			TweenMax.to(event.target, .4, {scaleX:1, scaleY:1, ease:Cubic.easeOut});
			TweenMax.allTo(pageArray, .4, {autoAlpha:0, overwrite:false});
			switch (button) {
				case "btn1" :
					TweenMax.to(pageGroup.page1, .4, {delay:.4, autoAlpha:1});
					break;
				case "btn2" :
					TweenMax.to(pageGroup.page2, .4, {delay:.4, autoAlpha:1});
					break;
				case "btn3" :
					TweenMax.to(pageGroup.page3, .4, {delay:.4, autoAlpha:1});
					break;
			}
			break;
	}
}

To illustrate a simple sliding-imagepanel-thingamabob, using the buttonGroup from the previous script as the target.
(replace the buttonGroup with a movieclip full of images or whatever)

The horizontal center coordinate of “buttonGroup” on-stage = 50.
[COLOR=“Blue”]if[/COLOR] the mouse cursor is left of center ([COLOR=“blue”]<50[/COLOR]), buttonGroup slides to the right (toward [COLOR=“blue”]x:200[/COLOR]).
[COLOR=“Blue”]else if[/COLOR] the mouse cursor is right of center ([COLOR=“blue”]>50[/COLOR]), buttonGroup slides to the left (toward [COLOR=“blue”]x:-200[/COLOR]).
Since this script is using a tweening class, you can easily add other transformations or translations to any object you choose.

stage.addEventListener(MouseEvent.MOUSE_MOVE, panButtonGroup, false, 0, true);
function panButtonGroup(evt:MouseEvent):void {
	if (mouseX < 50) {
		TweenMax.to(buttonGroup, 10, {x:200});
	} else if (mouseX > 50) {
		TweenMax.to(buttonGroup, 10, {x:-200});
	}
}