Be a Supporter!

The Flash 'Reg' Lounge

  • 2,130,509 Views
  • 64,794 Replies
New Topic Respond to this Topic
Doomsday-One
Doomsday-One
  • Member since: Oct. 28, 2005
  • Offline.
Forum Stats
Member
Level 10
Programmer
Response to The Flash 'Reg' Lounge 2010-02-26 16:38:15 Reply

At 2/25/10 07:32 PM, Deathcon7 wrote: I had the following:

if (boolean && function():Boolean)

Although the boolean was false, the function call was still being made.

Just tested with:

function test():Boolean {
	trace("function called");
	return false;
}
if (false && test()) ; //traces nothing when executed
//When the false in the 'if' statement is replaced with true, traces "function called"

I can't see what the problem is. Perhaps you should have another look at your code?

At 2/26/10 03:31 PM, dELtaluca wrote: hahahahaha. immense.

Heh, that's pretty novel.

And damn, my 'u' key on my keyboard has started to fall off. I hate it when that happens.


Doomsday-One, working on stuff better than preloaders. Marginally.

Archawn
Archawn
  • Member since: Sep. 9, 2007
  • Offline.
Forum Stats
Member
Level 27
Game Developer
Response to The Flash 'Reg' Lounge 2010-02-26 17:18:41 Reply

At 2/26/10 12:56 PM, Inglor wrote:
At 2/26/10 12:49 PM, zrb wrote: Today i learned what the ?: operator does.
I wrote a tutorial about that :) you can live perfectly fine not knowing what it does though

It avoids having to use pointless if/else statements to define variables, though, which is pretty damn useful.

Deathcon7
Deathcon7
  • Member since: Oct. 1, 2003
  • Offline.
Forum Stats
Member
Level 21
Writer
Response to The Flash 'Reg' Lounge 2010-02-26 17:51:20 Reply

At 2/26/10 04:38 PM, Doomsday-One wrote: ...

Thanks for the follow-up. I spoke to Gust last night and figured it out. I was blaming the issue on short circuiting but it was something else that happened to get resolved by nesting the conditional. To confirm, yah, short circuiting is go.

Sam
Sam
  • Member since: Oct. 1, 2005
  • Offline.
Forum Stats
Moderator
Level 19
Programmer
Response to The Flash 'Reg' Lounge 2010-02-26 18:09:18 Reply

At 2/26/10 05:18 PM, Archon68 wrote: It avoids having to use pointless if/else statements to define variables, though, which is pretty damn useful.

Further explain to a AS noob plz

Toast
Toast
  • Member since: Apr. 2, 2005
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to The Flash 'Reg' Lounge 2010-02-26 18:15:12 Reply

At 2/26/10 12:49 PM, zrb wrote: You learn things everyday

Today i learned what the ?: operator does.
I feel like an idiot for not knowing it earlier but better late than never :P

What have you learned today or this week ?

Also, did you know instead of doing num -= 1 you can just do num --?

I wrote a tutorial about that :) you can't live at all not knowing what it does though

ahhhh good old AS: Main

BBS Signature
meneldil
meneldil
  • Member since: May. 27, 2004
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to The Flash 'Reg' Lounge 2010-02-26 18:16:14 Reply

At 2/26/10 06:09 PM, Sam wrote:
At 2/26/10 05:18 PM, Archon68 wrote: It avoids having to use pointless if/else statements to define variables, though, which is pretty damn useful.
Further explain to a AS noob plz

Basically it's an expression like this:

logical_expression : return_this_value_if_true ? return_this_value_if_false

Example use:

var lightIsOn:Boolean = false;
trace(lightIsOn ? "It's bright in here." : "It's very dark. You are likely to be eaten by a grue...");
//will trace the second string

Indescriptive topic names have left me in despair!

meneldil
meneldil
  • Member since: May. 27, 2004
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to The Flash 'Reg' Lounge 2010-02-26 18:21:29 Reply

At 2/26/10 06:16 PM, meneldil wrote:
At 2/26/10 06:09 PM, Sam wrote:
At 2/26/10 05:18 PM, Archon68 wrote: It avoids having to use pointless if/else statements to define variables, though, which is pretty damn useful.
Further explain to a AS noob plz
Basically it's an expression like this:

logical_expression : return_this_value_if_true ? return_this_value_if_false

Forgive me and my lack of sleep. I meant:
logical_expression ? return_this_value_if_true : return_this_value_if_false


Indescriptive topic names have left me in despair!

zrb
zrb
  • Member since: Aug. 8, 2006
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to The Flash 'Reg' Lounge 2010-02-26 19:05:38 Reply

At 2/26/10 05:18 PM, Archon68 wrote: It avoids having to use pointless if/else statements to define variables, though, which is pretty damn useful.

Actually that's a very useful thing, I just turned around 10 lines of code into one thanks to that !


School Sux ! || As :Main || As3: Main || Animation: Main || Flash Tutorials ||

BBS Signature
zrb
zrb
  • Member since: Aug. 8, 2006
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to The Flash 'Reg' Lounge 2010-02-26 19:11:40 Reply

At 2/26/10 06:09 PM, Sam wrote: Further explain to a AS noob plz

Meneldil basically explained it, here's how you could used it in practice:

trace( SamsPosts>2000?"yes":"no") 
//ouput: yes

School Sux ! || As :Main || As3: Main || Animation: Main || Flash Tutorials ||

BBS Signature
Toast
Toast
  • Member since: Apr. 2, 2005
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to The Flash 'Reg' Lounge 2010-02-26 19:13:37 Reply

At 2/26/10 06:21 PM, meneldil wrote: Forgive me and my lack of sleep. I meant:
logical_expression ? return_this_value_if_true : return_this_value_if_false

it doesn't return any values. also, the latter should be "if not true" aka "else". "not true" is not equivalent to "false". so much for your "logical expressions"


BBS Signature
Archawn
Archawn
  • Member since: Sep. 9, 2007
  • Offline.
Forum Stats
Member
Level 27
Game Developer
Response to The Flash 'Reg' Lounge 2010-02-26 19:52:37 Reply

At 2/26/10 07:05 PM, zrb wrote:
At 2/26/10 05:18 PM, Archon68 wrote: It avoids having to use pointless if/else statements to define variables, though, which is pretty damn useful.
Actually that's a very useful thing, I just turned around 10 lines of code into one thanks to that !

I wasn't being sarcastic. It is very useful and I use it all the time.

WINDOWS XP
Windows XP deleted the Administrator account on my computer for some reason. Apparently the user account file is corrupt. WTF.

The worst part? It was the only Administrator account on my computer, and it reset itself to a limited account, so now I have absolutely no (easy) way of accessing Control Panel, my hard drive, or anything else that would possibly help me fix this.

What the fuck, Windows XP? You make me want to upgrade to Windows 7.

zrb
zrb
  • Member since: Aug. 8, 2006
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to The Flash 'Reg' Lounge 2010-02-26 20:06:38 Reply

At 2/26/10 07:52 PM, Archon68 wrote: I wasn't being sarcastic. It is very useful and I use it all the time.

My mistake, meant to quote Inglor.


School Sux ! || As :Main || As3: Main || Animation: Main || Flash Tutorials ||

BBS Signature
Archawn
Archawn
  • Member since: Sep. 9, 2007
  • Offline.
Forum Stats
Member
Level 27
Game Developer
Response to The Flash 'Reg' Lounge 2010-02-26 20:37:06 Reply

I am seriously considering buying Windows 7.

Innermike
Innermike
  • Member since: Sep. 11, 2009
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to The Flash 'Reg' Lounge 2010-02-26 20:42:22 Reply

At 2/26/10 08:37 PM, Archon68 wrote: I am seriously considering buying Windows 7.

Hmmm archon wherever would you get that idea from ? you seemed like a solid XP dude to me


nobody

Archawn
Archawn
  • Member since: Sep. 9, 2007
  • Offline.
Forum Stats
Member
Level 27
Game Developer
Response to The Flash 'Reg' Lounge 2010-02-26 20:48:58 Reply

At 2/26/10 08:42 PM, HDXmike wrote:
At 2/26/10 08:37 PM, Archon68 wrote: I am seriously considering buying Windows 7.
Hmmm archon wherever would you get that idea from ? you seemed like a solid XP dude to me

That was until Windows XP decided to randomly delete my Administrator Account. It just corrupted itself in the middle of me using it. How the hell does that even happen?

Archawn
Archawn
  • Member since: Sep. 9, 2007
  • Offline.
Forum Stats
Member
Level 27
Game Developer
Response to The Flash 'Reg' Lounge 2010-02-26 21:19:24 Reply

PHEW
I got everything back, except for my custom theme, which can be easily fixed. That was freakin' scary.

Coaly
Coaly
  • Member since: Aug. 11, 2004
  • Offline.
Forum Stats
Member
Level 23
Blank Slate
Response to The Flash 'Reg' Lounge 2010-02-26 21:23:35 Reply

At 2/26/10 09:19 PM, Archon68 wrote: I got everything back, except for my custom theme, which can be easily fixed. That was freakin' scary.

Good. That was a tense 2 hours for all of us.


BBS Signature
Toast
Toast
  • Member since: Apr. 2, 2005
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to The Flash 'Reg' Lounge 2010-02-26 21:31:59 Reply

At 2/26/10 09:23 PM, Coaly wrote:
At 2/26/10 09:19 PM, Archon68 wrote: I got everything back, except for my custom theme, which can be easily fixed. That was freakin' scary.
Good. That was a tense 2 hours for all of us.

I pooped a little.


BBS Signature
Archawn
Archawn
  • Member since: Sep. 9, 2007
  • Offline.
Forum Stats
Member
Level 27
Game Developer
Response to The Flash 'Reg' Lounge 2010-02-26 21:34:41 Reply

At 2/26/10 09:23 PM, Coaly wrote:
At 2/26/10 09:19 PM, Archon68 wrote: I got everything back, except for my custom theme, which can be easily fixed. That was freakin' scary.
Good. That was a tense 2 hours for all of us.

I'm so glad you care about me, Coaly. Your opinion valuable to me.

...
Starogre
Starogre
  • Member since: May. 8, 2004
  • Offline.
Forum Stats
Member
Level 18
Artist
Response to The Flash 'Reg' Lounge 2010-02-26 21:36:29 Reply

At 2/26/10 09:34 PM, Archon68 wrote:
At 2/26/10 09:23 PM, Coaly wrote:
At 2/26/10 09:19 PM, Archon68 wrote: I got everything back, except for my custom theme, which can be easily fixed. That was freakin' scary.
Good. That was a tense 2 hours for all of us.
I'm so glad you care about me, Coaly. Your opinion valuable to me.

...

this is pretty handy to me http://www.newegg.com/Product/Product.as px?Item=N82E16822136469&cm_re=external_h ardrive-_-22-136-469-_-Product


the events are merely fictional, written, directed, and acted out by all who create them

BBS Signature
Toast
Toast
  • Member since: Apr. 2, 2005
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to The Flash 'Reg' Lounge 2010-02-26 21:45:18 Reply

At 2/26/10 09:36 PM, Starogre wrote:
this is pretty handy to me http://www.newegg.com/Product/Product.as px?Item=N82E16822136469&cm_re=external_h ardrive-_-22-136-469-_-Product

this is pretty handy to me http://www.linux.org/

oh, what's that? 100 bucks for backup? no thanks. my computer doesn't have diarreah


BBS Signature
Farza
Farza
  • Member since: Sep. 17, 2009
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to The Flash 'Reg' Lounge 2010-02-26 21:53:11 Reply

54,999 post. Muahaha.


I am a FAB

BBS Signature
Archawn
Archawn
  • Member since: Sep. 9, 2007
  • Offline.
Forum Stats
Member
Level 27
Game Developer
Response to The Flash 'Reg' Lounge 2010-02-26 21:53:17 Reply

#55,000!

I WIN AGAIN.

Magical-Zorse
Magical-Zorse
  • Member since: May. 10, 2008
  • Offline.
Forum Stats
Supporter
Level 41
Melancholy
Response to The Flash 'Reg' Lounge 2010-02-26 22:04:08 Reply

At 2/26/10 09:53 PM, windowskiller wrote: 54,999 post. Muahaha.

Still doesn't beat my 49,999 post


BBS Signature
Kirk-Cocaine
Kirk-Cocaine
  • Member since: Aug. 17, 2003
  • Offline.
Forum Stats
Moderator
Level 38
Programmer
Response to The Flash 'Reg' Lounge 2010-02-26 23:27:32 Reply

At 2/26/10 09:53 PM, Archon68 wrote: #55,000!

I WIN AGAIN.

You need to get out more.

In other news:

I was stepping up there earlier, and I'd go up there now!


The water in Majorca don't taste like what it oughta.

| AS3: Main | AS2: Main | Flash Tutorials |

BBS Signature
doctormario
doctormario
  • Member since: Jan. 30, 2009
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to The Flash 'Reg' Lounge 2010-02-27 01:37:52 Reply

Someone really needs to explain to me the relevance of the whole post count thing. If I worried about stuff like that, I think it would get in the way of my true focus: being drunk all the time.


BBS Signature
CrazyChihuahua
CrazyChihuahua
  • Member since: Apr. 22, 2003
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to The Flash 'Reg' Lounge 2010-02-27 02:36:24 Reply

Someone really needs to explain to me the relevance of the whole being drunk thing. If I worried about stuff like that, I think it would get in the way of my true focus: having a high post count.

I guess that would mean more if I had a high post count.

BBS Signature
dELtaluca
dELtaluca
  • Member since: Apr. 16, 2004
  • Offline.
Forum Stats
Member
Level 20
Blank Slate
Response to The Flash 'Reg' Lounge 2010-02-27 05:13:17 Reply

At 2/26/10 07:13 PM, Toast wrote:
At 2/26/10 06:21 PM, meneldil wrote: Forgive me and my lack of sleep. I meant:
logical_expression ? return_this_value_if_true : return_this_value_if_false
it doesn't return any values.

Yes it does.

? : is an operation which returns a value ;)

Just as =, +=, -=, *=, /=, %=, ^= &=, |=, ||, &&, +, -, /, *, ^, &, |, %, >>, <<, >>>, >>=, <<=, >>>=, !, ~, ++, --, all return values too :P


using ShamelessPlug; NapePhysicsEngine.advertise();

BBS Signature
Deadclever23
Deadclever23
  • Member since: Nov. 27, 2006
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
Response to The Flash 'Reg' Lounge 2010-02-27 07:28:25 Reply

The ?: operator is useful but it's slower than "if...else". Also it can become hell if you're to lazy to right a lot and you just end up with ???::?::?: kind of set up going on.


"To live is the rarest thing in the world. Most people exist, that is all."
- Oscar Wilde

BBS Signature
Doomsday-One
Doomsday-One
  • Member since: Oct. 28, 2005
  • Offline.
Forum Stats
Member
Level 10
Programmer
Response to The Flash 'Reg' Lounge 2010-02-27 07:34:35 Reply

At 2/27/10 07:28 AM, Deadclever23 wrote: The ?: operator is useful but it's slower than "if...else". Also it can become hell if you're to lazy to right a lot and you just end up with ???::?::?: kind of set up going on.

Isn't it faster normally, but slower with nested statements or something?
I haven't checked the bytecode or done any speed tests, but I remember reading that this was the case for AS2.
Please correct me if I'm wrong.

I had meant to check this yesterday.

Doomsday-One, working on stuff better than preloaders. Marginally.