Hi,
(this is also posted in the wrong cheapter: krpano Flash Panorama Viewer )
oke ... i try to implement this but i can"t get it right...
It's about the smoothing for the bitmaps here:
http://www.virtualtuur.com/delicious/nl/KS5_delicious.swf
They get ugly / sharky when you hover..
i try to pu this AS3 thing:
in my as3 script of my buttonset:
Code
import krpano_as3_interface;
// create krpano as3 interface object - krpano
var krpano:krpano_as3_interface = krpano_as3_interface.getInstance();
this.btn_left.useHandCursor = true;
this.btn_right.useHandCursor = true;
this.btn_up.useHandCursor = true;
this.btn_down.useHandCursor = true;
this.btn_zoomout.useHandCursor = true;
this.btn_zoomin.useHandCursor = true;
this.btn_fullscreen.useHandCursor = true;
this.btn_fullscreenclose.useHandCursor = true;
this.btn_fullscreenclose.visible = false;
this.btn_help.useHandCursor = true;
this.btn_menu.useHandCursor = true;
this.btn_gallery.useHandCursor = true;
this.btn_map.useHandCursor = true;
// empty functions? - then it wasn't included in the viewer
if (krpano.get == null)
{
// run plugin swf standalone - no interfaces - add dummy functions
function dummy_get(v:String):String
{
if (v != "progress.loaddone") // avoid progress timer traces
trace("get(" + v + ");");
return "";
}
function dummy_set(v:String,val:String):void
{
trace("set("+v+","+val+");");
}
function dummy_call(action:String):void
{
trace("call("+action+");");
}
krpano.get = dummy_get;
krpano.set = dummy_set;
krpano.call = dummy_call;
}
// first krpano calls - disable default progressbar
if (stage)
{
// run standalone
// no automatic scaling
stage.scaleMode = StageScaleMode.NO_SCALE;
// align on top left corner
stage.align = StageAlign.TOP_LEFT;
}
// LEFT
this.btn_left.addEventListener(MouseEvent.MOUSE_DOWN, Left);
this.btn_left.addEventListener(MouseEvent.MOUSE_UP, Left);
function Left(evt:MouseEvent)
{
switch (evt.type)
{
case MouseEvent.MOUSE_UP :
krpano.set("movevectorx","0");
break;
case MouseEvent.MOUSE_DOWN :
krpano.set("movevectorx","-0.5");
break;
}
}
// RIGHT
this.btn_right.addEventListener(MouseEvent.MOUSE_DOWN, Right);
this.btn_right.addEventListener(MouseEvent.MOUSE_UP, Right);
function Right(evt:MouseEvent)
{
switch (evt.type)
{
case MouseEvent.MOUSE_UP :
krpano.set("movevectorx","0");
break;
case MouseEvent.MOUSE_DOWN :
krpano.set("movevectorx","0.5");
break;
}
}
// UP
this.btn_up.addEventListener(MouseEvent.MOUSE_DOWN, Up);
this.btn_up.addEventListener(MouseEvent.MOUSE_UP, Up);
function Up(evt:MouseEvent)
{
switch (evt.type)
{
case MouseEvent.MOUSE_UP :
krpano.set("movevectory","0");
break;
case MouseEvent.MOUSE_DOWN :
krpano.set("movevectory","-0.5");
break;
}
}
// DOWN
this.btn_down.addEventListener(MouseEvent.MOUSE_DOWN, Down);
this.btn_down.addEventListener(MouseEvent.MOUSE_UP, Down);
function Down(evt:MouseEvent)
{
switch (evt.type)
{
case MouseEvent.MOUSE_UP :
krpano.set("movevectory","0");
break;
case MouseEvent.MOUSE_DOWN :
krpano.set("movevectory","0.5");
break;
}
}
// ZOOMIN
this.btn_zoomin.addEventListener(MouseEvent.MOUSE_DOWN, Zoomin);
this.btn_zoomin.addEventListener(MouseEvent.MOUSE_UP, Zoomin);
function Zoomin(evt:MouseEvent)
{
switch (evt.type)
{
case MouseEvent.MOUSE_UP :
krpano.set("movevectorz","0");
break;
case MouseEvent.MOUSE_DOWN :
krpano.set("movevectorz","-0.5");
break;
}
}
// ZOOMOUT
this.btn_zoomout.addEventListener(MouseEvent.MOUSE_DOWN, Zoomout);
this.btn_zoomout.addEventListener(MouseEvent.MOUSE_UP, Zoomout);
function Zoomout(evt:MouseEvent)
{
switch (evt.type)
{
case MouseEvent.MOUSE_UP :
krpano.set("movevectorz","0");
break;
case MouseEvent.MOUSE_DOWN :
krpano.set("movevectorz","+0.5");
break;
}
}
// FULLSCREEN
this.btn_fullscreen.addEventListener(MouseEvent.CLICK, Fullscreen);
this.btn_fullscreenclose.addEventListener(MouseEvent.CLICK, Fullscreen);
addEventListener(Event.ADDED_TO_STAGE, init);
function init(e:Event):void
{
//je kan pas naar stage events luisteren, nadat het toegevoegd is aan de stage. Vandaar dat je even moet
//wachten op de ADDED_TO_STAGE event.
stage.addEventListener(FullScreenEvent.FULL_SCREEN, fullscreen_event);
}
function Fullscreen(evt:MouseEvent)
{
switch (evt.type)
{
case MouseEvent.CLICK :
if (stage.displayState == StageDisplayState.FULL_SCREEN)
{
stage.displayState = StageDisplayState.NORMAL;
this.btn_fullscreen.visible = true;
this.btn_fullscreenclose.visible = false;
}
else
{
stage.displayState = StageDisplayState.FULL_SCREEN;
this.btn_fullscreen.visible = false;
this.btn_fullscreenclose.visible = true;
}
break;
}
}
function fullscreen_event (event:FullScreenEvent):void
{
if (event.fullScreen == true)
{
// now being in fullscreen mode
this.btn_fullscreen.visible = false;
this.btn_fullscreenclose.visible = true;
}
else
{
// back to window mode
this.btn_fullscreen.visible = true;
this.btn_fullscreenclose.visible = false;
}
}
//HELP
this.btn_help.addEventListener(MouseEvent.CLICK, Help);
function Help(evt:MouseEvent)
{
switch (evt.type)
{
case MouseEvent.CLICK :
krpano.call("action(help)");
break;
}
}
//MENU
this.btn_menu.addEventListener(MouseEvent.CLICK, Menu);
function Menu(evt:MouseEvent)
{
switch (evt.type)
{
case MouseEvent.CLICK :
krpano.call("action(showmenu)");
break;
}
}
// GALLERY
this.btn_gallery.addEventListener(MouseEvent.CLICK, Gallery);
function Gallery(evt:MouseEvent)
{
switch (evt.type)
{
case MouseEvent.CLICK :
krpano.call("action(areagallery)");
break;
}
}
//MAP
this.btn_map.addEventListener(MouseEvent.CLICK, Map);
function Map(evt:MouseEvent)
{
switch (evt.type)
{
case MouseEvent.CLICK :
krpano.call("action(areamap)");
break;
}
}
Display More
i can't get that smoothing right.. they are also talking about an package...
can anybody help?
Thanx
Tuur