### Re: [Flashcoders] understanding a simpe statement 2

```
Hi Isaac,

http://snipplr.com/view/15019/shorthand-code-for-assigning-a-value/

Cheers,

Sidney de Koning

On Jul 13, 2009, at 4:06 PM, Isaac Alves wrote:

I would like to understand that one too:

maxH = maxH == 0 ? maxW : maxH;

Thanks!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Sidney de Koning - be a geek, in rockstar style!
Flash / AIR Developer @ www.funky-monkey.nl
Technical Writer @ www.insideria.com

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

```

### [Flashcoders] understanding a simpe statement 2

```I would like to understand that one too:

maxH = maxH == 0 ? maxW : maxH;

Thanks!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

```

### [Flashcoders] understanding a simpe statement

```Hello fellows.

I know it probably sounds dumb , but I'm having a hard time understanding
this statement

mc.scaleX  mc.scaleY ? mc.scaleY = mc.scaleX : mc.scaleX = mc.scaleY;

Would that mean something like:

if (mc.scaleX  mc.scale){
mc.scaleY = mc.scaleX
} else if if (mc.scaleX  mc.scale){
mc.scaleX = mc.scaleY;
}

?
Thanks!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

```

### RE: [Flashcoders] understanding a simpe statement 2

```If maxH is equal to 0 then set maxH to maxW else to maxH.

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Isaac Alves
Sent: maandag 13 juli 2009 16:06
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] understanding a simpe statement 2

I would like to understand that one too:

maxH = maxH == 0 ? maxW : maxH;

Thanks!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

```

### Re: [Flashcoders] understanding a simpe statement 2

```
Hi,

They are both statements using the ternary operator - you had the
right idea in your prevouse email.

Basically it reads (If the condition before the qestion mark is
true) ? do this : otherwise do that;

It is often better to write out your ternary statement with brackets
because it helps make it a bit clearer.

Something like this:

maxH = (maxH == 0) ? maxW : maxH;

Glen

Isaac Alves wrote:

I would like to understand that one too:

maxH = maxH == 0 ? maxW : maxH;

Thanks!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

```

### RE: [Flashcoders] understanding a simpe statement

```if (mc.scaleX  mc.scale){
mc.scaleY = mc.scaleX
} else{
mc.scaleX = mc.scaleY;
}

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Isaac Alves
Sent: maandag 13 juli 2009 16:04
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] understanding a simpe statement

Hello fellows.

I know it probably sounds dumb , but I'm having a hard time understanding
this statement

mc.scaleX  mc.scaleY ? mc.scaleY = mc.scaleX : mc.scaleX = mc.scaleY;

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

```