|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
<hotspot name="anim3" url="./anim3/anim3.swf" keep="false" ath="122.18229541736807" atv="-18.647263602344474" zoom="false" distorted="true" width="1131" height="718" scale="0.22531519359898222" scale9grid="" scalechildren="false" rotate="0" rx="-3.0374999999999943" ry="4" rz="1.08583441509875" edge="center" ox="" oy="" crop="" ondowncrop="" onovercrop="" visible="true" enabled="true" handcursor="true" capture="true" children="true" zorder="20" alpha="1.00" blendmode="normal" smoothing="true" refreshrate="auto" onloaded="" onover="" onhover="" onout="" ondown="" onup="" onclick="" flying="0" /> |
|
|
Quellcode |
1 2 |
import krpano_as3_interface; var krpano:krpano_as3_interface = krpano_as3_interface.getInstance(); |
|
|
Quellcode |
1 2 3 4 5 6 7 8 |
import krpano_as3_interface;
var krpano:krpano_as3_interface = krpano_as3_interface.getInstance();
stop();
b_0.addEventListener(MouseEvent.CLICK, button_function);
b_0.buttonMode = true;
function button_function( evt:MouseEvent ) {
gotoAndPlay(1);
}
|
(i haven't changed the code in the xml it's always like this : |
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
<hotspot name="anim3" url="./anim3/anim3.swf" keep="false" ath="122.18229541736807" atv="-18.647263602344474" zoom="false" distorted="true" width="1131" height="718" scale="0.22531519359898222" scale9grid="" scalechildren="false" rotate="0" rx="-3.0374999999999943" ry="4" rz="1.08583441509875" edge="center" ox="" oy="" crop="" ondowncrop="" onovercrop="" visible="true" enabled="true" handcursor="true" capture="true" children="true" zorder="20" alpha="1.00" blendmode="normal" smoothing="true" refreshrate="auto" onloaded="" onover="" onhover="" onout="" ondown="" onup="" onclick="" flying="0" /> |
Zitat
i just want you to know that if i put the animation as plugin then it works correctly (with the events of the mouse)
Zitat
but i want to use it as hostspot
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 |
<plugin name="animation" url="your-flash-plugin.swf" onover="" onhover="" onout="" ondown="" onup="" onclick="lookto(180,0,150);" /> |
|
|
Quellcode |
1 |
krpano.call("lookto(0,25,20));");
|
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 |
krpano.addPluginEventListener(this, krpano_as3_interface.PLUGINEVENT_REGISTER, registerEvent);
...
public function registerEvent(evt:DataEvent):void
{
var plugin_path:String = evt.data;
var plugin_obj:Object = krpano.get(plugin_path);
...
}
|
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 |
public function registerEvent(evt:DataEvent):void
{
var plugin_path:String = evt.data;
var plugin_obj:Object = krpano.get(plugin_path);
plugin_obj.registerattribute("test", testfunction);
}
public function testfunction():void
{
krpano.trace(0, "hello from AS3");
}
|
|
|
Quellcode |
1 |
<hotspot ... onclick="test();" .. /> |
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 |
public function registerEvent(evt:DataEvent):void
{
var plugin_path:String = evt.data;
var plugin_obj:Object = krpano.get(plugin_path);
var sprite:Sprite = plugin_obj.sprite as Sprite;
sprite.addEventListener(MouseEvent.CLICK, handleclick);
...
}
|