This blog isn't maintained anymore. Check out my current project, an agile/scrum management tool.

Monday, January 28, 2008

When a circle isn't a circle...

See that shape on the end of the line?  That's a circle.  At least it's supposed to be.  

graphics.drawCircle(center.x, center.y, size);


There's no scaling on it.  It's drawn on whole pixel boundries with a whole pixel size.  A couple pixels bigger and it looks fine.  I have no idea why the lower right side is "dented" at this size.  It's not a clipping issue.

Sunday, January 27, 2008

Spam backscatter troubles + SPF

So some spammer somewhere is forging random rogue-development.com addresses as the return email address for the email they send out.  Many many many addresses that spammer is sending to are generating bounces.  

I catch all @rogue-development.com email and forward it to my gmail account.  This lets me make up email addresses on the fly whenever I feel like it.

None of this should be a problem because well behaved mail servers should reject unknown recipients during the initial SMTP session.  I don't get bounce back messages from them.

But many mail servers (qmail for one) don't do this.  Instead they generate a brand new bounce message and send it to the "From" email address.  This means those bounce messages get sent to my server which then forwards them to my GMail.

Apparently when GMail receives 30 or  40 thousand emails for the same user within a day, it starts deferring new emails.  So now I'm 8 or 12 hours behind from someone sending me email to me getting it...  Not to mention it's a real pain to sort out the half dozen or so real emails from the 30,000 bad emails.

So for now I've turned off my catch-add email addresses, added in some header checks to reject some of the backscatter, and am waiting for everything to settle down.

I hate spammers.

Those challenge/response spam things are really pissing me off as well.  People who use those rely on others to do spam filtering, but yet they generate spam themselves due to the backscatter problem.  I'm really tempted to publish those email addresses on a page that will get spam-crawled.

Some information:

SPF
I also went ahead and set up SPF for all of my domains.  This is a system where you publish what mail servers are valid to send mail for your domain through the DNS system.  In theory, it would stop all forged email addresses.  Unfortunately, very few mail servers on the receiving end respect SPF.  Maybe it'll help a little bit.

Saturday, January 26, 2008

Don't center popups

When placing popups, the Flex PopupManager class gives a great method called centerPopup. But please, don't use that. Rarely do you actually want a popup centered. It's often times much more visually pleasing to above there.  I like placing the top of the popup around 20% of the height of the application.

A centered popup:



A popup at 20% from the top:


Of course this isn't a hard-set rule.  Sometimes you want your popup in other locations.  For instance, if it was triggered by a toolbar at the bottom of your application it makes no sense to force the user to mouse that far up.

Here's a quick method to place that popup, I register my main application component on startup, but you could easily pass that in or use a stage reference instead.  This method won't work well if you popup is too tall.


public class PopupPositioner
{
public static var mainApp:UIComponent;

public static function centerPopUp(popup:UIComponent) : void
{
popup.x = mainApp.width / 2 - popup.width / 2;
popup.y = mainApp.height / 5;
}
}

Friday, January 25, 2008

Pulse particles update

New build of Pulse Particles is posted, added an option to limit the number of particles that are emitted by an emitter.  Use this to create "bursts" instead of continuous particle effects.  The particle explorer has been updated as well as the flash component.

A new example is done.  This one shows that you can manipulate the parents of the particles to make the entire particle system move around.






Code for the example follows, weighing in at a paltry 69 lines.


package
{
import caurina.transitions.Tweener;

import com.roguedevelopment.pulse.emitter.GenericEmitter;
import com.roguedevelopment.pulse.simple.SimpleParticles;

import flash.display.Sprite;
import flash.events.Event;
import flash.events.TimerEvent;
import flash.utils.Timer;

[SWF(backgroundColor="#000000", frameRate="60", width="500", height="350")]
public class StarPower extends Sprite
{
protected var containers:Array = [];
protected var timer:Timer;
protected var ease:int = 0;

[Embed(source="example_assets/star.png")]
protected var star:Class;
[Embed(source="example_assets/spark.png")]
protected var spark:Class;
[Embed(source="example_assets/snowflake.png")]
protected var snow:Class;

public function StarPower()
{
super();

addEmitter(star,10);
addEmitter(snow,5);
addEmitter(spark,15);

stage.scaleMode = "noScale";
onTimer(null);
timer = new Timer(5000);
timer.addEventListener(TimerEvent.TIMER, onTimer );
timer.start();
}

protected function addEmitter( image:Class, pps:Number ) : void
{
var container:Sprite = new Sprite();
addChild(container);
var emitter:GenericEmitter = SimpleParticles.createEmitter({pps:pps,x:100, image:image, y:100, width:1, height:1,size:15, color:2588900, movement:true, minSpeed:63.3, maxSpeed:353.6, minAngle:0, maxAngle:360, minScale:0.2, maxScale:1, lifespan:3140} ) as GenericEmitter;
emitter.root = container;
emitter.start();
containers.push(container);
}

protected function onTimer(e:Event) : void
{
for each( var container:Sprite in containers )
{
animateContainer( container );
}
}

protected function animateContainer(container:Sprite) : void
{
var eases:Array = ["easeinoutsine","easeoutcirc","easeoutback","easeoutbounce","easeoutelastic"];
var scale:Number = Math.random() + 0.05;
ease++; ease %= 5;
Tweener.addTween( container, { y:Math.random() * 350, x:Math.random()*500, scaleX:scale, scaleY:scale, time:5, transition:eases[ease] });
Tweener.addTween(container, {rotation: Math.random() * 360, time:5, transition:eases[ease] }) ;
}
}
}

Text size & zooming nightmares

I'm working on a flex project where text gets put inside a box that the user can manipulate. Getting that box to autosize to the text, has been a little difficult.  

But I finally got that working.

Another software requirement is that the user can zoom in/out. I was doing this just by changing the xScale/yScale of the parent container. It all works great.

Except for some very specific text/font combinations. The damn text field wraps differently at different zoom levels. This video shows that:

http://screencast.com/t/ccM1bvCuY2

The font, text, and box size remain constant through that entire thing but at anything less than 100% zoom the text wraps to two lines. I assume it's because of some sub-pixel antialiasing changing the text dimensions depending on zoom or something.

Arghhhhhh

I think I might give up and just take a bitmap of the text and scale that.

Sunday, January 20, 2008

Egads! Another Pulse Particle update

Yet another build posted. This one fixes a memory leak and now the flash component has a visual indicator (blue circle) of where the emitter is during design mode (disappears during runtime). No more hunting for the emitter!

Two new examples on tweening & masking effects posted.  Source for those are in the "source" download on google code.

Also fixed a bug with emitters who's parents were removed from the display list not being removed themselves.

If you're interested in helping...

I could use new rules for the Pulse particle system that define particle behavior not yet implemented. The other parts of the system are still under heavy development so they may not be the best to try to contribute to yet.

I'd also like to link to any new demos you create with this system, so send them or a link to them in.

Saturday, January 19, 2008

New Pulse Particles build

There's a new build of Pulse Particles posted.

There's a new rule implemented, "BoundingBoxRule". This will cause particles to bounce within a box. there's an option for specifying the box position/size in the particle explorer, the SimpleParticles interface is updated, and the Object Orientated interface is up to date as well, so everyone can enjoy bouncing particles.

Particle emitters no longer have to be a point source. You can specify a width & height to emit particles along. This has also been added to the particle explorer.

All the internal angles have been transitioned from degrees to radians. A lot less computation is taking place now. The external API's still take degrees, so there shouldn't be any code changes for users.

Gravity works completely different now. Before it was applying a y-offset to simulate gravity. Now it actually changes angle/speed. This gives a more realistic gravity and allows the rotateToAngle option to work with gravity effects.

The jitter when using PointSwarm or MousePointSwarm is gone.

Friday, January 18, 2008

XRayViewer is back

The download is back online, I got it ported to the latest air.

XRayViewer is an AIR application that lets you load a swf and then examine that swf using XRay. You don't need to modify the loaded swf in any way.

Wednesday, January 16, 2008

My Time

Over the past week my free time has been split up roughly between...

Pulse Particle System 70%
Agile Agenda 10%
Writing a book 10%
Other 10%

Unfortunately, it probably should have been more like

Pulse Particle System 10%
Agile Agenda 20%
Writing a book 30%
Other 40%

Particle effects are just too damn fun to play with.  

So I think I'll be taking a few days off from Pulse and concentrating on the other things on my list.  (Especially "other" since that's mostly wife related)

Another example & new build of Pulse Particles

I just uploaded a new build of PulseParticles.  This adds a new parameter to the MovieClipEmitter called "rootEffect".  If set to true, the particles will be created on the root stage object, otherwise they get created on the parent clip like normal.  I found this useful when tweening an emitter around the stage, but not having the particles move with the emitter.  This causes the particles to leave a trail.  Look for the star effect in this new demo since it shows exactly that off:





Please upgrade your flash version.


Tuesday, January 15, 2008

Pulse Particle Update + New Example

There's an update to the Pulse Particle system available on the download page.

And here's an example that shows off some of the capabilities. My examples tend to suck since I'm not a good designer/artist. If you play around with Pulse Particles and create anything interesting please send it over and I'm happy to host or link to it. The example shows off 4 simple effects, my favorite of them is the green bubbles.







This update brings three things.
  1. Most of the jitter in the particles is gone.
  2. If you place a particle emitter within a MovieClip, then the particles will be made on that clip. That means you can use a mask to determine where those particles will appear. You could also animate or add filters to that clip. This really opens up a lot of the power of Flash for controlling how the particles are displayed.
  3. Acceleration / Deceleration is now implemented (and it's in the explorer as well)
The download src file now has the .fla files I used to make the .mxp package.

And ASDocs are now posted automatically whenever I make a new build, go to the project page to find them.

Friday, January 11, 2008

Pulse Particle Explorer introduction

The other day I posted a video showing how to use the Pulse Particle system in Flash. Now, here's an introduction on how to use some of the particle explorer functions to define particle behavior.

Explorer introduction - Part 1
Explorer introduction - Part 2

You can find the Pulse Particle project page here:
http://rogue-development.com/pulseParticles.html

There were several requests in my last blog post on how people could help out. Check out the new contribute page on my site. There things for all levels of technical knowhow there.

Labels: , ,

Wednesday, January 09, 2008

Pulse Particle System + Flash IDE

I did a bit of work to see what I could do to get a workflow with the Flash authoring environment and the Pulse particle system working. I got it to a point where I can download, install, and show a quick example of how to use it in a 4 minute video. Not too bad.


Some more links:
The particle system itself is still a bit rough, there's a bit of choppiness here and there that I need to work out, and there's a bunch more options (like acceleration) I'd like to tackle. That, and a bit more on the documentation side would be nice.

Update, Here's a nice demo from the comments below. It has an animated movieclip as a particle and looks pretty cool.

Labels: ,

Monday, January 07, 2008

AgileAgenda - New Version

Posted a new version of AgileAgenda over the weekend.  Fixed a few minor bugs, redesigned the opening screens, and put in our new logo.  The entire initial user experience should be better now.   Here's a quick glimpse of what it looks like now:



Labels: , , ,

Friday, January 04, 2008

Synergy2 - Multiple computers, one set of input devices

I've run across far too many people who have two sets of keyboard/mice that they use on a regular bases. There is a solution to this, and it's called Synergy.

Just download it, install it on a couple computers, and you can share a single keyboard/mouse across them. They don't even have to be the same platform, I'm right now typing on my OSX laptop through a keyboard plugged into my desktop PC. It works over any IP network. If you have the monitors next to each other you can even mouse between them just like a dual headed display. If you have to switch monitors to view different computers, you can set up a hotkey to do switch your input target.

(This is not a monitor sharing / KVM solution)

Only problem is it ain't encrypted, so be careful if your on a public network. There's ways to pipe it through an SSH tunnel if that's an issue for you.

Thursday, January 03, 2008

Pulse Particle system interactive explorer

I just whipped up a quick flex app to explore some of the features of the Pulse Particle system I've been working on lately.


1) Various configuration options for the particles
2) The resulting config-object that those options make, you can pass that to SimpleParticles to create the effect in your application.
3) A live preview of the particle effect

The demo only has a handful of rules in it, but they show off a good chunk of the possible functionality you can get from the SimpleParticles interface. One of the biggest limitations of the explorer is there's only a few images embedded for you to make particles out of.

To use one of these particles in your app, do something like this:


import com.roguedevelopment.pulse.simple.SimpleParticles;
import com.roguedevelopment.pulse.PulseEngine;

...

PulseEngine.instance.root = this;
SimpleParticles.createEmitter( {pps:10,x:153, y:286,image:spark,
movement:true, minSpeed:199,
maxSpeed:216, minAngle:211,
maxAngle:219, minScale:0.8,
maxScale:1, pointSwarm:[100,100], lifespan:5000} );



where the argument to createEmitter comes from #2 above.



You can play with it yourself at:
http://rogue-development.com/pulse/explorer/#

If you make any cool looking effects, copy & paste the config object to a comment to share with everyone.

Labels: , ,

Wednesday, January 02, 2008

Pulse Particle System

Here's a little project I've been meaning to get to for a while. A general purpose particle system for AS3.

http://rogue-development.com/pulseParticle.xml











It's not done yet, but you can read about it, see some examples, and download the source on the project page.