Object VR in Flash MX
A detailed tutorial on building an easy-to-use QuickTime Object VR player for Flash MX - without the QuickTime plugin.

01 Introduction
02 What should the QTVR player do? / How should the player be structured?
03 Useful reading / Designing the player
04 Loading your QuickTime Object VR movie
05 What have we got so far? / Stopping the spin
06 What is the mouse doing over the image?
07 Moving to the left of the image / Combining the formulas
08 Making the driver handle any movie length / Making the code simple
09 Using the Object VR player
10 What about a loader for this?
11 Conclusion / About the authors / Copyright
Previous << What should the QTVR player do? / How should the player be structured?
Useful reading
Our Object VR player will be a self-contained SWF file with your video file of a rotating object embedded in it. The movie will need to be imported a little later on in this tutorial, so now would probably be a good time to have a quick look at how to import video into Flash MX. You will find it in "Using Flash > Using Imported Artwork and Video > Importing video" in the contents of your online help. Be sure to read the whole section – you never know what might be useful!
We will also be mucking around with the frame rate of the Object VR player. See "Using Flash > Working in Flash > Using the Property inspector to change document attributes" in your help file for more info.
Testing the movie that we are developing will also be a strong part of this tutorial. In this case we will be focussing on the Output window. You'll find it here "Using Flash > Testing a movie > Using the Output window" in the contents of your online help, but you can read the whole "Testing a movie" section if you want.
The last thing you should check out is the trace() ActionScript command. You'll find it here "ActionScript Dictionary > T > trace" in the contents of your online help. Learn to love the trace, and use it fearlessly.
Designing the player
First, we are going build a container Movie Clip for our Object VR player.
Start Flash MX and create a new file. Save it and call it something that relates to your site. We picked "spin-me.fla".
Rename Layer 1 to qtvr.
Now, create a Movie Clip symbol, name it appropriately. We called it "qtvr". This is where we will import our QuickTime Object VR movie and place our controlling ActionScript.
The next step is to create our layers as follows:
The actions layer is for the mighty stop() command. The driver layer will hold our dummy movie (a movie that doesn't really do anything) so that we can put an enterFrame event handler on it. And the mov layer is for the QuickTime Object VR movie that we will import soon.
Go back to the "Scene 1" root. Open the Library window (F11) and drag the qtvr Movie Clip that we just created on to the stage.
Save it at this point.
Next >> Loading your QuickTime Object VR movie
01 Introduction
02 What should the QTVR player do? / How should the player be structured?
03 Useful reading / Designing the player
04 Loading your QuickTime Object VR movie
05 What have we got so far? / Stopping the spin
06 What is the mouse doing over the image?
07 Moving to the left of the image / Combining the formulas
08 Making the driver handle any movie length / Making the code simple
09 Using the Object VR player
10 What about a loader for this?
11 Conclusion / About the authors / Copyright
© 2003 Glasson Murray Group Pty Ltd (ACN 098 651 542), Western Australia. All rights reserved. |