How to position a plane:
- Optional: Create more planes
- Position the planes by setting the x, y, or z property of the plane
- Optional: Spin the plane
[flv:http://flexyouras.com/tutorials/Papervision3D/05_Positioning_Planes/05_Positioning_Planes.flv 632 532]
How to spin a camera:
- Change the Camera3D to a FreeCamera3D
- Use the yaw(), pitch(), or roll() camera methods in your ENTER_FRAME handler
- Render the scene
[flv:http://flexyouras.com/tutorials/Papervision3D/04_Spinning_The_Camera/04_Spinning_The_Camera.flv 632 532]
How to rotate a plane in Papervision3D using the yaw() method
What to watch for:
- Make the plane global
- Add a listener for ‘Event.ENTER_FRAME’ (previously known as onEnterFrame) with a callback to loop3D
- Use the yaw() method of the plane to rotate 5 degrees each time ‘loop3D()’ is called
- Render the camera
- optional: Make the color material ‘double sided’ if you want to see both sides of the plane when it rotates
[flv:http://flexyouras.com/tutorials/Papervision3D/03_Rotating_A_Plane/03_Rotating_A_Plane.flv 612 508]
How to add a plane with a color material to a Papervision3D scene:
What to watch for:
- Create a color material
- Create a plane (and apply the color material)
- Add the plane to the scene
[flv:http://flexyouras.com/tutorials/Papervision3D/02_Adding_A_Plane/02_Adding_A_Plane.flv 604 508]
This video tut is the first in a series of Papervision3D tutorials.
In this tutorial we will create an empty Papervision3D scene:
What to watch for
- Create a container, a scene, and a camera
- Center the container on the stage
- Render the camera
(I’m using FlashDevelop so all classes will be automatically imported. As you can see towards the end, I accidentally import a class which I have to delete.)
[flv:http://flexyouras.com/tutorials/Papervision3D/01_Setting_Up_The_Scene/01_Setting_Up_The_Scene.flv 604 508]
What to watch for
- When embedding the font, the source= line is the path to the font in relation to your project folder. In this case, the font is in the root of the project folder sitting alongside EmbeddingFonts.mxml. That’s why I only had to write ‘MICKEY.ttf’.
-
private var mickeyFont:Class; is only there so the compiler will link in the font.
-
The ‘fontName’ (‘mickey’) within the embed tag has to be the same as the ‘fontFamily’ within the style tag.
- The name of the style inside the style tags (‘mickeyStyle’) is what you use to reference the style from the ’styleName’ property of your component.
View the EmbeddingFonts.mxml
Download the MICKEY font (originally from dafont.com)
A short example outlining the use of dispatchEvent to send an event from a custom component to the main application (this video assumes you know the basics of creating custom Flex components :
View the CustomComponentEvents.mxml
View the myPanel.mxml
Here are the basics of getting a movieclip out of the library and onto the stage using a custom Actionscript class. The key point is to import the linkage name you assigned the movieclip in the library (in this case, “Box”) to make it accessible in within the class. You can then assign whatever properties you want to it (in this case, x and y):
Download the .fla
Download the Document Class
This video shows the basics of setting up a Document Class for your Flash CS3 .fla:
Download the .fla
Download the Document Class
Video Preview
This video shows a simple Flex states example where buttons on two different panels switch between “state1″ and “state2″.
View SimpleStates.mxml