Using lineStyle to draw stroke without affecting the size of the holder container

Have you ever tried to use the graphics class to draw a rectangle with a lineStyle (stroke) and then set bigger width and height values for the container that holds the graphic? If so, you probably noticed that there is a size difference between a rectangle with lineStyle and a rectangle without lineStyle.

If you trace the width and height values of the container, everything seems to be fine. Only if you run and look at the SWF you’ll notice a visual difference between those two (top image).

Read more
Using ExternalInterface and JS to make an Expandable Flash Banner

Expandable Banner – How to make it and embed it into your HTML page without affecting the rest of the page.

Today I helped a friend who needed an expandable banner embedded into a news website. At first, I had the instinct to searching on Google and giving him an URL or something where he can read more about this. To my surprise, none of the info I got through search engines was relevant or complete for this specific subject.

This led me to create an example and now I want to share that example with those searching for how to make an expandable Flash banner.

Read more
Greetings Card Flash Application

I have worked on this application for a few months and now I see it’s finally implemented into greetingsisland.com.

The project was for two Flash applications, Cards and Invitations, both very similar with very few different features.

It lets you make your own greeting card and invitation design. It’s great looking and easy to use, especially for kids. After you’ve made the perfect greeting, you can either print it on your home printer or save it as a PDF file.

The development itself was demanding and very rewarding, as I got to use techniques like singleton pattern, I’ve used the Facebook API to retrieve photos from Facebook albums and I’ve learned some new coding styles from my friend Biro Barna.

Go on, check it out and let me know if you like it 😉

AlivePDF download and save to server

Today I found myself needing to implement AlivePDF into a project that needs to generate a PDF, save it on the server and download it to the user’s computer.

Since I didn’t find any information about how to do this (and I found some other people trying to find out how it’s done) I thought I should give it a try. I posted the final result below if someone else needs to know how to both save the PDF file on the server and download it to the user’s computer.

ActionScript 3 AlivePDF code:

_pdf.save(Method.REMOTE, "save.php", Download.ATTACHMENT, "MyFile.pdf");

PHP code that will save the file on the server (inside a specified folder) and save it to the user’s computer too:

<?php
 
if(isset($GLOBALS["HTTP_RAW_POST_DATA"])){
	$pdf = $GLOBALS["HTTP_RAW_POST_DATA"];
	$name = $_GET["name"];
	$save_to = "pdf/". $name;
	file_put_contents($save_to, $pdf);
 
	// add headers for download dialog-box
	header('Content-Type: application/pdf');
	header('Content-Length: '.strlen($pdf));
	header('Content-disposition:'.$method.'; filename="'.$name.'"');
	echo $pdf;
 
} else{
	echo "Encoded PDF information not received.";
}
?>
Convert values within a range to values within another range

Today I’m sharing with you a little utility that I find myself using a lot lately. This utility is a value convertor that you can use in those times when you need to make a volume slider or something similar where you’ll need to change a value and a value range.

package com.vamapaull.utils
{	
	public class ValueConvertor
	{
		public static function convertRange(originalStart:Number, 
							originalEnd:Number, 
							newStart:Number, 
							newEnd:Number, 
							value:Number):Number
		{
			var originalRange:Number = originalEnd - originalStart;
			var newRange:Number = newEnd - newStart;
			var ratio:Number = newRange / originalRange;
			var newValue:Number = value * ratio;
			var finalValue:Number = newValue + newStart;
			return finalValue;
		}
	}
}
Control a Flash Game with your iPhone

Some programmers from Germany developed a great Flash game that uses your iPhone/iPod Touch to control the game actions.

The concept is very interesting and I could see this being applied on lots of old-school arcade games that are ported to Flash.

After learning about WebSockets we were eager to build a website around this technology. As we are a bunch of oldschool nerds it was obvious to transform the iPhone into a gamepad controlling a Flash Website.

Source: WeekendContent.com