Re: [Flashcoders] CLICK event not getting fired

2009-08-18 Thread Ian Thomas
Anna,
   Whether it's MouseEvent or Event makes no difference - since the
MouseEvent class is derived from Event, either will do unless you
actually want to access properties/methods defined only in MouseEvent.

Sajid,
   As Latcho says, you need something graphical to click on. You could
use the .graphics member to draw a box on screen, using
beginFill/drawRect/endFill. This could be made invisible by setting
.alpha=0.

There are other options - depends really on what you're trying to do.
Adding a listener to the stage object would be one solution.

Incidentally, unless you need a timeline/multiple frames for your
clip, you can use a Sprite instead of a MovieClip as the parent
object. Sprite is just like MovieClip - just it doesn't have a
timeline. It's the generic use-for-everything visual class of AS3,
whereas MovieClip was the equivalent in AS2.

HTH,

Ian

On Tue, Aug 18, 2009 at 4:33 AM, Sajid Saiyedsajid.fl...@gmail.com wrote:
 Hi Anna,
 Thanks.
 Forgot to mention that I tried MouseEvent as well and no luck :(

 Seems so strange
 I am sure I am missing something basic here.

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


[Flashcoders] actionscript 3 block rationale

2009-08-18 Thread Hans Wichman
Hey list,

does anyone know the cool rationale behind the fact that the compiler won't
allow me to execute a completely sane piece of code such as:

private function _demo():void {
for (var i:Number = 0; i  10;i++) {
  //evil stuff here
}
 for (var i:Number = 0; i  10;i++) {
  //evil stuff here
}
}

(getting a redefined blablah variable, to which there is no workaround but
to rename the loop variables I think)

But WILL allow me to do something stupid like:

  private function _demo():void {
   for (var i:int = 0; i  10; i++)
   {
trace (this[j]);
   }
   var j:Object = null;
  }


:)

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


Re: [Flashcoders] actionscript 3 block rationale

2009-08-18 Thread Ian Thomas
JC,
   AS3 has no block scope.

   Whenever you write 'var x' inside a method, that declaration
(effectively) gets moved to the 'top' of the method.

So at a compiler level, this:

 private function _demo():void {
 for (var i:Number = 0; i  10;i++) {
  //evil stuff here
 }
  for (var i:Number = 0; i  10;i++) {
  //evil stuff here
 }
 }

becomes this:

private function _demo():void
{
  var i:Number;
  var i:Number;  /// Second definition!
  for (i=0;i10;i++)
  {
 // Evil stuff
  }
  for (i=0;i10;i++)
  {
 // Evil stuff
  }
}

And this:

  private function _demo():void {
   for (var i:int = 0; i  10; i++)
   {
trace (this[j]);
   }
   var j:Object = null;
  }

becomes this:

private function _demo():void
{
  var j:Object;
  var i:int;
  for (i=0;i10;i++)
  {
trace(this[j]);
  }
  j=null;
}

I find it totally counterintuitive. It's a language spec thing. It was
the same in AS2 - although, interestingly, Nicolas Cannasse's MTASC
compiler added block scope and made AS2 work 'properly' - so it's not
like it's an issue at bytecode level.

Ian


On Tue, Aug 18, 2009 at 9:28 AM, Hans
Wichmanj.c.wich...@objectpainters.com wrote:
 Hey list,

 does anyone know the cool rationale behind the fact that the compiler won't
 allow me to execute a completely sane piece of code such as:

 private function _demo():void {
 for (var i:Number = 0; i  10;i++) {
  //evil stuff here
 }
  for (var i:Number = 0; i  10;i++) {
  //evil stuff here
 }
 }

 (getting a redefined blablah variable, to which there is no workaround but
 to rename the loop variables I think)

 But WILL allow me to do something stupid like:

  private function _demo():void {
   for (var i:int = 0; i  10; i++)
   {
    trace (this[j]);
   }
   var j:Object = null;
  }


 :)

 JC
 ___
 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] actionscript 3 block rationale

2009-08-18 Thread Hans Wichman
ok thanks, as i expected then.
Glad we agree it's counterintuitive, and although mtasc \^^\ oo /^^/ ROCKS,
i like as3 too much to go back though:))

thanks Ian

On Tue, Aug 18, 2009 at 10:43 AM, Ian Thomas i...@eirias.net wrote:

 JC,
   AS3 has no block scope.

   Whenever you write 'var x' inside a method, that declaration
 (effectively) gets moved to the 'top' of the method.

 So at a compiler level, this:

  private function _demo():void {
  for (var i:Number = 0; i  10;i++) {
   //evil stuff here
  }
   for (var i:Number = 0; i  10;i++) {
   //evil stuff here
  }
  }

 becomes this:

 private function _demo():void
 {
  var i:Number;
  var i:Number;  /// Second definition!
  for (i=0;i10;i++)
  {
 // Evil stuff
  }
  for (i=0;i10;i++)
  {
 // Evil stuff
  }
 }

 And this:

   private function _demo():void {
for (var i:int = 0; i  10; i++)
{
 trace (this[j]);
}
var j:Object = null;
   }

 becomes this:

 private function _demo():void
 {
  var j:Object;
  var i:int;
  for (i=0;i10;i++)
  {
trace(this[j]);
  }
  j=null;
 }

 I find it totally counterintuitive. It's a language spec thing. It was
 the same in AS2 - although, interestingly, Nicolas Cannasse's MTASC
 compiler added block scope and made AS2 work 'properly' - so it's not
 like it's an issue at bytecode level.

 Ian


 On Tue, Aug 18, 2009 at 9:28 AM, Hans
 Wichmanj.c.wich...@objectpainters.com wrote:
  Hey list,
 
  does anyone know the cool rationale behind the fact that the compiler
 won't
  allow me to execute a completely sane piece of code such as:
 
  private function _demo():void {
  for (var i:Number = 0; i  10;i++) {
   //evil stuff here
  }
   for (var i:Number = 0; i  10;i++) {
   //evil stuff here
  }
  }
 
  (getting a redefined blablah variable, to which there is no workaround
 but
  to rename the loop variables I think)
 
  But WILL allow me to do something stupid like:
 
   private function _demo():void {
for (var i:int = 0; i  10; i++)
{
 trace (this[j]);
}
var j:Object = null;
   }
 
 
  :)
 
  JC
  ___
  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

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


Re: [Flashcoders] CLICK event not getting fired

2009-08-18 Thread Alexander Farber
On Tue, Aug 18, 2009 at 6:22 AM, Sajid Saiyedsajid.fl...@gmail.com wrote:
 I should have  given a bit more background.
 I am trying to detect a CLICK anywhere on the (blank) stage.

 Only when the user clicks somewhere on stage, I want to show something.

 How can I do this?
 Do I still need to draw something?

No, but then you need:

   stage.addEventListener(MouseEvent.CLICK, reportClick);
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Re: Sending 2 HTTP requests from a webchat-like app

2009-08-18 Thread Alexander Farber
On Mon, Aug 17, 2009 at 10:36 AM, Mick Gmix...@gmail.com wrote:
 You might want to think about using something more robust like
 smartfoxserver so you can not have the restrictions of http requests.
 I've been using is on a chat/whiteboard app for a while and it's an enormous
 performance increase over any http requests.


Yes, a socket server would make my app easier to program,
but it would also make it unusable for too many users
(those behind corporate firewalls).

Hotmail + GMail + Google Apps + etc. don't use sockets either ;-)

I've got the 2 HTTP requests working in the meantime
and now my app is quite snappy.

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


[Flashcoders] Duplicate multiple lines in FlashDevelop?

2009-08-18 Thread Joel Stransky
Anyone know how? Like if I want to dupe an entire function sig.

-- 
--Joel Stransky
stranskydesign.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Duplicate multiple lines in FlashDevelop?

2009-08-18 Thread Pedro Taranto
don't know about multiple lines, but to duplicate a simple line just use 
CTRL+D


--
Pedro Taranto


Joel Stransky wrote:

Anyone know how? Like if I want to dupe an entire function sig.

  

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


RE: [Flashcoders] Next big 'speedy' thing ?

2009-08-18 Thread Merrill, Jason
; furthermore I was
talking about the xml-code outcome of this process:
http://www.gotoandlearn.com/play?id=110

Yes, I got that, but not sure I get what you're asking about it.  Yes,
FXG is a new graphics format for Adobe graphic files.  Catalyst will
produce your MXML with interactivity for you to continue to refine in
Flashbuilder or other tools.  Catalyst will greatly help in generating
rich user interfaces with interactivity - saves you a lot of hassle with
skinning files and then programming them in Actionscript/MXML.   


Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 

Monthly meetings on the Adobe Flash platform for rich media experiences
- join the Bank of America Flash Platform Community 



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


Re: [Flashcoders] Duplicate multiple lines in FlashDevelop?

2009-08-18 Thread Joel Stransky
Seems like it'd be an incredibly useful feature.

On Tue, Aug 18, 2009 at 9:40 AM, Pedro Taranto ptara...@gmail.com wrote:

 don't know about multiple lines, but to duplicate a simple line just use
 CTRL+D

 --
 Pedro Taranto


 Joel Stransky wrote:

 Anyone know how? Like if I want to dupe an entire function sig.



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




-- 
--Joel Stransky
stranskydesign.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] negative scale

2009-08-18 Thread Joel Stransky
Know of any good workarounds for when you need to set the scale to negative?
as in mySprite.scaleX = -1; //scaleX only accepts positive integers.

-- 
--Joel Stransky
stranskydesign.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] mac vs pc

2009-08-18 Thread Ron Wheeler

You might look at Spring Roo to see where the generation of code is going.
It is very slick. It works very nicely from the UML model.

Document the classes and atomic properties.
Document the relationships. Order has a property which is a set of 
Order Details and Order Details has a reference to an Order
Document the finders I want a findByOder on OrderDetails, I want a 
findByCustomer on Order It can tell from the names what you want.

Document the names of the controllers you want created.
Document the controllers for which you want automatic test scripts.
request that Security be added

Feed your little script into Roo and you get a working Java webapp with 
CRUD for all your objects.


Import that into Eclipse (STS version) and customize it.

Still learning how to use it but it is pretty slick. The visual 
appearance is horrible but it is set up for CSS so it can be fixed up.
All of the CRUD functions are on a single page, so you do have to go in 
and remap your content, menus and functions onto URLs and pages that 
make sense.


It depends on Spring and AOP very heavily. The code generated is very, 
very concise and readable.


I am just getting used to AOP and it looks pretty intimidating.

If we only had Spring for haXe..


Ron

Matt Gitchell wrote:

I figured this is where we'd end up.
I code in either environment with comparable speed, honestly, it's just
getting used to the workflow.
Honest! Now whether that means I code like the freakin' wind in either
or am slow as hell
in both I'll leave for you to decide. Rather than seeing the Eclipse-based
methodology as 'stupid,' I decided to consider it merely different and have
done some tweaks to get it the way I like it, which now I do.

And yes, I do 'think ahead' plenty, but that still doesn't mean that things
don't get moved around all that often. In my particular freelance world, I
end up dealing with 3rd party IT and backend guys and gals, subcontractors
of varying skill, clients who want to change scope, clients who DO change
scope (though they generally get punished financially), the gamut. Some of
these experiences mean changes of plans, which means that the refactoring
aspect is handy and saves me time.

The debug stuff is also very handy. I write code, compile, test; I
repeat this until I have a project done, for the most part. That means
that I engage the debugger more than just occasionally, I really like
having that data there.

I like these additional features, and it's worth the money to me to have
them all part of the same tool. If it saves me, say, 10 hours over the
course of owning the software, I've more than paid for it, and I've more
than paid for it.

Some of us get to work in worlds where we define all variables at the outset
of the project. We then see our projects built exactly to the class diagrams
we built when we set out to start, and we don't deviate. We then get to
write thousands of lines of perfect code, with perfect structure, then
compile it once and find that we've removed every listener, destroyed every
bitmap, caught every error, forseen every use case.

I am not one of those people, so I've bought a tool (and use a platform)
that helps compensate for that.

--Matt


On Mon, Aug 17, 2009 at 7:21 PM, Steven Sacks flash...@stevensacks.netwrote:

  

The act of writing Actionscript in FlashDevelop is, IMO, better.  FD's code
completion and code gen is easier and faster.  Because code completion and
code gen is the majority of what I do from moment to moment as I'm writing,
it's the better tool.

Refactoring and debugging are not what I spend the majority of my time
doing.  I have Flex Builder.  I use it sometimes, but not always, and
generally I use it with Build Automatically turned on while I code in FD on
the same project and it will spot compile-time errors on the fly.

FDT is a great (albeit expensive) tool, but for day to day coding, I prefer
FlashDevelop because it helps me write code faster.  It might not help me
debug faster, but I spend a lot less time doing that than actually writing
code, which is where FlashDevelop shines.

I'm confused by all these comments about the strength of the refactoring
tool being a deciding factor.  Do you really move stuff around packages that
often? Do you really rename entire classes that often?  I find that thinking
ahead solves that problem, and when it comes up, Find and Replace in files
does a great job, even if it's a few Find and Replaces instead of just one
Refactor command.

Believe me, I (and many others) have asked the FD guys for this feature,
and it's something they're working on adding.  However, it's not something I
use often enough to outweigh the benefits FD provides when actually writing
code.

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



___
Flashcoders mailing list

Re: [Flashcoders] Duplicate multiple lines in FlashDevelop?

2009-08-18 Thread Sidney de Koning
Yeah it is, they call it copy-pasting ;-) The key command is CTRL-C to  
copy and CTRL-V to paste... Think it even works on a mac too...


One extra key command, but still incredibly usefull! ;-)



Sorry couldn't help it ... :-)

On Aug 18, 2009, at 4:46 PM, Joel Stransky wrote:


Seems like it'd be an incredibly useful feature.

On Tue, Aug 18, 2009 at 9:40 AM, Pedro Taranto ptara...@gmail.com  
wrote:


don't know about multiple lines, but to duplicate a simple line  
just use

CTRL+D

--
Pedro Taranto


Joel Stransky wrote:


Anyone know how? Like if I want to dupe an entire function sig.




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





--
--Joel Stransky
stranskydesign.com
___
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

3GB free storage you can sync with your mobile device or Mac or PC.
Check out https://www.getdropbox.com/referrals/NTI1MjcxMzk

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


RE: [Flashcoders] mac vs pc

2009-08-18 Thread Merrill, Jason
 Document the classes and atomic properties.

What's an atomic property?


Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 

Monthly meetings on the Adobe Flash platform for rich media experiences
- join the Bank of America Flash Platform Community 


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


Re: [Flashcoders] negative scale

2009-08-18 Thread Juan Pablo Califano
Using negative scales works... I've just double checked.

Cheers
Juan Pablo Califano

2009/8/18 Joel Stransky j...@stranskydesign.com

 Know of any good workarounds for when you need to set the scale to
 negative?
 as in mySprite.scaleX = -1; //scaleX only accepts positive integers.

 --
 --Joel Stransky
 stranskydesign.com
 ___
 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] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Dave Watts
 I highly suggest reading Practices of an Agile Developer
 http://www.pragprog.com/titles/pad/practices-of-an-agile-developer

 Use KISS. Stay DRY. Code less. Code smart (code S-Mart).

 Use smart shortcuts when they're available to you.  Implicit boolean
 coercion is one such shortcut, among many others.

 We need to get things done.  We don't have the luxury that academia has to
 argue about theory for months and years.

You've spent as much time arguing about this as people typically spend
typing out Boolean expressions in the first place. Honestly, if you're
finding an extra ten or so characters a burden, you may have other
problems that are unrelated to the value of using implicit Boolean
evaluation. This has nothing to do with getting things done or
arguing about theory.

But anyway, arguably, keeping it simple doesn't mean keeping it brief.
An explicit Boolean expression is simpler to read and understand than
an implicit Boolean evaluation. Not all languages support implicit
Boolean evaluation, so I have to remember one set of rules for some
environments and a different set for others - not simple.

Again, I'm not saying there's anything wrong with implicit Boolean
evaluation, I just think it's a mistake to believe it's inherently
superior to an explicit, slightly longer Boolean expression, to the
point of telling people they should replace one with another.

And as much as I like Ash, I'm not sure I want to take coding advice
from the guy who couldn't remember klaatu barada nikto - maybe he
was too enamored of shortcuts?

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

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


Re: [Flashcoders] mac vs pc

2009-08-18 Thread Dave Watts
 What's an atomic property?

A property that is a primitive type (string, int, Boolean, etc), I think.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] mac vs pc

2009-08-18 Thread Merrill, Jason
Why not just call it a primitive then?


Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 

Monthly meetings on the Adobe Flash platform for rich media experiences
- join the Bank of America Flash Platform Community 





-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Dave
Watts
Sent: Tuesday, August 18, 2009 11:22 AM
To: Flash Coders List
Subject: Re: [Flashcoders] mac vs pc

 What's an atomic property?

A property that is a primitive type (string, int, Boolean, etc), I
think.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!
___
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] mac vs pc

2009-08-18 Thread Ron Wheeler

Dave Watts wrote:

What's an atomic property?



A property that is a primitive type (string, int, Boolean, etc), I think.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

  

That is what I was trying to convey.
Thanks
Ron

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


Re: [Flashcoders] mac vs pc

2009-08-18 Thread Ron Wheeler

Merrill, Jason wrote:

Why not just call it a primitive then?

  

That would have been exactly the right thing to say/write.
Sorry.
Couldn't think of the right word at the time. Just getting old, I guess.
Ron

Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 


Monthly meetings on the Adobe Flash platform for rich media experiences
- join the Bank of America Flash Platform Community 






-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Dave
Watts
Sent: Tuesday, August 18, 2009 11:22 AM
To: Flash Coders List
Subject: Re: [Flashcoders] mac vs pc

  

What's an atomic property?



A property that is a primitive type (string, int, Boolean, etc), I
think.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!
___
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

  


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


Re: [Flashcoders] Duplicate multiple lines in FlashDevelop?

2009-08-18 Thread Kenneth Kawamoto

No, it won't work on Macs ;)

Kenneth Kawamoto
http://www.materiaprima.co.uk/

Sidney de Koning wrote:
Yeah it is, they call it copy-pasting ;-) The key command is CTRL-C to 
copy and CTRL-V to paste... Think it even works on a mac too...


One extra key command, but still incredibly usefull! ;-)



Sorry couldn't help it ... :-)

On Aug 18, 2009, at 4:46 PM, Joel Stransky wrote:


Seems like it'd be an incredibly useful feature.

On Tue, Aug 18, 2009 at 9:40 AM, Pedro Taranto ptara...@gmail.com 
wrote:



don't know about multiple lines, but to duplicate a simple line just use
CTRL+D

--
Pedro Taranto


Joel Stransky wrote:


Anyone know how? Like if I want to dupe an entire function sig.




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





--
--Joel Stransky
stranskydesign.com

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


RE: [Flashcoders] mac vs pc

2009-08-18 Thread Merrill, Jason
 Why not just call it a primitive then?
That would have been exactly the right thing to say/write.
 Sorry. Couldn't think of the right word at the time. 
Just getting old, I guess.

Ah, np, I thought maybe it was some hip new term or something I hadn't
heard of!


Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 

Monthly meetings on the Adobe Flash platform for rich media experiences
- join the Bank of America Flash Platform Community 



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


Re: [Flashcoders] mac vs pc

2009-08-18 Thread Dave Watts
 Why not just call it a primitive then?

Well, while they're generally the same sort of thing, they can be
different - in many languages, a string isn't really a primitive type
but represents an instance of a String object or an array of
characters, etc. I think the point of calling them atomic is to
indicate that they don't have properties of their own that correspond
to other objects. (atomic == indivisible).

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Steve Mathews
Ugh, then you go and use an if statement without brackets, and on the same
line to boot! I for one, would not want to maintain your code.

This is in jest of course. I am not going to say doing things shorthand is
wrong, but there are some very valid merits to not doing the shorthand
methods.

On Mon, Aug 17, 2009 at 6:58 PM, Steven Sacks flash...@stevensacks.netwrote:

 Here's the best way to write that. No try catch required.

 if (myDO  myDO.parent) myDO.parent.removeChild(myDO);


 Keith H wrote:


 Steven,

 Maybe its just me but...
 Just doing a Boolean check on DisplayObjects always put my scripts in high
 risk of runtime errors.
 Especially in the case of cleanup operations.
 Sometimes I might have a function that attempts removing a DisplayObject
 that has not been added to the stage or has already been removed.

 So I check if the stage property is null for almost all cases now.

 var myDO:Sprite=new Sprite();
 try {
   //if (myDO) { //Creates runtime error
   if (myDO  myDO.stage != null) {
   myDO.parent.removeChild(myDO);
   }   } catch (e:Error) {
   trace(e.message);
 }

 -- Keith H --
 www.keith-hair.net

 ___
 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] Duplicate multiple lines in FlashDevelop?

2009-08-18 Thread Sidney de Koning

Oh shiite ... on a mac its CMD :-)

On Aug 18, 2009, at 5:49 PM, Kenneth Kawamoto wrote:


No, it won't work on Macs ;)

Kenneth Kawamoto
http://www.materiaprima.co.uk/

Sidney de Koning wrote:
Yeah it is, they call it copy-pasting ;-) The key command is CTRL-C  
to copy and CTRL-V to paste... Think it even works on a mac too...

One extra key command, but still incredibly usefull! ;-)
Sorry couldn't help it ... :-)
On Aug 18, 2009, at 4:46 PM, Joel Stransky wrote:

Seems like it'd be an incredibly useful feature.

On Tue, Aug 18, 2009 at 9:40 AM, Pedro Taranto  
ptara...@gmail.com wrote:


don't know about multiple lines, but to duplicate a simple line  
just use

CTRL+D

--
Pedro Taranto


Joel Stransky wrote:


Anyone know how? Like if I want to dupe an entire function sig.




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





--
--Joel Stransky
stranskydesign.com

___
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

3GB free storage you can sync with your mobile device or Mac or PC.
Check out https://www.getdropbox.com/referrals/NTI1MjcxMzk

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


Re: [Flashcoders] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Dave Watts
 Ugh, then you go and use an if statement without brackets, and on the same
 line to boot! I for one, would not want to maintain your code.

Hey, you're just lucky he's not using the ternary operator! After all,
that would be the simplest approach.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] mac vs pc

2009-08-18 Thread Merrill, Jason
(atomic == indivisible).

You need to do some reading on string theory. :) 


Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 

Monthly meetings on the Adobe Flash platform for rich media experiences
- join the Bank of America Flash Platform Community 


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


Re: [Flashcoders] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Ian Thomas
On Tue, Aug 18, 2009 at 4:20 PM, Dave Wattsdwa...@figleaf.com wrote:

 Again, I'm not saying there's anything wrong with implicit Boolean
 evaluation, I just think it's a mistake to believe it's inherently
 superior to an explicit, slightly longer Boolean expression, to the
 point of telling people they should replace one with another.

Amen.

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


Re: [Flashcoders] mac vs pc

2009-08-18 Thread Ian Thomas
One for which you shouldn't call the setter unless you're wearing a
lead apron and goggles. ;-)

Ian

On Tue, Aug 18, 2009 at 3:52 PM, Merrill,
Jasonjason.merr...@bankofamerica.com wrote:
 Document the classes and atomic properties.

 What's an atomic property?


 Jason Merrill

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


RE: [Flashcoders] How to add a DisplayObject into a container withoutusing addChild() method.

2009-08-18 Thread Merrill, Jason
For the record, I love these get your nerd on, see if you can out-nerd
others discussions related to Actionscript.  Bring it! 


Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 

Monthly meetings on the Adobe Flash platform for rich media experiences
- join the Bank of America Flash Platform Community 



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


Re: [Flashcoders] How to add a DisplayObject into a container withoutusing addChild() method.

2009-08-18 Thread Latcho

And I'd love to see all your shorthands,  unesthaetic as hell  !
Get your darkest bitwises out.

Don't forget to add in the disclaimer:

This shorthand and the accompanying code are provided as-is. You may use 
it as you please. You may *not* hold me liable for any damage caused to 
you, your company, your neighbors or anyone else, nor for the 
non-maintainability of the written code as a result of implementing  
parts from this post.
Whatever you do with this post, the provided shorthand or the 
accompanying code is at your own risk.


Latcho
Merrill, Jason wrote:

For the record, I love these get your nerd on, see if you can out-nerd
others discussions related to Actionscript.  Bring it! 



Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 


Monthly meetings on the Adobe Flash platform for rich media experiences
- join the Bank of America Flash Platform Community 




___
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] Duplicate multiple lines in FlashDevelop?

2009-08-18 Thread Joel Stransky
Thanks, you're a big help champ.

On Tue, Aug 18, 2009 at 11:58 AM, Sidney de Koning
sid...@funky-monkey.nlwrote:

 Oh shiite ... on a mac its CMD :-)


 On Aug 18, 2009, at 5:49 PM, Kenneth Kawamoto wrote:

  No, it won't work on Macs ;)

 Kenneth Kawamoto
 http://www.materiaprima.co.uk/

 Sidney de Koning wrote:

 Yeah it is, they call it copy-pasting ;-) The key command is CTRL-C to
 copy and CTRL-V to paste... Think it even works on a mac too...
 One extra key command, but still incredibly usefull! ;-)
 Sorry couldn't help it ... :-)
 On Aug 18, 2009, at 4:46 PM, Joel Stransky wrote:

 Seems like it'd be an incredibly useful feature.

 On Tue, Aug 18, 2009 at 9:40 AM, Pedro Taranto ptara...@gmail.com
 wrote:

  don't know about multiple lines, but to duplicate a simple line just
 use
 CTRL+D

 --
 Pedro Taranto


 Joel Stransky wrote:

  Anyone know how? Like if I want to dupe an entire function sig.



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




 --
 --Joel Stransky
 stranskydesign.com

 ___
 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

 3GB free storage you can sync with your mobile device or Mac or PC.
 Check out https://www.getdropbox.com/referrals/NTI1MjcxMzk

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




-- 
--Joel Stransky
stranskydesign.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Steven Sacks

I didn't see a reponse from Ash.  Yet another email lost to the ether.  :(


Dave Watts wrote:

And as much as I like Ash, I'm not sure I want to take coding advice
from the guy who couldn't remember klaatu barada nikto - maybe he
was too enamored of shortcuts?

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

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


Re: [Flashcoders] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Steven Sacks

That was supposed to be a winky, not a frowny.

Steven Sacks wrote:

I didn't see a reponse from Ash.  Yet another email lost to the ether.  :(


Dave Watts wrote:

And as much as I like Ash, I'm not sure I want to take coding advice
from the guy who couldn't remember klaatu barada nikto - maybe he
was too enamored of shortcuts?

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

___
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] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Steven Sacks

Dave, come on. Take a stand on the issue. Stop straddling the fence.

Pick a side. Im or Ex?

I'm not about writing cryptic PERL-like statements, but writing != null is a 
waste of time.  It's obviously a null comparison (by nature of it being an 
instance).  Calling it out as such is redundant.


It also lends itself to very readable code with inline ORs.

var value:String = foo || bar;

If foo is null, value = bar.  Great for default values such as with XML.

var value:String = x...@foo || ;

Very readable and so much better than

var value:String = ;
if (x...@foo != undefined) value = x...@foo;
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Duplicate multiple lines in FlashDevelop?

2009-08-18 Thread Latcho

Then let me be your champ today.
http://greencollective.nl/blog/?p=24
Latcho

Joel Stransky wrote:

Thanks, you're a big help champ.

On Tue, Aug 18, 2009 at 11:58 AM, Sidney de Koning
sid...@funky-monkey.nlwrote:

  

Oh shiite ... on a mac its CMD :-)


On Aug 18, 2009, at 5:49 PM, Kenneth Kawamoto wrote:

 No, it won't work on Macs ;)


Kenneth Kawamoto
http://www.materiaprima.co.uk/

Sidney de Koning wrote:

  

Yeah it is, they call it copy-pasting ;-) The key command is CTRL-C to
copy and CTRL-V to paste... Think it even works on a mac too...
One extra key command, but still incredibly usefull! ;-)
Sorry couldn't help it ... :-)
On Aug 18, 2009, at 4:46 PM, Joel Stransky wrote:



Seems like it'd be an incredibly useful feature.

On Tue, Aug 18, 2009 at 9:40 AM, Pedro Taranto ptara...@gmail.com
wrote:

 don't know about multiple lines, but to duplicate a simple line just
  

use
CTRL+D

--
Pedro Taranto


Joel Stransky wrote:

 Anyone know how? Like if I want to dupe an entire function sig.



 ___
  

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




--
--Joel Stransky
stranskydesign.com

  

___


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

3GB free storage you can sync with your mobile device or Mac or PC.
Check out https://www.getdropbox.com/referrals/NTI1MjcxMzk

___
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] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Keith H
Back when I was using AS2 and Javascript || operator was useful to me. 
I was so glad when AS3 brought default parameters.

var value:String = foo || bar;

-- Keith H --
www.keith-hair.net




Steven Sacks wrote:

Dave, come on. Take a stand on the issue. Stop straddling the fence.

Pick a side. Im or Ex?

I'm not about writing cryptic PERL-like statements, but writing != 
null is a waste of time.  It's obviously a null comparison (by nature 
of it being an instance).  Calling it out as such is redundant.


It also lends itself to very readable code with inline ORs.

var value:String = foo || bar;

If foo is null, value = bar.  Great for default values such as with XML.

var value:String = x...@foo || ;

Very readable and so much better than

var value:String = ;
if (x...@foo != undefined) value = x...@foo;
___
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] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Dave Watts
 Dave, come on. Take a stand on the issue. Stop straddling the fence.

 Pick a side. Im or Ex?

I think you're missing the point. You're asking a pacifist which army
he should join. I really don't have a strong opinion either way.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Steven Sacks
The reason you're comfortable straddling the fence is because you don't 
experience the pain or discomfort associated with a picket sticking into your 
crotch.  Why would that be?  ;)


How do YOU code? Do you use implicit or explicit?

Dave Watts wrote:

I think you're missing the point. You're asking a pacifist which army
he should join. I really don't have a strong opinion either way.

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


Re: [Flashcoders] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Dave Watts
 The reason you're comfortable straddling the fence is because you don't
 experience the pain or discomfort associated with a picket sticking into
 your crotch.  Why would that be?  ;)

Because I used to be in the military, where you routinely get screwed
on a daily basis. BOHICA.

 How do YOU code? Do you use implicit or explicit?

It really depends on the language. Since I'm moving (more or less)
from Java to AS3, more or less, I'm usually using explicit expressions
because that's what people do in Java. On the other hand, in the
ColdFusion code I've written, I usually use implicit Boolean
evaluation.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

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


Re: [Flashcoders] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Paul Andrews

Dave Watts wrote:

snip
It really depends on the language. Since I'm moving (more or less)
from Java to AS3, more or less, I'm usually using explicit expressions
because that's what people do in Java. On the other hand, in the
ColdFusion code I've written, I usually use implicit Boolean
evaluation.
  
I don't think writing good code is related to languages, despite the 
different constructs available between them. I think good coding style 
is based on simple principles, and brevity or speed of coding is not 
included.


Short coding constructs may be perceived as elegant and aid coding 
speed, but that wholly misses the point - coding isn't a race nor is 
optimising the number of bytes in the source code. Showing a deep 
knowledge of a software language through use of the language in ways 
that are not so clear to mere mortals less familiar with the language, 
isn't good. It is rarely a good idea to optimise code by using a faster 
programming construct that makes the intention of the code less clear.


Good coding should be clear - even for those less familiar with the 
language. Truncated coding constructs may be efficient and even elegant, 
but will they be easily understandable by someone else (or even the same 
person much later)? Code minimalism can hide the true intention of the 
code and introduce unintended behaviour when mistakes are made. When 
code is expansive (verbose even) the intention of the code is clear. 
When someone relies on some language behaviour for handling null values, 
the reader may be left wondering whether the original developer really 
intended that the code should handle nulls in this way, or is it some 
accidental happenstance of using that construct? Are nulls really 
relevant here in this code snippet or not. Testing specifically for 
nulls is explicit and unambiguous.


Maintainability - truncated constructs can sometimes mean that changes 
for updates mean undoing the efficient constructs that performed well 
for specific case they were coded for, but will have to be ditched 
completely for the more complicated case, leaving the  updater to unwind 
the intention of the shorter construct and translate that to the wider case.


As far as fast coding goes, everybody likes a helpful ide or editor, 
but really fast coders really aren't team coders and the need for 
speed is less important than the need for clarity. I'm not a fast 
coder. Sometimes I wish I was an even slower coder, because then I'd 
realise I could code things rather better than going rushing in to get 
things done.


I once worked with a guy who had a clear desk and often sat reading the 
newspaper. It did attract some critical comment, but that guy had the 
right idea. Before he started coding he spent a lot of time on the 
design, getting that right. A faster code editor or fancy programming 
wouldn't have made him a better developer. He spent most of his time 
getting it right before his hands hit the keyboard. He was the best 
developer I ever met.


So, in my insignificant opinion - brevity == BAD, fast coding ==BAD.

Paul


Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

___
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] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Leandro Ferreira
A good CODER must go beyond a good CODE be fast when needed. That's MHO, and
It gets clear when we compare the number of lines we use to express
ourselves.



  Leandro Ferreira
Sent from Brasília, Brazilian Federal District, Brazil

On Tue, Aug 18, 2009 at 18:17, Paul Andrews p...@ipauland.com wrote:

 Dave Watts wrote:

 snip
 It really depends on the language. Since I'm moving (more or less)
 from Java to AS3, more or less, I'm usually using explicit expressions
 because that's what people do in Java. On the other hand, in the
 ColdFusion code I've written, I usually use implicit Boolean
 evaluation.


 I don't think writing good code is related to languages, despite the
 different constructs available between them. I think good coding style is
 based on simple principles, and brevity or speed of coding is not included.

 Short coding constructs may be perceived as elegant and aid coding speed,
 but that wholly misses the point - coding isn't a race nor is optimising the
 number of bytes in the source code. Showing a deep knowledge of a software
 language through use of the language in ways that are not so clear to mere
 mortals less familiar with the language, isn't good. It is rarely a good
 idea to optimise code by using a faster programming construct that makes the
 intention of the code less clear.

 Good coding should be clear - even for those less familiar with the
 language. Truncated coding constructs may be efficient and even elegant, but
 will they be easily understandable by someone else (or even the same person
 much later)? Code minimalism can hide the true intention of the code and
 introduce unintended behaviour when mistakes are made. When code is
 expansive (verbose even) the intention of the code is clear. When someone
 relies on some language behaviour for handling null values, the reader may
 be left wondering whether the original developer really intended that the
 code should handle nulls in this way, or is it some accidental happenstance
 of using that construct? Are nulls really relevant here in this code snippet
 or not. Testing specifically for nulls is explicit and unambiguous.

 Maintainability - truncated constructs can sometimes mean that changes for
 updates mean undoing the efficient constructs that performed well for
 specific case they were coded for, but will have to be ditched completely
 for the more complicated case, leaving the  updater to unwind the intention
 of the shorter construct and translate that to the wider case.

 As far as fast coding goes, everybody likes a helpful ide or editor, but
 really fast coders really aren't team coders and the need for speed is
 less important than the need for clarity. I'm not a fast coder. Sometimes I
 wish I was an even slower coder, because then I'd realise I could code
 things rather better than going rushing in to get things done.

 I once worked with a guy who had a clear desk and often sat reading the
 newspaper. It did attract some critical comment, but that guy had the right
 idea. Before he started coding he spent a lot of time on the design, getting
 that right. A faster code editor or fancy programming wouldn't have made him
 a better developer. He spent most of his time getting it right before his
 hands hit the keyboard. He was the best developer I ever met.

 So, in my insignificant opinion - brevity == BAD, fast coding ==BAD.

 Paul


  Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/

 Fig Leaf Software provides the highest caliber vendor-authorized
 instruction at our training centers in Washington DC, Atlanta,
 Chicago, Baltimore, Northern Virginia, or on-site at your location.
 Visit http://training.figleaf.com/ for more information!

 ___
 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

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


RE: [Flashcoders] How to add a DisplayObject into a container withoutusing addChild() method.

2009-08-18 Thread Merrill, Jason
 brevity == BAD

So then wouldn't you mean to write, I would consider brevity to be a
bad thing... instead? ;) 


Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 

Monthly meetings on the Adobe Flash platform for rich media experiences
- join the Bank of America Flash Platform Community 


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


Re: [Flashcoders] Duplicate multiple lines in FlashDevelop?

2009-08-18 Thread Joel Stransky
That is awesome!

On Tue, Aug 18, 2009 at 3:15 PM, Latcho spamtha...@gmail.com wrote:

 Then let me be your champ today.
 http://greencollective.nl/blog/?p=24
 Latcho


 Joel Stransky wrote:

 Thanks, you're a big help champ.

 On Tue, Aug 18, 2009 at 11:58 AM, Sidney de Koning
 sid...@funky-monkey.nlwrote:



 Oh shiite ... on a mac its CMD :-)


 On Aug 18, 2009, at 5:49 PM, Kenneth Kawamoto wrote:

  No, it won't work on Macs ;)


 Kenneth Kawamoto
 http://www.materiaprima.co.uk/

 Sidney de Koning wrote:



 Yeah it is, they call it copy-pasting ;-) The key command is CTRL-C to
 copy and CTRL-V to paste... Think it even works on a mac too...
 One extra key command, but still incredibly usefull! ;-)
 Sorry couldn't help it ... :-)
 On Aug 18, 2009, at 4:46 PM, Joel Stransky wrote:



 Seems like it'd be an incredibly useful feature.

 On Tue, Aug 18, 2009 at 9:40 AM, Pedro Taranto ptara...@gmail.com
 wrote:

  don't know about multiple lines, but to duplicate a simple line just


 use
 CTRL+D

 --
 Pedro Taranto


 Joel Stransky wrote:

  Anyone know how? Like if I want to dupe an entire function sig.



  ___


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




 --
 --Joel Stransky
 stranskydesign.com



 ___


 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

 3GB free storage you can sync with your mobile device or Mac or PC.
 Check out https://www.getdropbox.com/referrals/NTI1MjcxMzk

 ___
 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




-- 
--Joel Stransky
stranskydesign.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How to add a DisplayObject into a container withoutusing addChild() method.

2009-08-18 Thread Paul Andrews

Merrill, Jason wrote:

brevity == BAD
  


So then wouldn't you mean to write, I would consider brevity to be a
bad thing... instead? ;) 
  

LOL.


Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 


Monthly meetings on the Adobe Flash platform for rich media experiences
- join the Bank of America Flash Platform Community 



___
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] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Patrick Matte
I think you're right, but I saw one guy here at work writing something like
this for readability he said!

if (value != null) {
;
} else if (value == null) {
;
}



 From: Paul Andrews p...@ipauland.com
 Reply-To: Flash Coders List flashcoders@chattyfig.figleaf.com
 Date: Tue, 18 Aug 2009 22:17:05 +0100
 To: Flash Coders List flashcoders@chattyfig.figleaf.com
 Subject: Re: [Flashcoders] How to add a DisplayObject into a container without
 using addChild() method.
 
 Dave Watts wrote:
 snip
 It really depends on the language. Since I'm moving (more or less)
 from Java to AS3, more or less, I'm usually using explicit expressions
 because that's what people do in Java. On the other hand, in the
 ColdFusion code I've written, I usually use implicit Boolean
 evaluation.
   
 I don't think writing good code is related to languages, despite the
 different constructs available between them. I think good coding style
 is based on simple principles, and brevity or speed of coding is not
 included.
 
 Short coding constructs may be perceived as elegant and aid coding
 speed, but that wholly misses the point - coding isn't a race nor is
 optimising the number of bytes in the source code. Showing a deep
 knowledge of a software language through use of the language in ways
 that are not so clear to mere mortals less familiar with the language,
 isn't good. It is rarely a good idea to optimise code by using a faster
 programming construct that makes the intention of the code less clear.
 
 Good coding should be clear - even for those less familiar with the
 language. Truncated coding constructs may be efficient and even elegant,
 but will they be easily understandable by someone else (or even the same
 person much later)? Code minimalism can hide the true intention of the
 code and introduce unintended behaviour when mistakes are made. When
 code is expansive (verbose even) the intention of the code is clear.
 When someone relies on some language behaviour for handling null values,
 the reader may be left wondering whether the original developer really
 intended that the code should handle nulls in this way, or is it some
 accidental happenstance of using that construct? Are nulls really
 relevant here in this code snippet or not. Testing specifically for
 nulls is explicit and unambiguous.
 
 Maintainability - truncated constructs can sometimes mean that changes
 for updates mean undoing the efficient constructs that performed well
 for specific case they were coded for, but will have to be ditched
 completely for the more complicated case, leaving the  updater to unwind
 the intention of the shorter construct and translate that to the wider case.
 
 As far as fast coding goes, everybody likes a helpful ide or editor,
 but really fast coders really aren't team coders and the need for
 speed is less important than the need for clarity. I'm not a fast
 coder. Sometimes I wish I was an even slower coder, because then I'd
 realise I could code things rather better than going rushing in to get
 things done.
 
 I once worked with a guy who had a clear desk and often sat reading the
 newspaper. It did attract some critical comment, but that guy had the
 right idea. Before he started coding he spent a lot of time on the
 design, getting that right. A faster code editor or fancy programming
 wouldn't have made him a better developer. He spent most of his time
 getting it right before his hands hit the keyboard. He was the best
 developer I ever met.
 
 So, in my insignificant opinion - brevity == BAD, fast coding ==BAD.
 
 Paul
 
 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/
 
 Fig Leaf Software provides the highest caliber vendor-authorized
 instruction at our training centers in Washington DC, Atlanta,
 Chicago, Baltimore, Northern Virginia, or on-site at your location.
 Visit http://training.figleaf.com/ for more information!
 
 ___
 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



This e-mail is intended only for the named person or entity to which it is 
addressed and contains valuable 
business information that is proprietary, privileged, confidential and/or 
otherwise protected from disclosure.

If you received this e-mail in error, any review, use, dissemination, 
distribution or copying of this e-mail 
is strictly prohibited. Please notify us immediately of the error via e-mail to 
disclai...@tbwachiat.com and 
please delete the e-mail from your system, retaining no copies in any media. We 
appreciate your cooperation.

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


Re: [Flashcoders] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Latcho

We might want to change the subjet line.
Our ACElash-friend must have gotten scared from the responses on his 
question

how he should do a  parent.addchild(self) :)

Anyways in my perception a long list of if elses is not always my ideal 
of readable code.

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


Re: Autoreply: Re: [Flashcoders] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Latcho

time to suspend i...@toolshop.de I'd say

i...@toolshop.de wrote:

Wir haben vom 10.08.2009 - 21.08.2009 Betriebsferien.
Alle Anfragen werden wir danach umgehend beantworten.
Vielen Dank für Ihr Verständnis.

###

We are closed for vacation from Aug 10, 2009 until Aug 21, 2009.
All requests will be answered after Aug 21, 2009.
Thanks for your patience.




  


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


Re: [Flashcoders] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Dave Watts
 I think you're right, but I saw one guy here at work writing something like
 this for readability he said!

 if (value != null) {
    ;
 } else if (value == null) {
    ;
 }

There's a difference between verbose and just plain dumb.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

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


Re: [Flashcoders] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Karl DeSaulniers
Can I get a copy of this thread in paperback? You can not find this  
stuff anywhere else in the world. I was actually going to ask where I  
could get some info on coding best practices and go buy a book, but I  
am glad I saved my money.


;)

Karl

Sent from losPhone

On Aug 18, 2009, at 4:58 PM, Patrick Matte  
patrick.ma...@tbwachiat.com wrote:


I think you're right, but I saw one guy here at work writing  
something like

this for readability he said!

if (value != null) {
   ;
} else if (value == null) {
   ;
}




From: Paul Andrews p...@ipauland.com
Reply-To: Flash Coders List flashcoders@chattyfig.figleaf.com
Date: Tue, 18 Aug 2009 22:17:05 +0100
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] How to add a DisplayObject into a  
container without

using addChild() method.

Dave Watts wrote:

snip
It really depends on the language. Since I'm moving (more or less)
from Java to AS3, more or less, I'm usually using explicit  
expressions

because that's what people do in Java. On the other hand, in the
ColdFusion code I've written, I usually use implicit Boolean
evaluation.

I don't think writing good code is related to languages, despite  
the
different constructs available between them. I think good coding  
style

is based on simple principles, and brevity or speed of coding is not
included.

Short coding constructs may be perceived as elegant and aid coding
speed, but that wholly misses the point - coding isn't a race nor is
optimising the number of bytes in the source code. Showing a deep
knowledge of a software language through use of the language in ways
that are not so clear to mere mortals less familiar with the  
language,
isn't good. It is rarely a good idea to optimise code by using a  
faster
programming construct that makes the intention of the code less  
clear.


Good coding should be clear - even for those less familiar with the
language. Truncated coding constructs may be efficient and even  
elegant,
but will they be easily understandable by someone else (or even the  
same
person much later)? Code minimalism can hide the true intention of  
the

code and introduce unintended behaviour when mistakes are made. When
code is expansive (verbose even) the intention of the code is clear.
When someone relies on some language behaviour for handling null  
values,
the reader may be left wondering whether the original developer  
really

intended that the code should handle nulls in this way, or is it some
accidental happenstance of using that construct? Are nulls really
relevant here in this code snippet or not. Testing specifically for
nulls is explicit and unambiguous.

Maintainability - truncated constructs can sometimes mean that  
changes
for updates mean undoing the efficient constructs that performed  
well

for specific case they were coded for, but will have to be ditched
completely for the more complicated case, leaving the  updater to  
unwind
the intention of the shorter construct and translate that to the  
wider case.


As far as fast coding goes, everybody likes a helpful ide or  
editor,

but really fast coders really aren't team coders and the need for
speed is less important than the need for clarity. I'm not a fast
coder. Sometimes I wish I was an even slower coder, because then I'd
realise I could code things rather better than going rushing in to  
get

things done.

I once worked with a guy who had a clear desk and often sat reading  
the

newspaper. It did attract some critical comment, but that guy had the
right idea. Before he started coding he spent a lot of time on the
design, getting that right. A faster code editor or fancy programming
wouldn't have made him a better developer. He spent most of his time
getting it right before his hands hit the keyboard. He was the best
developer I ever met.

So, in my insignificant opinion - brevity == BAD, fast coding ==BAD.

Paul


Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

___
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




This e-mail is intended only for the named person or entity to which  
it is addressed and contains valuable
business information that is proprietary, privileged, confidential  
and/or otherwise protected from disclosure.


If you received this e-mail in error, any review, use,  
dissemination, distribution or copying of this e-mail
is strictly prohibited. Please notify us immediately of the error  
via e-mail to 

[Flashcoders] maintainable code

2009-08-18 Thread Latcho

some great optimalistations can be found here:
http://mindprod.com/jgloss/unmain.html

for ex.

class Truth
  {
  boolean isTrue ( boolean assertion )
 {
 if ( assertion != false )
{
return assertion;
}
 else
{
return assertion;
}
 }
  }
...

var doIt:Boolean;

var trutherizer:Truth = new Truth();
if ( trutherizer.isTrue( s.equals( t ) ) )
  {
  doIt = true;
  }
else
  {
  doIt = false;
  }



// hint: all the above accomplishes is:
doIt = (s==t);

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


Re: [Flashcoders] Re: Sending 2 HTTP requests from a webchat-like app

2009-08-18 Thread Peter B
 Yes, a socket server would make my app easier to program,
 but it would also make it unusable for too many users
 (those behind corporate firewalls).


Does this help wrt tunnelling through firewalls? Seems to allow a
socket to be established on Port 80

http://www.blog.lessrain.com/as3-java-socket-connections-to-ports-below-1024/#comments
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Peter B
2009/8/19 Leandro Ferreira dur...@gmail.com:
 A good CODER must go beyond a good CODE be fast when needed. That's MHO, and
 It gets clear when we compare the number of lines we use to express
 ourselves.


Indeed. And you unintentionally help to illustrate the point. Paul's
post, though long, is clear in what it communicates. Your post is
brief, but I am finding it difficult to extract any meaning from it.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Taka Kojima
Writing readable code  writing less code.

That is what it comes down to. Most coders can understand both of the
following:

if(myObj){;}

and

if(myObj != null){;}

I would opt for the latter method always, as otherwise you are relying on
renderer specific logic to handle the conversion, as opposed to explicit
conversion.

I have actually spent an hr trying to debug an IE specific JS error, only to
find that even though implicit type conversion was working in other
browsers, it was throwing an error in a specific version of IE.

By your argument of less code  more code, this:

public function outputList():*{;}

would be better than

public function outputList():Array{;}

and AS2 would be better than AS3 on the whole basis that you didn't have to
typecast anything.

Just because a certain environment can convert types for you, doesn't mean
that you shouldn't typecast or not hint as to their object type in your
code.

Personally, I can type faster than I can think in code. I type really fast,
and I think code really fast, and typing out the extra 10 characters doesn't
hinder my productivity, it probably enhances it.

If you want to take the implicit convesion route, by all means I am not
going to stop you or object. However, I do and will always believe that it
is better for other people reading/working on your code that you do spell it
all out, use line breaks when it makes sense, and typecast all your
variables.

I think Dave's point was that you seemed rather authoritative, and this is
really a subjective matter.

- Taka

On Tue, Aug 18, 2009 at 6:02 PM, Peter B pete...@googlemail.com wrote:

 2009/8/19 Leandro Ferreira dur...@gmail.com:
  A good CODER must go beyond a good CODE be fast when needed. That's MHO,
 and
  It gets clear when we compare the number of lines we use to express
  ourselves.
 

 Indeed. And you unintentionally help to illustrate the point. Paul's
 post, though long, is clear in what it communicates. Your post is
 brief, but I am finding it difficult to extract any meaning from it.
 ___
 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] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Leandro Ferreira
That's plain bad english, I assure you :)A good CODER must go beyond a good
CODE and be fast when needed.



  Leandro Ferreira


On Tue, Aug 18, 2009 at 22:02, Peter B pete...@googlemail.com wrote:

 2009/8/19 Leandro Ferreira dur...@gmail.com:
  A good CODER must go beyond a good CODE be fast when needed. That's MHO,
 and
  It gets clear when we compare the number of lines we use to express
  ourselves.
 

 Indeed. And you unintentionally help to illustrate the point. Paul's
 post, though long, is clear in what it communicates. Your post is
 brief, but I am finding it difficult to extract any meaning from it.
 ___
 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] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Steven Sacks

Taka,

When you're done building your Straw Man, you let me know and I'll happily 
continue the discussion with you.


Cheers,
Steven


Taka Kojima wrote:

Writing readable code  writing less code.

That is what it comes down to. Most coders can understand both of the
following:

if(myObj){;}

and

if(myObj != null){;}

I would opt for the latter method always, as otherwise you are relying on
renderer specific logic to handle the conversion, as opposed to explicit
conversion.

I have actually spent an hr trying to debug an IE specific JS error, only to
find that even though implicit type conversion was working in other
browsers, it was throwing an error in a specific version of IE.

By your argument of less code  more code, this:

public function outputList():*{;}

would be better than

public function outputList():Array{;}

and AS2 would be better than AS3 on the whole basis that you didn't have to
typecast anything.

Just because a certain environment can convert types for you, doesn't mean
that you shouldn't typecast or not hint as to their object type in your
code.

Personally, I can type faster than I can think in code. I type really fast,
and I think code really fast, and typing out the extra 10 characters doesn't
hinder my productivity, it probably enhances it.

If you want to take the implicit convesion route, by all means I am not
going to stop you or object. However, I do and will always believe that it
is better for other people reading/working on your code that you do spell it
all out, use line breaks when it makes sense, and typecast all your
variables.

I think Dave's point was that you seemed rather authoritative, and this is
really a subjective matter.

- Taka

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


Re: [Flashcoders] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Latcho

Whoohoo, a lot of explicit coders here :D

Steven Sacks wrote:

Taka,

When you're done building your Straw Man, you let me know and I'll 
happily continue the discussion with you.


Cheers,
Steven


Taka Kojima wrote:

Writing readable code  writing less code.

That is what it comes down to. Most coders can understand both of the
following:

if(myObj){;}

and

if(myObj != null){;}

I would opt for the latter method always, as otherwise you are 
relying on

renderer specific logic to handle the conversion, as opposed to explicit
conversion.

I have actually spent an hr trying to debug an IE specific JS error, 
only to

find that even though implicit type conversion was working in other
browsers, it was throwing an error in a specific version of IE.

By your argument of less code  more code, this:

public function outputList():*{;}

would be better than

public function outputList():Array{;}

and AS2 would be better than AS3 on the whole basis that you didn't 
have to

typecast anything.

Just because a certain environment can convert types for you, doesn't 
mean

that you shouldn't typecast or not hint as to their object type in your
code.

Personally, I can type faster than I can think in code. I type really 
fast,
and I think code really fast, and typing out the extra 10 characters 
doesn't

hinder my productivity, it probably enhances it.

If you want to take the implicit convesion route, by all means I am not
going to stop you or object. However, I do and will always believe 
that it
is better for other people reading/working on your code that you do 
spell it

all out, use line breaks when it makes sense, and typecast all your
variables.

I think Dave's point was that you seemed rather authoritative, and 
this is

really a subjective matter.

- Taka

___
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] maintainable code

2009-08-18 Thread Juan Pablo Califano
This remainds me of a utility method written by a former coworker at my
previous job, that rightfully belongs in the daily WTF.

public static function mtd_validarVar (variable : Object) :Boolean
{
 if (
  variable == false  ||
  variable == undefined   ||
  variable == ||
  variable == null
  )
 {
  return false
 }else
 {
  return true
 }
}
Had he checked against 0, at least this method could have been used as a
generic replacement for the obscure and unreadable implicit boolean
coercion...

He also had the chutzpah to put this method in our core library, in a class
conveniently named VarUtils, so the whole team could benefit from it.

To add insult to injury, he had a very personal take on hungarian notation
and code formatting as well. Not to mention he was also in the tabs should
be 8 spaces here, there and everywhere, and if you and the rest of the world
use 4 spaces, rest asured I will reformat any such piece of crap as soon as
I get a chance to put my hands on it camp.
Nevertheless, he was a cool guy.

Cheers
Juan Pablo Califano

2009/8/18 Latcho spamtha...@gmail.com

 some great optimalistations can be found here:
 http://mindprod.com/jgloss/unmain.html

 for ex.

 class Truth
  {
  boolean isTrue ( boolean assertion )
 {
 if ( assertion != false )
{
return assertion;
}
 else
{
return assertion;
}
 }
  }
 ...

 var doIt:Boolean;

 var trutherizer:Truth = new Truth();
 if ( trutherizer.isTrue( s.equals( t ) ) )
  {
  doIt = true;
  }
 else
  {
  doIt = false;
  }



 // hint: all the above accomplishes is:
 doIt = (s==t);

 ___
 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] maintainable code

2009-08-18 Thread Keith H

WTF comes from trying to plan for worse case scenarios.
I did not write this. My doppleganger did  :)

var WorstCaseSenario:*= 0x00 ;
trace(toBoolean(WorstCaseSenario) == false);

function toBoolean(bool:*):Boolean
{
   if (bool ==  || !bool) {
   return false;
   }
   if (bool is Boolean == false) {
   bool=String(bool);
   }
   if (bool is String) {
   bool=String(bool).toLowerCase().replace(/^\s+|\s+$/mig,);
   if (/\d+|\dx\d+/.test(bool)) {
   if (Number(bool) == 1) {
   return true;
   }
   if (Number(bool) == 0) {
   return false;
   }
   }
   if (bool == true) {
   return true;
   }
   if (bool == false) {
   return false;
   }
   return false;
   }
   return bool;
}


-- Keith H --
www.keith-hair.net


Juan Pablo Califano wrote:

This remainds me of a utility method written by a former coworker at my
previous job, that rightfully belongs in the daily WTF.

public static function mtd_validarVar (variable : Object) :Boolean
{
 if (
  variable == false  ||
  variable == undefined   ||
  variable == ||
  variable == null
  )
 {
  return false
 }else
 {
  return true
 }
}
Had he checked against 0, at least this method could have been used as a
generic replacement for the obscure and unreadable implicit boolean
coercion...

He also had the chutzpah to put this method in our core library, in a class
conveniently named VarUtils, so the whole team could benefit from it.

To add insult to injury, he had a very personal take on hungarian notation
and code formatting as well. Not to mention he was also in the tabs should
be 8 spaces here, there and everywhere, and if you and the rest of the world
use 4 spaces, rest asured I will reformat any such piece of crap as soon as
I get a chance to put my hands on it camp.
Nevertheless, he was a cool guy.

Cheers
Juan Pablo Califano

2009/8/18 Latcho spamtha...@gmail.com

  

some great optimalistations can be found here:
http://mindprod.com/jgloss/unmain.html

for ex.

class Truth
 {
 boolean isTrue ( boolean assertion )
{
if ( assertion != false )
   {
   return assertion;
   }
else
   {
   return assertion;
   }
}
 }
...

var doIt:Boolean;

var trutherizer:Truth = new Truth();
if ( trutherizer.isTrue( s.equals( t ) ) )
 {
 doIt = true;
 }
else
 {
 doIt = false;
 }



// hint: all the above accomplishes is:
doIt = (s==t);

___
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


  



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