Home

Archive » April, 2009 «

Flash CS4 Papervision example

Tuesday, April 07th, 2009 | Author:

This post is mainly to cover some of the questions often asked and give a simple download to try out.

The Papervision examples here were compiled using the Flex SDK and FlashDevelop so there are no .fla’s used. But as the examples are AS3 classes the conversion to using in Flash can be made so here is one download with a few usage ideas.

It was made in Flash CS4 and can be viewed here and the source can be downloaded here. It uses the very simple PlaneDemo class without editing it and the recent Papervision classes Papervision3D_2.0.883.zip from here are included in the zip.

Some things to note:
- The first line of the PlaneDemo class is
package com.dehash.pv3d.examples.basic
so the PlaneDemo class is stored in the following location
com/dehash/pv3d/examples/basic/PlaneDemo.as

- PlaneDemo.as is used as the document class and set in the Publish Properties pane which is one of the ways to use the class in Flash because PlaneDemo extends BasicView which extends AbstractView which extends Sprite.

- the Papervision classes are stored in the libs folder and that directory is added to the Source path using the Publish Settings > Flash tab path > Settings dialogue.

PlaneDemo.as includes the following Metadata
[SWF(width="800", height="600", backgroundColor="0xffffff")]
Flash CS4 is able to read this and implement it whereas the CS3 IDE was not. There is an article that covers this here

At some point I shall put up a more interesting example than PlaneDemo but it does cover many of the essentials despite being quite basic. The pop up view of the swf is displayed using shadowbox.

Category: Code Examples, Flash, Papervision 3D | One Comment