Labs

It works in my machine!

Strategy Pattern

with one comment

Strategy Pattern is my favorite one, and why?
because it’s so simple for implamentation; it’s based on polymorphism, an the basic idea is to encapsulate the code that you think is gonna change.

for example let’s say that you have and Encryptor Class:

Read the rest of this entry »

Written by Raúl

December 14th, 2009 at 7:28 pm

Posted in General

Tagged with , ,

More on Regular Expressions!

without comments

i was trying to understand what’s happening behind scenes in the Log Class in Flex Framework
if you digg a little bit in their Classes you’ll find something like this

1
2
3
4
5
6
7
8
9
10
11
12
13
                public function debug(msg:String, ... rest):void
		{
			if (hasEventListener(LogEvent.LOG))
			{
				// replace all of the parameters in the msg string
				for (var i:int = 0; i < rest.length; i++)
				{
					msg = msg.replace(new RegExp("\\{"+i+"\\}", "g"), rest[i]);
				}
 
				dispatchEvent(new LogEvent(msg, LogEventLevel.DEBUG));
			}
		}

so what’s means msg = msg.replace(new RegExp(”\\{”+i+”\\}”, “g”), rest[i]); ??????
that means whenever you find “{0}” …. “{n}” replace it by the string rest[0] … rest[n]

so you can use

1
2
Log.debug("the song says {0} little {1} little {2} little-endians" , 'zero','one','two');
//outputs:  the song says zero little one little two little-endians

for me is so hard to read a Regular Expressions especially because i always forget
all means of meta characters and meta secquencies hehehe

Written by Raúl

December 14th, 2009 at 6:05 pm

Posted in AS3, General

Tagged with

Signals

without comments

Robert Penner shows to the world his new Event System called Signals
it’s a cool way for managing Events in AS3 inspired by C# events and signals/slots in Qt.

Concept

  • A Signal is essentially a mini-dispatcher specific to one event, with its own array of listeners.
  • A Signal gives an event a concrete membership in a class.
  • Listeners subscribe to real objects, not to string-based channels.
  • Event string constants are no longer needed.

Features

  • Remove all event listeners:
  • Retrieve the number of listeners
  • Listeners can be added for a one-time call and removed automatically on dispatch:
  • Any object type can be dispatched to listeners. But using IEvent will enable full functionality.
  • A Signal can be initialized with an event class that will validate event objects on dispatch (optional):
  • If the Signal’s event class is specified, each listener is checked on add() to ensure it declares at least one argument.
  • Signals can be placed in interfaces to indicate the events dispatched by a class.
  • Events can bubble recursively through .parent independent of the display list (experimental).
  • Code was developed test-first.

Sintax

comparison:

1
2
3
4
5
// with EventDispatcher
button.addEventListener(MouseEvent.CLICK, onClick);
 
// Signal equivalent; past tense is recommended
button.clicked.add(onClicked);

Create a Signal for a class:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
////// in Item class:
// Recommended: make the signal read-only.
protected var _ready:Signal;
public function get ready():Signal { return _ready; }
 
public function Item()
{
	_ready = new Signal(this, ReadyEvent);
}
 
protected function sendReady():void
{
	_ready.dispatch(new ReadyEvent());
}
 
////// in another class:
var item:Item = new Item();
protected function onItemReady(e:ReadyEvent):void { ... }
 
item.ready.add(onItemReady);

more info on Signals

AS3 Signals Getting Stronger
The Community Responds to AS3 Signals
My New AS3 Event System: Signals

more info on AS3 Events

My Critique of AS3 Events – Part 1
AS3 Events – 7 things I’ve learned from community
My Critique of AS3 Events – Part 2

i like this kind of people, never comfortable, always trying to make improvements, changing the way we see things and Robert Penner is not and exception.

Written by Raúl

October 13th, 2009 at 1:24 pm

Posted in AS3

Tagged with ,

FlashDevelop Plugins

without comments

Today we just found two great plugins for FlashDevelop

first: Reopen closed tab plugin
just press Ctlr + Shift + T and your last closed tab would be open again (firefox style! XD)

second: FlashdevelopPMD
integrates the new flexPMD from Adobe Labs to FlashDevelop

FlashDevelop is a great tool for coding and of course is our “battle horse” here at GrupoW

enjoy it!

Written by Raúl

September 15th, 2009 at 1:31 pm

Posted in General

Sound Pitch

with 2 comments

i was talking with Caleb (the sound expert here at Grupow) a few days ago about how the Pitch works behind the scenes
i saw a great usage of the Pitch effect in Braid Game and i wanted to give a try in the Flash’s new Sound API
…………. but then Andre Michelle came with this!!!

man………. that guy is crazy.

Written by Raúl

July 22nd, 2009 at 2:16 pm

Posted in General

Conways Game Of Life

without comments

is an old AS2 experiment that i made some time ago

the rules are:

1. Any live cell with fewer than two neighbours dies, as if by loneliness.
2. Any live cell with more than three neighbours dies, as if by overcrowding.
3. Any live cell with two or three neighbours lives, unchanged, to the next generation.
4. Any dead cell with exactly three neighbours comes to life.

Conways Game Of Life

download the source files and and try different grid inputs

Written by Raúl

July 22nd, 2009 at 1:59 pm

Posted in General

Playing with Pixels

without comments

i was just playing with pixels and BitmapData
the code is a little messy and is not optimized

at the end we didn’t use it on production but is a really nice mouse trial
hope you like it!
source files

Written by Raúl

July 22nd, 2009 at 1:13 pm

Posted in AS3, General

Tagged with

Mouse Trap

without comments

ppiiiiuuuuuf! it’s been a whilee uh!!

now that we release the Energy Lab we have some time to post something!
if you go there you’ll find a really cool mouse effect
and here is a quick prototype in AS2 of how we build it

mousetrap

(just try to get inside of the box)

source files

Written by Raúl

July 21st, 2009 at 2:15 pm

Posted in General

Grupow is hiring!

with 2 comments

Location: Saltillo, Coah. Mexico

Position: Flash ActionScript/Flex developer

Information:

Mandatory technical skills:

• 3+ years experience in ActionScript 2.0 or 3.0 for Flash applications integrated with server-side web applications and CMS
• Papervision knowledge
• Experience implementing OOP concepts with ActionScript
• Experience integrating streaming media
• Building integrated data-driven applications
• Source control

Communication skills:

• Outstanding problem-solving and communication skills
• Available to work in-house during work hours – Monday - Friday
• Team player and leadership skills

Ideal additional skills:

• SWF address
• AIR
• Experience in building social networking and community systems, which include context and video tagging, streaming media and other advanced online communication features

Desired additional skills:

• Experience in PHP/MySQL
• CMS experience

To Apply:

Please send a copy of your CV with portfolio and examples of sites directly to rcalderon@grupow.com

Written by Raúl

May 27th, 2009 at 11:15 am

Posted in General

Flash CS4 update (10.0.2)

with 2 comments

yei!!! finally the desired update arrived ! =D
no more crashes for bad fonts =D

you can read the full list of changes at: swfgeek
by the way is a huge list!!

and more info at: Richard Galvan post

Written by Raúl

May 14th, 2009 at 11:42 am

Posted in General