VR Panoramas > Advanced Interactivity 1

Hotspot Interaction

Another level of interaction can be experienced when you roll the mouse over a hotspot. As the mouse passes over them, a flash animation is triggered. This technique can also be used to display an information box or animated icon over a point of interest in a panorama making them much more obvious.

When the mouse passes over a hotspot, a wired event is triggered in Quicktime, which can feasibly grab the coordinates of the mouse on the screen. These coordinates could then be sent to the Flash track, and the animation told to play at that location. The example below is more simple - it simply activates a movie clip in the Flash track. Try finding a hotspot in the QTVR below and see what happens.... [Hint: try looking at the main counter, information desks and doors!].

Here's how it's done. The project files can be downloaded from here.

The Flash Bit

As in previous pages, we won’t go into great detail on the Flash side here, as this is not a Flash tutorial – more information can be found in the Flash tutorials section.

The Flash movie here contains a brief animated text based clip ('hotspot')...

and a "listener" movieclip (“listener”), which handles the rollover transition on the Flash side:

Similar to the compass "listener" movieclip featured here, it's a two-frame loop in which both frames contain the following actionscript (it’s constantly running, frame by frame, “listening” for the ‘hotspothandler’ value);

This script passes the hotspothandler value to the "hotspot" movie clip, telling it to run it's animation (this starts on frame 2) - run by the script gotoAndPlay(2).

hotspothandler gets its value from the Quicktime panorama (we will show how with the LiveStage Pro program). Again, bear in mind that Quicktime 5 only supports Flash 4 and Quicktime 6 only supports Flash 5. Be sure to select 'Flash 5' in the publish settings if you're using MX – otherwise LiveStage will not recognise the file when you import it. It is necessary to use a two-frame movie as the listener; 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).

The LiveStage Pro Bit

First up, you'll need to make sure that the Flash track is on the "top" level of the movie (so it can be seen over the QTVR). Double-click on the Flash track...

and you will see this window:

Make sure that "Can Have Keyboard Focus" is NOT checked - we don't want to select the Flash track in the QTVR! Now click on "Composition"...

..and make sure that the mode is set to Alpha channel (ensures the background of the Flash track is transparent - otherwise you can't see the QTVR under/through it!). Then close that window.

Now we’re going to set a value in the Flash Track variable by using LiveStage Pro. “SetFlashVariable” is used 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 set the Flash track to do).

Double click on the QTVR track in the movie timeline to open this window:

Select the "Hot Spots" button, and click the scripts tab.

This is an example of the piece of QScript code used on each hotspot event (Mouse Click / Enter/ Exit ) that passes the variable to Flash when a hotspot is rolled over:

Tracknamed("maptut").SetFlashVariable("","hotspothandler", "Information Desk", FALSE)

In it we tell the track called "maptut" (the Flash movie) to set the variable hotspothandler to be a string value when the hotspot is rolled over (this value is then shown as the animated hotspot info in the QTVR track).

When the hotspot is rolled out of (Mouse Exit), we pass an empty string back to the Flash value to "clear" the Flash track. Easy.

Have a go yourself!

The project files can be downloaded from here. Try changing the settings and seeing what effect the changes make.

<< Previous | Next >>

Richard England - July 2003