Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 |
<!--************** bouton **************************************************--> <plugin name="accueil" url="ChateauPCdata/graphics/bouton.png" align="lefttop" onclickA="set(plugin[map].visible, true); set(onclick, onclickB() ); onclickB="set(plugin[map].visible, false); set(onclick, onclickA() ); onclick="onclickA();" scale="1" keep="true" /> <!--************** the image plugin **************************************************--> <plugin name="map" align="center" scale="1" blendmode="normal" keep="true" visible="false" url="ChateauPCdata/graphics/spots/chateau.png" /> |


Quoted
tween(plugin[map].visible, true); instead of
set(plugin[map].visible, true);
Quoted
alpha="0" on the plugin then tween(plugin[map].alpha,0,1);
|
|
Source code |
1 2 3 4 5 |
/* bind click action to buttons */ btn_chateau.addEventListener(MouseEvent.CLICK, clickHandler); btn_chateau.addEventListener(MouseEvent.MOUSE_OVER, clickHandler); btn_chateau.addEventListener(MouseEvent.MOUSE_OUT, clickHandler); btn_chateau.alpha = 0.8; |
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
function clickHandler(evt:MouseEvent):void {
switch (evt.type)
{
case MouseEvent.CLICK :
//onclick does a krpano action with the name SomeAction
krpano.call("SomeAction()");
//krpano.set("display.details", 16);
//krpano.get("view.fov");
//you can alsoo store view.fov
break;
case MouseEvent.MOUSE_OVER :
//do something on mouse over
break;
case MouseEvent.MOUSE_OUT :
//do something on mouse out
break;
}
}
|


This post has been edited 2 times, last edit by "Yomas" (Dec 17th 2010, 12:30pm)
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
btn_chateau.addEventListener(MouseEvent.CLICK, loadpano);
btn_chateau.addEventListener(MouseEvent.MOUSE_OVER);
btn_chateau.addEventListener(MouseEvent.MOUSE_OUT);
btn_chateau.alpha = 0.8;
function loadpano(evt:MouseEvent):void {
switch (evt.type)
{
case MouseEvent.CLICK :
//onclick does a krpano action with the name openpano
krpano.call("loadpano(pano.xml)");
}
}
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
btn_chateau.addEventListener(MouseEvent.CLICK, loadpano);
btn_chateau.addEventListener(MouseEvent.MOUSE_OVER);
btn_chateau.addEventListener(MouseEvent.MOUSE_OUT);
btn_chateau.alpha = 0.8;
btn_chateau1.addEventListener(MouseEvent.CLICK, loadpano1);
btn_chateau1.addEventListener(MouseEvent.MOUSE_OVER);
btn_chateau1.addEventListener(MouseEvent.MOUSE_OUT);
btn_chateau1.alpha = 0.8;
function loadpano(evt:MouseEvent):void {
switch (evt.type)
{
case MouseEvent.CLICK :
//onclick does a krpano action with the name loadpano
krpano.call("loadpano(pano.xml)");
}
function loadpano1(evt:MouseEvent):void {
switch (evt.type)
{
case MouseEvent.CLICK :
//onclick does a krpano action with the name loadpano1
krpano.call("loadpano1(pano1.xml)");
}
}
|
|
|
Source code |
1 2 |
btn_chateau.addEventListener(MouseEvent.MOUSE_OVER); btn_chateau.addEventListener(MouseEvent.MOUSE_OUT); |
|
|
Source code |
1 2 |
btn_chateau.addEventListener(MouseEvent.MOUSE_OVER); btn_chateau.addEventListener(MouseEvent.MOUSE_OUT); |
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
btn_chateau.addEventListener(MouseEvent.CLICK, loadpano);
btn_chateau.addEventListener(MouseEvent.MOUSE_OVER, showtext);
...
function btn_chateau(evt:MouseEvent):void {
switch (evt.type)
{
case MouseEvent.CLICK :
krpano.call("loadpano(pano.xml)");
break;
case MouseEvent.MOUSE_OVER :
krpano.call("showtext(La Cuverie)");
break;
}
}
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
init(null);
function init(evt:Event):void
{
//add eventlisteners to everything in this movieclip that starts with btn_chateau_
for(var i:int = 0; i < this.numChildren; i++) //gets all the movieclips on the stage
{
if(this.getChildAt(i).name.substr(0,4) == "btn_chateau_") //if the movieclip starts with the name btn_chateau
{
addEventListeners(this.getChildAt(i)); //add all eventlisteners to this movieclip
}
}
}
function addEventListeners(mc:*):void
{
this[mc.name].addEventListener(MouseEvent.CLICK, mousefunction);
this[mc.name].addEventListener(MouseEvent.MOUSE_OVER, mousefunction);
this[mc.name].addEventListener(MouseEvent.MOUSE_OUT, mousefunction);
}
function mousefunction(evt:MouseEvent):void {
var buttonname:String = String(evt.target.name); //for instance btn_chateau_2
var id:String = buttonname.substr(12,4) //get 4 characters, after the 12th character. for example: 2
switch (evt.type)
{
case MouseEvent.CLICK :
krpano.call("loadpano(pano"+id+".xml)"); //use the id to load an xml. example: pano2.xml
break;
case MouseEvent.MOUSE_OVER :
evt.target.addEventListener(MouseEvent.MOUSE_MOVE, showtooltip);
break;
case MouseEvent.MOUSE_OUT:
evt.target.removeEventListener(MouseEvent.MOUSE_MOVE, showtooltip);
break;
}
}
function showtooltip(evt:Event):void
{
krpano.call("showtext(La Cuverie)");
}
|
|
|
Source code |
1 2 3 4 5 6 |
function addEventListeners(mc:*):void
{
this[mc.name].addEventListener(MouseEvent.CLICK, mousefunction);
this[mc.name].addEventListener(MouseEvent.MOUSE_OVER, mousefunction);
this[mc.name].addEventListener(MouseEvent.MOUSE_OUT, mousefunction);
}
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
function mousefunction(evt:MouseEvent):void {
var buttonname:String = String(evt.target.name); //for instance btn_chateau_2
var id:String = buttonname.substr(12,4) //get 4 characters, after the 12th character. for example: 2
switch (evt.type)
{
case MouseEvent.CLICK :
krpano.call("loadpano(pano"+id+".xml)"); //use the id to load an xml. example: pano2.xml
break;
case MouseEvent.MOUSE_OVER :
evt.target.addEventListener(MouseEvent.MOUSE_MOVE, showtooltip);
break;
case MouseEvent.MOUSE_OUT:
evt.target.removeEventListener(MouseEvent.MOUSE_MOVE, showtooltip);
break;
}
}
function showtooltip(evt:Event):void
{
krpano.call("showtext(La Cuverie)");
}
|

|
|
Source code |
1 2 3 4 5 6 |
function addEventListeners(mc:*):void
{
this[mc.name].addEventListener(MouseEvent.CLICK, mousefunction);
this[mc.name].addEventListener(MouseEvent.MOUSE_OVER, mousefunction);
this[mc.name].addEventListener(MouseEvent.MOUSE_OUT, mousefunction);
}
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
function mousefunction(evt:MouseEvent):void {
var buttonname:String = String(evt.target.name); //for instance btn_chateau_2
var id:String = buttonname.substr(12,4) //get 4 characters, after the 12th character. for example: 2
switch (evt.type)
{
case MouseEvent.CLICK :
krpano.call("loadpano(pano"+id+".xml)"); //use the id to load an xml. example: pano2.xml
break;
case MouseEvent.MOUSE_OVER :
evt.target.addEventListener(MouseEvent.MOUSE_MOVE, showtooltip);
break;
case MouseEvent.MOUSE_OUT:
evt.target.removeEventListener(MouseEvent.MOUSE_MOVE, showtooltip);
break;
}
}
function showtooltip(evt:Event):void
{
krpano.call("showtext(La Cuverie)");
}
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
var id:String; //save id outside the function so showtooltip function can access it.
function mousefunction(evt:MouseEvent):void {
var buttonname:String = String(evt.target.name); //for instance btn_chateau_2
id = buttonname.substr(12,4) //get 4 characters, after the 12th character. for example: 2
switch (evt.type)
{
case MouseEvent.CLICK :
krpano.call("loadpano(pano"+id+".xml)"); //use the id to load an xml. example: pano2.xml
break;
case MouseEvent.MOUSE_OVER :
evt.target.addEventListener(MouseEvent.MOUSE_MOVE, showtooltip);
break;
case MouseEvent.MOUSE_OUT:
evt.target.removeEventListener(MouseEvent.MOUSE_MOVE, showtooltip);
break;
}
}
function showtooltip(evt:Event):void
{
//this function gets the id stored. then compares it with the cases. is id a "1" then showtext(la cuverie) etc
switch(id)
case "1":
krpano.call("showtext(La Cuverie)");
break;
case "2":
krpano.call("showtext(another text)");
break;
case "3":
krpano.call("showtext(another text)");
break;
}
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
<krpano>
<!-- this is the main container of the map -->
<plugin name="fond" zorder="0" align="center" scale="0.7" blendmode="normal" keep="true" visible="false"
url="ChateauPCdata/graphics/spots/fond.png" handcursor="false" />
<!-- this is the close button -->
<plugin name="close" zorder="1000" parent="fond" align="righttop" scale="0.7" blendmode="normal"
keep="true" visible="true" url="ChateauPCdata/graphics/spots/close.png" handcursor="true"
onhover="showtext(Fermer La Carte, infostyle);"
onclick="set(plugin[fond].visible, false);" />
<!-- this is the part of the map wich isn't clickable -->
<plugin name="map" zorder="300" parent="fond" align="lefttop" scale="0.7" blendmode="normal"
keep="true" visible="true" url="ChateauPCdata/graphics/spots/chateau1.png" handcursor="false" />
<!-- this are the two parts of the map wich is clickable (my two buttons as in flash) -->
<plugin name="mask2" zorder="500" parent="fond" align="lefttop" x="139" y="115" scale="0.7"
blendmode="normal" keep="true" visible="true" url="ChateauPCdata/graphics/spots/mask2_2.png"
onhover="set(plugin[mask2].effect, glow(0x000000)); set(plugin[map].effect, blur(5)); set(plugin[mask1].effect, blur(5));
showtext(La Salle de Dégustaion, infostyle);"
onout="set(plugin[map].effect, blur(0)); set(plugin[mask1].effect, blur(0)); set(plugin[mask2].effect, glow(0x000000,0));"
onclick="loadpano(ChateauPC0.xml); set(plugin[fond].visible, false);" />
<plugin name="mask1" zorder="800" parent="fond" align="lefttop" x="350" y="68" scale="0.7" blendmode="normal" keep="true" visible="true" url="ChateauPCdata/graphics/spots/mask1_1.png"
onhover="set(plugin[mask1].effect, glow(0x000000)); set(plugin[map].effect, blur(5)); set(plugin[mask2].effect, blur(5));
showtext(La Cuverie, infostyle);"
onout="set(plugin[map].effect, blur(0)); set(plugin[mask2].effect, blur(0)); set(plugin[mask1].effect, glow(0x000000,0));"
onclick="loadpano(ChateauPC1.xml); set(plugin[fond].visible, false);" />
</krpano>
|
|
|
Source code |
1 |
onhover="set(plugin[mask2].effect, glow(0x000000)); set(plugin[map].effect, blur(5)); set(plugin[mask1].effect, blur(5));" |
