PDA

View Full Version : Actionscript 2.0-3.0 Assistance



gdizzy15
01-02-2010, 05:24 PM
So me and a fellow animator from school are doing a collab for a contest at school and we need to pull it off with a bang. I am in charge of parts 2 and 4 of our video as well as the credits and start menu so I was asking for Action script assistance for Adobe flash pro CS3. If it is ok with our direct you name will go in our credits for encoding assistance.

What I am asking for is a DVD like menu for our animation sort of like the in the game Die in Style (featured on Stickpage.com).
Can any one help? I need to get this done within 2-3 weeks.

I haven't been on here in almost 2 years perfecting my art.....If you would like to see the ENTIRE animation..let me know and I will SEND it to you...AFTER the competition......Much later..we don't want a dispute....

Scorpioxxx
01-02-2010, 05:39 PM
Wait, so specifically are you using AS2 or AS3 and do you have the art done or is that needed as well?

Plus, I'm sure if you only need buttons to go to set points you could find the answer on google and save yourself relying on someone that is out-with this contest.

CGIllusion
01-02-2010, 06:23 PM
Ah menu systems are a bitch. I've been messing around with it for a bit for a game.. what I've got so far is a custom button class that simplifies everything. It handles all events, all you have to do is create it in your code and pass as parameters (up_image, over_image, function_to_execute).

I could post it up if that's what you need. AS3 though.

gdizzy15
01-13-2010, 02:26 PM
That would be nice and yah I have AS 3 because I have cs3 flash pro.
But its too late now but I would love to have it for a new project I'm working on. So if you could post it that be nice man.

CGIllusion
01-17-2010, 10:34 PM
First Code block is the .as file that you have to make. Second Code block is how to use this class in your code.




package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.geom.ColorTransform;

public class CustomButton extends MovieClip
{

var buttonGraphic:MovieClip;
var listener:Function;
var listener2:Function;

var color:ColorTransform = new ColorTransform();

public function CustomButton(_buttonGraphic:MovieClip, _x:Number, _y:Number, _listener:Function, _listener2:Function = null)
{
this.x = _x;
this.y = _y;
listener = _listener;
listener2 = _listener2; //To execute a 2nd function if needed, corresponding addevent and removeevent below.

buttonGraphic = _buttonGraphic;
addChild(buttonGraphic);

addEventListener(MouseEvent.MOUSE_OVER, handleMouseOver);
addEventListener(MouseEvent.MOUSE_OUT, handleMouseOut);
addEventListener(MouseEvent.MOUSE_DOWN, handleMouseDown);
addEventListener(MouseEvent.MOUSE_UP, handleMouseUp);
}

private function handleMouseUp(e:MouseEvent):void
{
listener();
if (listener2 != null) listener2();
}

private function handleMouseDown(e:MouseEvent):void
{
color.redMultiplier = 0.25;
color.blueMultiplier = 0.25;
color.greenMultiplier = 0.25;
buttonGraphic.transform.colorTransform = color;
}

private function handleMouseOver(e:MouseEvent):void
{
color.redMultiplier = 0.5;
color.blueMultiplier = 0.5;
color.greenMultiplier = 0.5;
buttonGraphic.transform.colorTransform = color;
}

private function handleMouseOut(e:MouseEvent):void
{
color.redMultiplier = 1;
color.blueMultiplier = 1;
color.greenMultiplier = 1;
buttonGraphic.transform.colorTransform = color;
}

public function deleteButton():void
{
removeEventListener(MouseEvent.MOUSE_OVER, handleMouseOver);
removeEventListener(MouseEvent.MOUSE_OUT, handleMouseOut);
removeEventListener(MouseEvent.MOUSE_DOWN, handleMouseDown);
removeEventListener(MouseEvent.MOUSE_UP, handleMouseUp);
MovieClip(parent).removeChild(this);
}

}

}






The below is all you need to add to ur code to make a button. 1st parameter is button image, then x and y, and then a function to be executed in your current location in your code. If you want to delete the button you will have to do upgrade.deleteButton(); somewhere in your code, or stick it in one of the handlers.



var upgrade:CustomButton = new CustomButton(new btn_upgrade(),640,450, executeUpgrade);
addChild(upgrade);


Hope it's understandable I just copy pasted from my code here.

gdizzy15
01-18-2010, 11:32 AM
O.o

Looks a little tough.....
could you explain a little more?
And also what are the simple action scrpit commands for having a frame advance?

Like if on one part of the movie, I want the person to stop and chose which way he or she wants to go.