ImTOO FLV Converter

ImTOO FLV Converter is a professional FLV video converter software to convert FLV to AVI, MP4, DivX, etc. It is also a video to FLV converter to convert AVI to FLV, MP4 to FLV, WMV to FLV video format. Likewise, it can convert audio files such as MP3 to FLV and SWF audios as a FLV audio converter.

ImTOO FLV Converter helps you convert Flash video (FLV) to all types of videos for playback on portable media devices. It is able to:Convert FLV to MP4, FLV to AVI, FLV to WMV/MOV/DivX/3GP; Convert AVI to FLV, MP4 to FLV, MKV to FLV, MOV to FLV, etc.

With ImTOO FLV Converter, you can conveniently upload the output FLV videos to YouTube.com and other video websites, and enjoy MP4 videos converted from your desired YouTube FLV videos on iPod, PSP, iPhone, and WMV videos on Xbox.

Quick Tip: How to use your microphone in AS 3.0

Hello again and thanks for all messages. But please, no more SPAM. Well, let’s get back to our bussines, today I’ll present to you a new Quick Tip: How to use your microphone in AS 3.0. A few months ago I posted something about How to use your camera, and now you will learn how to play with your microphone.

The code is not hard at all, I’m sure that you will understand immediately. But if you have any questions please contact me or leave me a comment:

 
package
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Sprite;
	import flash.geom.Rectangle;
	import flash.media.Microphone;
	import flash.utils.setInterval;
 
	public class Mic extends Sprite
	{
		private var microphone:Microphone;
		private var volumeBar:Bitmap = new Bitmap(new BitmapData(100,10,true));
 
		public function Mic()
		{
			this.addChild(volumeBar);
			microphone = Microphone.getMicrophone();
			microphone.setLoopBack(true);
			microphone.setUseEchoSuppression(true);
			setInterval(show,30);
		}
 
		private function show():void
		{
			with(volumeBar.bitmapData)
			{
				fillRect(new Rectangle(0,0,100,10), 0x00000000);
				fillRect(new Rectangle(0,0,microphone.activityLevel,10),0xff00ff00);
 
			}
 
 
		}
	}
}

As you can see this is not only a simple exemple. In this code a have a rectange that measure the sound intensity recorded by microphone. The show function draw the rectangle and make him to oscilate depends of sound intensity.

Box2D 2.1a Lesson 2(Tutorial)

Hi readers, this is the second lesson about Box2d, a very powerfull engine, not only in flash. If you missed the first lesson, then you will not understand what I am gonig to do here. So, please go to the : Box2D 2.1a Lesson 1(Tutorial). If you already seen the first tutorial then it will be much easier to understand.

As you know, I promised last time that in the second lesson I will put some graphics on our SWF file. Please be ready beacause in this tutorial we will actualy see something in our project.

So let’s see what we will doing today, this is the final result:

Interesting or not? :)

Now let’s look a bit at the source code. I don’t think is so hard, given that in the first tutorial I tried to explain very good, and I think that a many of you guys out there allready understand. Well, this is the code:

package
{
	import Box2D.Collision.Shapes.b2PolygonShape;
	import Box2D.Common.Math.b2Vec2;
	import Box2D.Dynamics.b2Body;
	import Box2D.Dynamics.b2BodyDef;
	import Box2D.Dynamics.b2DebugDraw;
	import Box2D.Dynamics.b2FixtureDef;
	import Box2D.Dynamics.b2World;
 
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
 
	[SWF(width="550", height="400", frameRate="30", backgroundColor="#333333")]
 
	public class Main extends Sprite
	{
		private var _world:b2World;
 
		private var _gravityX:Number = 0;
		private var _gravityY:Number = 9.81;
 
		private var _block:b2Body;
		private var _blockX:Number;
		private var _blockY:Number;
 
		private var _btn:MovieClip = new MovieClip();
 
		private static const RATIO:Number = 30;
 
		public function Main()
		{
			// Set up the world
			setupWorld();
			//Create the floor
			createF();
			//Create the Block
			createB();
 
			setupDraw();
 
			//ENTER_FRAME
			addEventListener(Event.ENTER_FRAME, onEnterFrame);
 
			// Draw button
			setBtn();
			// Reset Position
			_btn.addEventListener(MouseEvent.CLICK, onClick);
		}
 
		private function setupDraw():void
		{
			var sprite:Sprite = new Sprite();
			addChild(sprite);
 
			var b2DD:b2DebugDraw = new b2DebugDraw();
			b2DD.SetSprite(sprite);
			b2DD.SetDrawScale(RATIO);
			b2DD.SetFlags(b2DebugDraw.e_shapeBit);
			b2DD.SetLineThickness(2);
			b2DD.SetFillAlpha(0.6);
 
			_world.SetDebugDraw(b2DD);
			_world.DrawDebugData();
		}
 
		private function setupWorld():void
		{
			var gravity:b2Vec2 = new b2Vec2(_gravityX, _gravityY);
			var ignoreSleeping:Boolean = true;
 
			_world = new b2World(gravity,ignoreSleeping);
		}
 
		private function createF():void
		{
			var floor:b2Body;
			var floorDef:b2BodyDef;
			var floorShape:b2PolygonShape;
 
			floorDef = new b2BodyDef();
			floorDef.position.Set(275 / RATIO, 400 / RATIO);
			floorDef.type = b2Body.b2_staticBody;
 
			floorShape = new b2PolygonShape();
			floorShape.SetAsBox(250 / RATIO,10 / RATIO);
 
			var fixtureDef:b2FixtureDef = new b2FixtureDef();
			fixtureDef.shape = floorShape;
			fixtureDef.density = 1.0;
			fixtureDef.friction = 0.8;
			fixtureDef.restitution = 0.3;
 
			floor = _world.CreateBody(floorDef);
			floor.CreateFixture(fixtureDef);
 
		}
 
		private function createB():void
		{
			var blockDef:b2BodyDef;
			var blockShape:b2PolygonShape;
 
			blockDef = new b2BodyDef();
			blockDef.position.Set(300 / RATIO,  10/  RATIO);
			blockDef.type = b2Body.b2_dynamicBody;
 
			blockShape = new b2PolygonShape();
			blockShape.SetAsBox(25 / RATIO,25 / RATIO);
 
			var fixtureDef:b2FixtureDef = new b2FixtureDef();
			fixtureDef.shape = blockShape;
			fixtureDef.density = 1.0;
			fixtureDef.friction = 0.8;
			fixtureDef.restitution = 0.3;
 
			_block = _world.CreateBody(blockDef);
			_block.CreateFixture(fixtureDef);
 
		}
 
		private function setBtn():void
		{
			with(_btn.graphics)
			{
				beginFill(0xcccccc,1)
				drawRect(25,25,25,25)
				endFill()
			}
			addChild(_btn);
			_btn.buttonMode = true;
		}
 
		private function onClick(e:MouseEvent):void
		{
			_block.SetSleepingAllowed(false);
			var position:b2Vec2 = new b2Vec2(275 / RATIO, 0 / RATIO);
			var angle:Number = (Math.random() * 360 ) * Math.PI / 180;
			_block.SetPositionAndAngle(position,angle);
 
		}
 
		private function onEnterFrame(e:Event):void
		{
			_world.Step(1 / 30 ,10, 10);
			_world.ClearForces();
			_world.DrawDebugData();
			trace(_block.GetPosition().y);
		}
	}
}

You can now play with the gravity, density, friction, restitution, etc and you can see what each can do. If you have any questions please leave a comment or contact me, I will try to answer to any question. See ya next time.

Box2D 2.1a Lesson 1(Tutorial)

Box2D 2.1a Lesson 1(Tutorial)

Hello again, this is the first lesson for teaching Box2D. Don’t worry is not so hard, and if you realy like physics, is hard not to like what Box2D can do. You need to know that Box2D is in origin a Physics Engine for C++ programing. So you will see that are a lot of differences betwen writing code in pure AS 3.0 for a real object move, and writing code for a real object move in Box2D. But, let’s stop talking, and see how this engine works.

If we want to do an object that moves, we first need to create a World, is exactly  like in our lifes. This World need to have gravity and need to know if he will igone or not static bodies. We will see later how will this look in a code.

Like I said this engine works like the real word, so he don’t work in PIXEL(this is very important, for you to know), this engine works in METERS. Again this is very important, you will see later how to make an application on a monitor that works in pixels.

In Box2D of course  we will work with objects. Let’s see how we will make an object:

Those are only the basic things that we will use, but are enough for making an object. In future lessons we will talk more about other interesting things that you will learn.

After you read this, you are ready to understand how this application works. For this first lesson I made a very very very simple application. We will make an object and put him to fall into space with a gravity of 9.8 meters per seccond.

You won’t be able to see anything graphic for this project, you will be only able to see Y coordinate for our block that will fall down. I know that this is not very fun for you, and I’m sorry for that, but I promise that in the next lesson , I will show you how to make a graphic for your object.

Code:

package
{
	import Box2D.Collision.Shapes.b2PolygonShape;
	import Box2D.Common.Math.b2Vec2;
	import Box2D.Dynamics.b2Body;
	import Box2D.Dynamics.b2BodyDef;
	import Box2D.Dynamics.b2FixtureDef;
	import Box2D.Dynamics.b2World;
 
	import flash.display.Sprite;
	import flash.events.Event;
 
	public class Main extends Sprite
	{
		private var _world:b2World;
		private var _block:b2Body;
		private static const RATIO:Number = 30;
 
		public function Main()
		{
			//// Set up the world
			createWorld();
			//Create the Block
			createB();
			// Give this World some life
			addEventListener(Event.ENTER_FRAME, onEnterFrame);
		}
 
		private function createWorld():void
		{
			// Set up the gravity
			var gravity:b2Vec2 = new b2Vec2(0 , 9.8);
			// Tell the world to ignore sleeping objects
			var doSleep:Boolean = true;
 
			_world = new b2World(gravity, doSleep);
		}
 
		private function createB():void
		{
			var blockDef:b2BodyDef;
			var blockShape:b2PolygonShape;
 
			blockDef = new b2BodyDef();
			blockDef.position.Set(300 / RATIO, 0 /  RATIO);
			blockDef.type = b2Body.b2_dynamicBody;
 
			blockShape = new b2PolygonShape();
			blockShape.SetAsBox(20 / RATIO,25 / RATIO);
 
			var fixtureDef:b2FixtureDef = new b2FixtureDef();
			fixtureDef.shape = blockShape;
			fixtureDef.density = 1.0;
			fixtureDef.friction = 0.8;
			fixtureDef.restitution = 0.3;
 
			_block = _world.CreateBody(blockDef);
			_block.CreateFixture(fixtureDef);
 
		}
 
		private function onEnterFrame(e:Event):void
		{
			_world.Step(10,10,10);
			_world.ClearForces();
 
			trace(_block.GetPosition().y);
		}
 
	}
}

Let’s take a look again in this code, we have 3 private variables. The first one represents the World, the second one the body, and the last one help as to convert pixels to meters. As I said at the begining, Box2D works in meters.
After that I create the world function -createWorld- . I think this is clear I give the world a gravity of 9.8 on Y, and I set the world to ignore sleeping objects. On the -createB- function, I creat our body, I give him a position:

blockDef.position.Set(300 / RATIO, 0 /  RATIO);

and a form (Width and Hight):

 blockShape.SetAsBox(20 / RATIO,25 / RATIO);

Now, let’s see if your block is falling down or not. As you can see I have a -trace- statement at the end of the code, that will show as the Y coordinate for our block. Let’s test this and see what kind of result we will obtain.
Box2D
As you can see our result is exactly as I expected. As you can see, my block is falling. And he will not stop because in this world that we created we don’t have any other objects that can interact with him. So, because of that he will fall continuously.

That was the first lesson about how to get started with Box2D. I hope you enjoy this, and see you soon at the next tutorials. THANKS.

Box2D 2.1a Lesson 2(Tutorial)

Contact Form in AS 3.0 with PHP Tutorial

Hi, today I found a very nice -PSD Contact Form - and with that design I made a very simple contact form with PHP. Is not very hard to understand. Bellow is an image with the contact form design, and all the Instance Name that I use:
Contact Form in AS 3.0

Step 1

Download that PSD file, or make your own design for this Contact Form Project, open Adobe Flash Professional, make a new ActinScript 3.0 Project and importat the PSD file, or make there a new design. If you want to use my code, name your TextFiled as mine.  All your TextFields  are  INPUT.

Step 2

Now let’s get started with coding. This is the code:

package
{
	import flash.display.Sprite;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	import flash.net.URLVariables;
	import flash.net.URLLoaderDataFormat;
	import flash.net.URLRequestMethod;
 
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.text.TextField;
 
	public class index extends Sprite
	{
		private var loader:URLLoader = new URLLoader();
		private var req:URLRequest = new URLRequest("contact.php");
		private var variables:URLVariables = new URLVariables();
 
		public function index():void
		{
			option();
			init();
		}
 
		protected function option():void
		{
			loader.dataFormat = URLLoaderDataFormat.VARIABLES;
			req.method = URLRequestMethod.POST;
 
			name_txt.tabIndex = 0;
			company_txt.tabIndex = 1;
			email_txt.tabIndex = 2;
			msg_txt.tabIndex = 3;
 
			button.buttonMode = true;
 
		}
 
		protected function init():void
		{
			button.addEventListener(MouseEvent.CLICK, onClick);
		}
 
		protected function onClick(e:MouseEvent):void
		{
 
			variables.senderName = name_txt.text;
			variables.senderEmail = email_txt.text;
			variables.senderMsg = msg_txt.text;
			variables.senderCompany = company_txt.text;
			req.data = variables;
			loader.load(req);
		}
	}
}

Step 3

Our ActionScript Project is ready, because we need this to work , all that we need now is a PHP file, a file that will actualy send uor message to a mail address.

So, PHP:

<!--?php
$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
if(empty($_POST['senderEmail'])){
	echo"no email address found";
	exit;
}
$senderName		= $_POST['senderName'];
$senderEmail	= $_POST['senderEmail'];
$senderCompany	= $_POST['senderCompany'];
$senderMsg		= nl2br($_POST['senderMsg']);
$sitename		= "Your Site Name";
$to 			= "office@flashdesign-store.com";
$ToName 		= "Your Name";
$date 			= date("m/d/Y H:i:s");
$ToSubject 		= "Email From $senderName via $senderEmail";
$comments 		= $msgPost;
$EmailBody 		= "A visitor to $sitename has left the following message<br /-->
              	Sent By: $senderName @$senderCompany
 
				Message Sent:
 
$senderMsg
 
";
$EmailFooter	= "
Sent: $date
 
";
$Message 		= $EmailBody.$EmailFooter;
$ok = mail($to, $ToSubject, $Message, $headers . "From:$senderName &lt;".$to."&gt;");
if($ok){
	echo "retval=1";
}else{
	echo "retval=0";
}
 
?&gt;

Now, this is ready, put your project on a server and you’ll see that it will work. But edit this PHP file with your own details.

Download
Downloaded 99 times