habe ein Problem mit dem Setzen eines Hotspots in AS3. Kriege beim kompilieren folgende Fehlermeldung:
TypeError: Error #1010: Ein Begriff ist nicht definiert und hat keine Eigenschaften.
at PanoCube/addHotspot()
at PanoView/initPanorama()
Ich benutze Pano2vr in der Version 2.2.3
Flash Player in der Version 10
Ich kompiliere mit dem "Adobe Flash CS3 Pro"
Meine Klasse sieht so aus:
Code: Select all
package
{
import flash.display.*;
import flash.net.URLRequest;
import flash.events.Event;
public class PanoView extends Sprite
{
var loader:Loader = new Loader();
var url:String = "pix/pano_final.swf";
var urlReq:URLRequest = new URLRequest(url);
var vr:MovieClip; // panorama movieclip
public function PanoView() {
// call initPanorama every frame
addEventListener( Event.ENTER_FRAME , initPanorama);
// Tell the loader to call 'finished_loading' after the swf is loaded.
loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, finished_loading);
// Tell the loader to call 'initHandler' after the swf is initialized.
loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
loader.load(urlReq);
addChild(loader); // add your swf directly to the stage
}
// This is done after the swf is loaded.
function finished_loading (e:Event) {
}
function initHandler(event:Event):void {
trace("initHandler: " + event);
vr = MovieClip(loader.content); // cast 'DisplayObject' to 'MovieClip'
vr.isFlash10=false; // Disable Flash 10 rendering if the container is Flash 9
}
function initPanorama(e:Event) {
// check if the panorama object is available and initialize it
if ((vr!=null) && (vr.pano!=null)) {
removeEventListener( Event.ENTER_FRAME , initPanorama);
//vr.pano.setWindowSize(200,100); // resize the window
//vr.pano.setWindowPos(200,200); // reposition
var hotspotMc:MovieClip = new MovieClip();
hotspotMc.graphics.lineStyle();
hotspotMc.graphics.beginFill(0x9900FF, 60);
hotspotMc.graphics.drawCircle(0, 0, 10);
hotspotMc.graphics.endFill();
addChild(hotspotMc);
vr.pano.addHotspot("h1", 50, -59, hotspotMc);
}
}
}
}
Danke im Voraus
Gruß
Vitali