QTVR Flash Compass Tutorial

Dec 28, 2001

Please note that this movie is broken if you have Quicktime 7.3 or later installed.
Although it may not look like it, the circular graphic above is in fact a Quicktime VR panorama. A Flash track has been added to give it a circular frame. If you click and drag on it, the Quicktime VR cursor appears and you can pan the movie.

Notice something else? Yes, the Flash compass is rotating as you drag. As you pan around to 90 degress, the compass should also turn so that it lines up at 90 degrees. This is all one self-contained movie. Since Quicktime supports the playback of Flash content, you can embed Flash as a track in a Quicktime movie.

How does this work? With Quicktime 5 or later, wired actions make it possible to pass values from the Quicktime VR track to the Flash track. In this case, the Quicktime VR pan angle (0-360), which is setting a variable in Flash which in turn controls the rotation property of the Flash compass graphic.

Passing Quicktime parameters to Flash is one of three basic operations you can implement between Quicktime and Flash. As well as sending values from Quicktime to a Flash track, you can go the other way; you can set values in Flash and send them to a Quicktime track. You can also make events in Quicktime, such as clicking a hotspot, trigger actions associated with a button in the Flash track.

How do I make a wired Quicktime movie? This movie was made with the help of VRHotWires,a program which adds wired actions to QuickTime panoramas. This tutorial describes how the above movie was created.

Step 1: Wire Up The Pano.

Open the panorama in VRHotWires and open the script window. Copy this script into the window and click "Script to Movie".




Save the movie. The movie is now wired.
This script will set the value of a variable named "vrpan" to the value in degrees of the panorama. The variable belongs to Flash movie clip named "revolver".

But the Flash movie does not exist yet. Open Flash, and import the panorama that has just been wired.

Step 2: Add The Flash.
First of all, make sure you add enough frames to the timeline to fit the Quicktime movie, in this case, 48 frames;



Anything else that's on the timeline needs to be 48 frames long as well, no more, no less. In this case, a static border layer ('bg') and the compass graphic which has been converted into a movie clip are the other layers. On the layer labelled 'mc', there is an invisible movie clip whose job it is to control the rotation of the compass.

The movie clip is named 'revolver', and looks like this;




It's a two-frame loop in which both frames contain the following actionscript;

setProperty ("../compass", _rotation, 360-vrpan);


In Flash MX or later, the same thing can be accomplished using an actionscript attached to the movie clip instance itself;

onclipEvent(enterFrame){
this._rotation = 360-vrpan;
}


This sets the rotation property of the compass movie clip. Notice the variable 'vrpan', which gets its value from the Quicktime panorama. Bear in mind that Quicktime 5 only supports Flash 4. Be sure to select 'Flash 4' in the publish settings if you're using Flash 5. This also means it is necessary to use a two-frame movie; it's no good using 'onClipEvent(enterFrame)' to execute looping code, otherwise the Flash animations will only work in Quicktime 6.

Each movie clip instance on the stage must have a name. Without this the Flash movie won't know where the messages coming from Quicktime are supposed to go.

Export the movie as Quicktime, selecting the vr controller option. You shouldn't need to change any of the other default/auto settings. The movie is now complete.

Comment On This Post

Comments are moderated by the site admin. It's nothing personal - just trying to keep out the spam. Any reasonably relevant comment will probably be published.

Posted By;
Comment;
Are You Human? If so enter the code;