PHP Programming for Flash Builder Part 2 (17 Videos)

June 16, 2010

Lesson 2: PHP Control Logic, Functions, and Classes

In this lesson you cover Control Logic, Functions and Classes. And finally, you get to Flash Builder and created your first PHP-Flash Builder application in videos 27 through 31.

PHP Programming Lesson 2 Assignment

PHP Programming 16 If Else

PHP Programming 17 Logical Expressions and Date

PHP programming 18 Switch Case and Random

PHP programming 19 While Loops and Range

PHP programming 20 For Loops Shuffle

PHP programming 21 Foreach Loops and Shuffling Cards

PHP programming 22 Generating Passwords and ASCII

PHP Programming 23 Continue, Break, and Array Pointers

PHP Programming 24 Functions Part 1

PHP Programming 25 Functions Part 2

PHP Programming 26 OOP and Classes 1

PHP Programming 27 Classes 2 and Flash Builder

PHP Programming 28 Getting Flash Builder ready for PHP

PHP Lesson 29 Getting Flash Builder Talking to a PHP Class

PHP Programming 30 Flash Builder and PHP Data Wizard

PHP Programming 31 Flash Builder Random Password App

You can get the downloads from the PHP Training Site at

PHP Programming for Flash Builder Part 1 (17 Videos)

June 5, 2010


I’m moving forward with the PHP Programming series for Flash Builder. The first of 5 parts is done. You can view the training site at

Of course the final goal is a 3D content management system in PHP and Flash Builder. Also, the individual video links are given below  (code and notes can be grabbed from the website).

PHP Programming 1 Set Up

Installing Wamp

PHP Programming 2 PHP info

PHP Programming 3 Hello World

PHP Programming 4 Variables

PHP Programming 5 Strings

PHP Programming 6 String Functions

PHP Programming 7 Eclipse

PHP Programming 8 Simple Math

PHP Programming 9 Calculator

PHP Programming 10 Pythagorean

PHP Programming 11 Math Functions

PHP Programming 12 Form Letter

PHP Programming 13 Array Functions 1

PHP Programming 14 Array Functions 2

PHP Programming 15 Booleans

PHP Programming Assignment


Adding Shaders and Pixel Bender to Away3dlite

June 3, 2010

Adding Shaders

Once you’ve experienced the speed of Away3dlite you next want to bump up its appearance. The best way to do that is by using Pixel Bender shaders….and with Pixel Bender the sky is the limit! In this post, you get the code that let’s you do that, and you learn to add shaders and Pixel Bender to Away3dlite. The same approach is applicable to PV3D.

Here’s the demo

Shaders in Away3dlite

Shaders in C

Check out the video!

Download the Code

Read Some Discussion

The key to getting this to work was to first get all the shaders over into Away3dLite, then instantiating the ExLight example in Flash Builder and using switch case to create the different materials for your model.

Here’s what the switch case code looks like. It is really simple…everything else is in the video and the download…cheers!

override protected function onInit():void


var md2:MD2 = new MD2();

var light:Light = new Light();

var _texture:Bitmap = new Texture as Bitmap;

var _bitmap:BitmapData = new BitmapData(_texture.width, _texture.height, false);


var _normalMap:Bitmap = new Normal as Bitmap;



case 0: //Normal Shader

var rLight:DirectionalLight3D = new DirectionalLight3D();

rLight.direction = new Vector3D(1, 0, 0);

rLight.color = 0xFF0000;

rLight.ambient = 0.1;


var gLight:DirectionalLight3D = new DirectionalLight3D();

gLight.direction = new Vector3D(0, 1, 0);

gLight.color = 0x00FF00;

gLight.ambient = 0.1;


var bLight:DirectionalLight3D = new DirectionalLight3D();

bLight.direction = new Vector3D(0, 0, 1);

bLight.color = 0x0000FF;

bLight.ambient = 0.1;


var material:BitmapMaterial = new Dot3BitmapMaterial(_bitmap, _normalMap.bitmapData);

material.smooth = true;

md2.material = material;

md2.centerMeshes = true;


case 1: //Plane Material

/*var filter1:BevelFilter = new BevelFilter(10, 45, 0xFFFFFF, 0.5, 0×000000, 0.5, 10, 10, 50);

var filter2:GlowFilter = new GlowFilter(0xFFFFFF, 1, 50, 50);

var filter3:GlowFilter = new GlowFilter(0xFF0000, 1, 50, 50);


var planeMaterial:BitmapMaterial = new BitmapMaterial(_bitmap);

md2.material = planeMaterial;

md2.centerMeshes = true;


case 2: //Flat Shader

var myFlatShader:FlatShader = new FlatShader(light);

md2.material = myFlatShader;

md2.centerMeshes = true;

light.x=light.y =400;

light.z = -400;



case 3: //Phong Color Shader

var myPhongColorShader:PhongColorMaterial = new PhongColorMaterial(light, 0x00ff00);

md2.material = myPhongColorShader;

light.x=light.y =400;

light.z = -400;


md2.centerMeshes = true;


case 4: //Phong Shader

var myPhongShader:PhongMaterial = new PhongMaterial(light, _bitmap);

md2.material = myPhongShader;

md2.centerMeshes = true;

light.x=light.y =400;

light.z = -400;



case 5: //PBJ Filter

var mat:PBBitmapShader = new PBBitmapShader(light, _bitmap, _normalMap.bitmapData);

md2.material = mat;

md2.centerMeshes = true;

light.x=light.y =400;

light.z = -400;



case 6: //Shader

var mat2:PBTransparentShader = new PBTransparentShader(light, _bitmap, _normalMap.bitmapData);

md2.material = mat2;

md2.centerMeshes = true;

light.x=light.y =400;

light.z = -400;



case 7: //Shader

var myShader:VertexShaderMaterial = new VertexShaderMaterial(light, _bitmap);

md2.material = myShader;

md2.centerMeshes = true;

light.x=light.y =400;

light.z = -400;




trace(“Out of range”);



var loader:Loader3D = new Loader3D();

loader.loadGeometry(“assets/torsov2.MD2″, md2);

loader.addEventListener(Loader3DEvent.LOAD_SUCCESS, onSuccess);


camera.z = -200;



Get every new post delivered to your Inbox.