Archive for the 'Learnings' Category

Writting Comments

Friday, May 20th, 2005 by Luis

Mike Clark explains how to sniff out stinky code and write comments that count. Do you prefer write code that speaks by itself or write a lot of comments?…

Write Sweet-Smelling Comments (found via design-nation).

Path problems when loading flv’s into NetStream object

Thursday, May 19th, 2005 by Thomas

When loading flv’s into a NetStream object Flash seems to use a different base-path than normally.

Read the rest of this entry »

Flash: asfunction and Scope to Class instances

Tuesday, May 17th, 2005 by Luis

I just started to use a lot the lessrain.lib.text.DynamicTextField to handle different types of textfields and textformatting.

There are some cases where I have to use asfunction together with the Proxy Class in order to make a call back to the class instance.

When a Class uses a TextField by composition the asfunction call is going to scope to the TextField’s host MovieClip. With the help of the Proxy we can resolve this , calling the asfunction on the parent of the host mc.

I feel like posting an example of how to use the DynamicTextField Class, the Proxy Class and asfunction in one single sceneario.

Read the rest of this entry »

Flash: removeTextField

Wednesday, May 11th, 2005 by Luis

Sometimes you have to remove a text field that wasn’t created with MovieClip.createTextField() like in my case today.

Well, I found a dirty way to perform such operation just making the MovieClip.swapDepths method accessible from the TextField:

Read the rest of this entry »

Flash: Split sound Class

Monday, May 9th, 2005 by Luis

This is not new, but I haven't seen much people using the advantages of the setTransform object of the Sound api in flash. The flash player has a 8 track limitation, but we can extend the number of independently mixable channels up to 16 (8 stereo sound objects) using the settransform object.

In the example below I have two sounds in the library and 4 independent tracks as a result of split the channels with setTransform:

[flash]http://www.blog.lessrain.com/wp-content/upload/example.swf,397,123[/flash]

Read the rest of this entry »

Flash: Interface

Friday, May 6th, 2005 by Luis

This is probably one of the best articles about the definition and use of Interface in OOP written by a non-professional programmer.

What is interface ?

Dynamic TextFields with system font

Friday, April 29th, 2005 by Thomas

When creating dynamic TextFields with embedFonts=false - especially when modifying an existing project for not-embeddable charactersets like chinese - and things don't look the way they're supposed to, check the following...

Read the rest of this entry »