UStream Not Live

Archive for the ‘Tutorial’ Category

Box2DFlash – Falling Text

August 25th, 2009

I'm so excited that I finally got to work on some experimental Flash at my professional employment. It is a nice change of pace to push an idea to the limits...and then some. In fact, I'm still not done working on the possibilities. This was only the starting point. Making text fall. Tie it into the Box2DFlash Physics Engine.

I want to give yet another shout out to Emanuele Feronato. If you are looking at this code, and are completely lost, he has EXCELLENT tutorials to get you started. Thats where I ended up taking my first steps in Box2DFlash.

Now in the guise of learning. I don't intend on going too indepth with the code...there is a lot going on. But hopefully, by breaking it down into phases, you can understand my building process. Something like this isn't accomplished in one chunk of code. It is build up by steps. At least the way I code. Read the rest of this entry »

LaserDraw – multitouch extension

July 28th, 2009

Now feels like a good time to get back into it. Especially coming across this site:

asluv

laserdraw1Sure, it doesn't seem like there has been many recent posts. It can be hard juggling a life around experimenting. It doesn't make it any less awesome when you see something and get inspired. Here is what I found, a AS3 script that would not just draw a line, but so nice ribbon curving and add a glow around everything automatically. It is just begging to be multitouchable (that sounds a little dirty now that I think about it).

http://asluv.com/2007/09/18/laser-draw-as3-experiment/

"This experiment uses the AS3 drawing methods to generate an organic mask formed by several pairs of points linked with curveTo.

The generated shape masks a simple radial gradient and the result has a GlowFilter and a DropShadowFilter applied to it."

It works great, no doubt about it. But the source is there, we can take it a little further. Now I got a lot further than expected working on it, and the night is starting to get late, so I'm going to try and condense the main ideas I want to remember that are the most useful.

Download Multitouch Source Code

Read the rest of this entry »

Multitouch Magnifier – AS3 experiment

June 2nd, 2009

Fire up the SVN, there's an new experiment to check out.

multitouch magnifier - AS3 from Chris Yanc on Vimeo.

If you don't have all the files, you can find them here: http://code.google.com/p/multitouchas3experiments/source/checkout

For this one, you are going to need Flash CS3 or CS4 as far as I know. I don't know how FlashDevelop or Flex will translate. We will be using assets from the Library which are linked to AS files. I'm thinking it'd be best to go through the files. Read the rest of this entry »

Quick 3D fun

May 25th, 2009

I do like the Flash and Math website. Is it a great place to find some tutorials and examples for actionscript. One in particular I'd like to point out is building a simple 3d cube, without needing APIs like Papervision. But, you will need to be able to compile SWF files with Flash 10 capabilities.
Read the rest of this entry »

Understanding RotatableScalable.as

May 7th, 2009

The is something powerful at your disposal in the touchlib library for AS3. It is called RotatableScalable.as

Now, it is a bit messy. And there is code in there that doesn't really need to be, but it is a Great place to start if all you want is to Drag, Scale and Rotate MovieClips. Unfortunetly, it's not without bugs to work through. Lets do a really quick test in Flash. Read the rest of this entry »

Fractals, Multi-touch and Flash

April 29th, 2009

fractalsIt has been a while. But thanks for returning. I'm all situated with the move and now I'm feeling refreshed and ready to return to a little experimenting. So I thought I'd come back strong with something really visual.

Fractals!

The quickest explination I can think of is. Fractals are create by using recursion to run the same drawing function, but for every iteration length and thickness decreases a little. Right off the bat, I want to confess that recursion has to be my least understood topic when it come to programming. Though the idea doesn't sound too hard, reloop through the same function a certian number of times. Read the rest of this entry »

Touch Explosions

April 11th, 2009

Particle Emitter from Touch Down Events

Read the rest of this entry »

PaintCanvas.as to SimpleDraw.as

April 7th, 2009

colorlinesTonight, I decided to look into some of these core files you can find in the Touchlib Library. If you haven't tried it out yet, there is a LOT of powerful stuff in there, but to me it seems rather tucked away. You need to open up the file and just read them to see what they intend to do. Then you can start to simplify.

Now the paint canvas file is used in the AS3\src\deploy\Paint.swf file. It give you a nice palette of color to choose from and uses Filters to blur and fade out and disperse the lines/dots as you draw them. Fact is that you are just dropping dots along a path to create the lines in the file.

Looking at that file, I wanted to pull out the most basic part. And maybe try to change it a little bit. So I don't really want to bring in the color picker, only the touch drawing part. And I want to change that to put down a random color for each time I get a new touch point. Read the rest of this entry »

Add, Move and Remove MovieClip from Library via Touch Point

April 3rd, 2009

thumbI received a request on my Blob Lines Tutorial from Simplex

I just want to put a Movieclip under each blob, move each Movieclip when blobs move AND remove the Movieclip when blob is away

Simple, right? Well not at first for me. This is something I've been trying to work out for a while. What is a clean solution to pull a MovieClip from the library dynamically onto the stage...keep tracking that MovieClip with the one specific blob...then remove it when that blob is removed. And I must say, I was scratching my head on this one for a while. I would get to the point of removing the MC, and it would all fall apart from the way I thought I should work. Read the rest of this entry »

Super Simple Multi-Touch Flash Drag

March 24th, 2009

-- Perhaps Too Simple

I was looking through all the TUIO files when I came across something interesting. In TouchEvents.as, there is a variable called 'relatedObject,' what did that mean I thought. So I opened up a new file and figured out how to run a trace on it. Low and behold, relatedObject will return whatever object it is touching. I knew this also when I touched the screen and the normal full sized black square I put on my files immediately followed my touch.

2 Lines of code! dragging accomplished, what?! Well, a little more than 2 lines (^_^), you need all the other code to hook in TUIO and add an event listener. So i tried putting just a bunch of random movie clips (not just shapes because they would be all created on the same level) on the stage. Each MovieClip could be moved independently, it's activated when the touch point moves and it'll snap the MovieClip's anchor point to the center of the touch point, but it's not without its issues. A few times when i dragged a MovieClip over another movie clip it'll connect to the one at the highest level. But it was something I stumbled across I though was worth sharing.

Name your AS file: SimpleDrag.as
Put into this folder structure: app/demo/MyTouchApp
In flash, set your Document Class to: app.demo.MyTouchApp.SimpleDrag

package app.demo.MyTouchApp{
 
	import flash.events.TUIO;// allows to connect to touchlib/tbeta
	import flash.events.TouchEvent;// allows to use TouchEvent Event Listeners
	import flash.display.*;
 
	public class SimpleDrag extends Sprite {
 
		public function SimpleDrag():void {
			//--------connect to TUIO-----------------
			TUIO.init(this,'127.0.0.1',3000,'',true);
			addEventListener(TouchEvent.MOUSE_MOVE, moveUpdate);//run moveUpdate, when any touching point is moved
 
		}
		public function moveUpdate(e:TouchEvent):void {
			trace("moved: "+e.ID+" related to: "+e.relatedObject.name);
			e.relatedObject.x = e.localX;
			e.relatedObject.y = e.localY;
		}
	}
}

Updated in my Google Code SVN page as well.

Happy Experimenting.