Flash Pro tutorial: Create an anaglyphic 3D game in Flash

Step 2 Select the MovieClip Scene (by clicking on it once) and give it an Instance Name of ‘scene’ in the Properties panel (if this is not visible, select Window > Properties). Click Edit > Edit Selected to work inside that MovieClip, and create a new layer for the graphics (Insert > Timeline > Layer).

Step 3 In the Library panel, open the Cast folder by clicking the small triangle adjacent to it.

Add a ‘backdrop’ MovieClip. Drag it into the work area, and position it using the outline to ensure full coverage. In the Properties panel, name this MovieClip ‘backdrop’. Continue this process for all the other Cast MovieClips, giving each a unique name as you go along.

Step 4 Publishing now you would produce a blank SWF, as the content is out of view. So click Edit > Document to return to the root timeline. Click on the Code Layer, then click Window > Actions to bring up the ActionScript editor. 

It’s now time to get coding. If you get lost, don’t worry – in the AnaglyphSceneComplete project in the Download Zone, you can find the finished code with explanatory text by each part.

We now want to create a blank bitmap so enter this script:

var bmpScene:Bitmap=new Bitmap(newBitmapData(scene.width,scene.height,true,0));

Next, a copy of the scene will be drawn to the bitmap by you entering: 


At this point you can add the image to the Stage by entering:


Note: We may earn a commission when you buy through links on our site, at no extra cost to you. This doesn't affect our editorial independence. Learn more.

Read Next...