Make the code shorter?

Hello everyone^^
It’s my first post here, and my english is not very good, so I’m a bit stressed ^^. I hope I post in the good section.

Well. It’s not really about a problem that I ask, it’s just that I ask me some questions about how to mak some actionscripts shorter and more smart maybe.

I wonder if tere is a way to write shorter:

Mc.onRollOver = function() {
blahblahblah...}
Mc.onRollOut = function() {
nanananananana....}
titleMc.onPress = function() {
lalalalalalalala....}

btw: I discovered a few time ago,

that if(....){
blahblahblah...}

could be written a shorter way, but I can’t find the syntax no more :wink:

Hope you can help me growing as a lil coder… ^^

~H~

er…
If you don’t know, you can say just “Hi” ^^ …

Helga

bonjour and welcome,
if blahblahblah, nannanannanana and lalalallalalal are all the same script then yes there is a way make it shorter

function everything() {
blah
nana
lala
...
}

Mc.onRollOver = everything;
Mc.onRollOut = everything;
titleMc.onPress = everything;

if not, then what you are doing cant be made any shorter
i hope this helps

and btw about that if question you had, have a look at this:
http://www.kirupa.com/developer/actionscript/tricks/tertiary.htm

Hi^^
Thank you both for the effort on speaking my language and for your helpfull answer.
Unfortunatly, blah, nana, & lala (lol…so stupid…lol) aren’t the same script. I guess what I’m looking for doesn’t exist.
The link you gave me is just great ! thank you ! I’ve been looking for it for a long time. So, it’s called “tertiary operator”. Won’t forget it this time :wink:
Thank you so much (^.^).

Have a Nice day, David
Helga