Posts Tagged ‘flash’

My very first flash game.

Thursday, May 6th, 2010

I was just cleaning up some folders and found an old school project. Here is the first flash game that I’ve ever done. It was part of the class “Multimedia Programming” that i took in early 2003. It is a super simple snowboard game. Use your arrow keys to control the snowboarder and try to collect the points and avoid the trees. It’s a really rough prototype and i never completely finished it but it’s fun!

Flash Files, Domains and Security Errors (Oh My)

Tuesday, March 16th, 2010

To provide a better user experience, we often use content delivery solutions at Big Spaceship, like Limelight or Akamai, to host bigger files and reduce load time. (Although this cuts into the user’s time spent watching pretty loaders.)

During a recent project, we ran into a couple of security errors loading external module.swf files from a different domain than main.swf. The idea was to have a basic framework in main that controls IN and OUT animations of the modules and have all additional functionality in the module.swf itself. All loaded swf files extended Big Spaceships StandardInOut Class to be controllable from the main file, so we could easily cast the loaded modules.

(more…)

MathUtils.findPreferredRatio

Friday, August 14th, 2009

Ever had the problem to shrink a picture so that it fits into a Box that has a specific width and height?
Here is a really nice and very useful method that helps finding the needed ratio:

/**
 * The <code>findPreferredRatio</code> method is used to find the correct ratio to fit content in a container using a maximum area.
 *  
 * @param $width		Number
 * @param $height		Number
 * @param $maxWidth		Number
 * @param $maxHeight	Number
 * @return 
 * 
 */
public static function findPreferredRatio($width:Number, $height:Number, $maxWidth:Number, $maxHeight:Number):Number
{
	var dw:Number = $maxWidth/$width;
	var dh:Number = $maxHeight/$height;
	return dw < dh ? dw : dh;
}

Example:

var pic:Bitmap = new Bitmap(new BitmapData(1000, 1000, false, 0));
var ratio:Number = MathUtils.findPreferredRatio(pic.width, pic.height, 280, 180);
pic.width *= ratio;
pic.height *= ratio;
trace(pic.width+'x'+pic.height); //output: 180x180

Just another Flash IDE – Flex/Flash Builder workflow

Tuesday, July 7th, 2009

The usual flash sites that we build at Big Spaceship contain tons of huge graphics, animations, dynamic motion, videos, timeline transitions as well as tons of code, utilizing huge open source libraries like papervision 3d, tweening engines and so on.

We want everyone to be able to use their preferred design/dev environment to ensure a fast way to produce innovative high quality work. That includes using the Flash IDE and still being able to use Flex/Flash Builder as a developer. (more…)

FITC Toronto 2009 Link Dump

Monday, May 11th, 2009

We went to the FITC conference in Toronto last week and had a blast. There was a good vibe all around and we had a lot of fun. To pass along all the good stuff we saw we generated a big FITC link dump featuring links to speakers, presentations and presented work we liked.
(more…)

Legal Age Verification with Actionscript

Saturday, February 14th, 2009

Found this useful “Legal Age Verification” – codesnippet on ricardocabello’s blog.

var legalAge : int = 18; // or 21
 
var userDOB : Date = new Date(year,month-1,day);
var today : Date = new Date();
 
var diff : Date = new Date();
diff.setTime( today.getTime() - userDOB.getTime() );
 
var userAge : int = diff.getFullYear() - 1970;
 
if (userAge >= legalAge)
	trace("lets get pissed!");	
else
	trace("go away!");

3D vs. 3D

Thursday, February 12th, 2009

We were curious if we could run a simple test that quickly compares the new Flash10 3D capabilities and Papervision3D.

We are totally aware of the fact that Flash 3D and all other 3D engines like Papervision3D or Away3D are very different approaches.
The Question is more: Flash10 3D or Papervision3D for simple 3D features on a site?

Our quick and dirty test is to create 1000 rectangles, randomly place them in 3D space, animate it a bit and see what is faster.

(more…)