VR Panoramas > Advanced Interactivity 1 |
Advanced Interactivity 1 > > Controlling QTVR with Flash > Hotspot Interaction > Summary/Links |
Creating a Flash Compass using LiveStage Professional |
If you have problems viewing this, please click here. In the example above you should see a QuickTime panorama containing elements created in Flash. It was created using a piece of software called LiveStage Professional. This allows Flash content and interactive elements to be displayed with the panorama – the results are then exported as Quicktime movie. The result is a QTVR movie containing Flash tracks. For Macintosh users, in addition to LiveStage, there are other programs available to ‘wire’ Quicktime movies. One such example is VR Hotwires. With version 5 and upwards of Quicktime, 'wiring' in Quicktime allows sophisticated interactivity with Flash. The code, referred to as Qscript, can perform such tasks as setting variables inside the Flash track – for example, to control the ‘compass’ movie clip at the top-left of the example. Try looking around in the panorama. Notice the compass? It rotates as you drag. As you pan around, the compass should also turn so that it lines up. 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. So how does the compass work? In this case, the Quicktime VR pan angle (a value between 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. The communication goes both ways: 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 (this is very useful!). How do you make a wired Quicktime movie? This tutorial describes how the above movie was created. You can download the project file here. This includes the LiveStage project file (you will need LiveStage Professional 4 to open it), the original QTVR file and the Flash movie.
We won’t go into detail here, as this is not a Flash tutorial – more information can be found in the Flash section. Basically the Flash movie contains a static border layer ('bg') and the compass (“compass”), which has been converted into a movie clip. The movie clip looks like this: It's a two-frame loop in which both frames contain the following actionscript (it’s constantly running, frame by frame, “listening” for the ‘vPanAngle’ value); _rotation = _root.vPanAngle; This script sets the rotation property of the compass movie clip. As we mentioned there is a variable called vPanAngle, which gets its value from the Quicktime panorama (we will show how in Step 3 - wiring the 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 or MX – otherwise LiveStage will not recognise the file when you import it. This also means it is necessary to use a two-frame movie; it's no good using 'onClipEvent(enterFrame)' to execute looping code, as the Flash animations will then only work in Quicktime 6 (a common problem). 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.
To import Flash, the main length of the Flash movie must be set to the same length as the Quicktime movie being used (otherwise it will disappear when you go to a different node. A panorama will take up a certain number of sections on the timeline depending on the amount of nodes of the panorama.
Here we’re going to set a value in the Flash Track variable. “SetFlashVariable” is a great way to communicate between the Flash Track and QuickTime. This is useful for setting a variable in the Flash Track from QuickTime and having Flash test what that variable is, then performing actionscripts depending on the variable (as we covered in step 1). This is the piece of QScript code that passes the variable to Flash: TrackNamed("maptut").SetFlashVariable("","vPanAngle",TrackNamed("mapwire").PanAngle, False) In it we tell the track called "maptut" (the Flash movie) to set the variable vPanAngle to be the same value as the "panangle" of the QTVR track ("mapwire").
The movie can now be exported. It’s always a good idea to use the
“test”script And that’s it. A finished ‘wired’ QTVR. Simple, eh? |
Advanced Interactivity 1 > > Controlling QTVR with Flash > Hotspot Interaction > Summary/Links |
Richard England - July 2003 |