[Flashcoders] VizAlign 0.6 is now open source (alignment utility)

2012-04-04 Thread Ktu
hey list.

i hope it is ok to plug my own code, but i finally made
VizAlignopen source
under the MIT license. it's an awesome extendable utility for
alignment of DisplayObject || Rectangle

here is a modified snippet of the readme file on github:


align your graphics the way you see it.

VizAlign is a powerful, extendable, actionscript 3 alignment utility that
allows you to *vizually align* DisplayObject. it is a new way of thinking
about aligning, and will forever change your alignment habits. when you
position something, you expect it to end up where you envision it; VizAlign
helps you do that. the core is so extendable i never run out of new feature
ideas. documentation is something i see as vital so i hope the information
you find here is helpful to working with VizAlign.


powerful api:

each alignment you want to happen will need the objects you want to move
(targets) a stationary object (targetCoordinateSpace) and an object
(aligner) that will place the targets in relation to the
targetCoordinateSpace.

the main function you will use is:
VizAlign.align ( [targets], [alignments], ignoreOrigins, applyResults,
pixelHinting ):Array;

targets: array of DisplayObject you want to align (or VizAlignTarget)
alignments: array of VizAlignment which specify how to align the objects
ignoreOrigins: if true, VizAlign will ignore the origin/registration point
of the object and align purely based off the graphics contained
applyResults: if true, VizAlign will actually set the x,y,width,height of
the targets to the end calculations
pixelHinting: if true, VizAlign will round all calculations with
Math.round();
return: Array of VizAlignTarget who containt the target, its original
dimensions and resulting dimensions

features:

   - *natural api*: i want to align these [targets] to the [left of the
   stage].
   - *40* alignments (and more coming!)
   - align Rectangle || DisplayObject
   - *extend*-able framework
   - returns results for *animation* or storage
   - *group*-ing!


VizAlign.align ([logo], [new VizAlignment (new CenterAligner(), stage)],
true, true, true);

try reading the one liner above out loud like a sentence. if you can learn
to think of your alignments like that, VizAlign will be a breeze and you’ll
want to raise your arms and just expel the stress into the wind. *ahhh.*

show me:

come on up, relax, and take a look at the capabilities swf, which will let
you play around with VizAlign, get used to how it works, and learn all the
alignments available!
 VizAlign capabilities
[swf+video]

thank you


-- 
Ktu;

The information contained in this message may or may not be privileged
and/or confidential. If you are NOT the intended recipient,
congratulations, you got mail!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] IExternalizable

2012-04-04 Thread Hans Wichman

Hi list,

I'm running into some weird serializing behavior.
Please check this class:

package sampleobjects
{
import flash.utils.IDataInput;
import flash.utils.IDataOutput;
import flash.utils.IExternalizable;

/**
 * Simple object with default constructor, one private
 */
public class Object6 implements IExternalizable
{
private var property1:String = null;

public function Object6 (pProperty1:String = null)
{
property1 = pProperty1;
}

/* INTERFACE flash.utils.IExternalizable */

public function writeExternal(output:IDataOutput):void
{
trace ("Writing object 6");
output.writeObject (property1);
}

public function readExternal(input:IDataInput):void
{
trace ("Reading object 6");
property1 = input.readObject();
}

}

}

If I serialize this class in a sharedobject, "writing object 6" is 
printed twice.

If I make the property1 an integer, it is only printed once.

Seems the flash player is doing the output twice for anything more than 
literal fields, did anyone run into that before?


tnx
JC

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