,I am playing about this, trying to get a way to do only with Krpano stuffs...what I dont know how to do is to make that sliding box.
|
|
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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
<krpano version="1.0.8" onstart="showlog(); copy(area.x,plugin[map].width); set(area.width,70%);">
<view fov="120" fovtype="DFOV" />
<preview type="grid(cube, 20, 20, 200, 0xCCCCCC, 0xFFFFFF, 0x000000)" details="12" />
<textstyle name="FOVTEXT" origin="top" edge="top" yoffset="35" textalign="left" background="false" border="false" fontsize="20" textcolor="0xFFFFFF" bold="false" effect="glow(0xFFFFFF,0.7,4,2);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);" showtime="4.0" fadetime="1.0" />
<events onviewchange="showfovtext();" />
<plugin name="map"
url="%SWFPATH%/plugins/googlemaps.swf"
align="left"
width="30%"
height="100%"
parent="STAGE"
key="ABQIAAAA2c--4Vth66ePXVcVzlhLyBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQser8zYS3pHFBZtNof1k5XKvSUmw"
>
</plugin>
<plugin name="tab_left" url="%SWFPATH%/plugins/textfield.swf"
width="48" height="38" align="left"
selectable="false" children="false"
css="p{color:#000000; font-family:Arial; font-weight:bold; font-size:14; margin-left:5; margin-right:5; text-align:center; }"
backgroundcolor="0xFFFFFF" roundedge="5" shadow="1" borderwidth="0" glow="4" glowcolor="0xFFFFFF"
html="[p]Drag[br]me[/p]"
ondown="set(is_tab_ondown,true);
copy(tab_mouse_offset,mouse.x);
sub(current_mouse_stagex, mouse.stagex, mouse.x);
copy(current_area_pixelwidth, area.pixelwidth);
do_tab_left_ondown();"
onup=" set(is_tab_ondown,false);
do_percent()"
/>
<action name="do_tab_left_ondown">
if(is_tab_ondown ,
trace(mouse.stagex,' - ',mouse.x);
trace('tab_mouse_offset = ',tab_mouse_offset);
sub(temp1, mouse.stagex, tab_mouse_offset); trace('temp1 = ',temp1);
if(temp1 LE 0 ,
set(area.x , 0%);
sub(temp2, 0, current_mouse_stagex); trace('temp2 = ',temp2);
sub(temp3, current_area_pixelwidth, temp2); trace('temp3 = ',temp3);
copy(area.width , temp3);
set(plugin[map].width , 1);
,
copy(area.x , temp1);
sub(temp2, temp1, current_mouse_stagex); trace('temp2 = ',temp2);
sub(temp3, current_area_pixelwidth, temp2); trace('temp3 = ',temp3);
copy(area.width , temp3);
sub(temp4, stagewidth, temp3); trace('temp4 = ',temp4);
if(temp4 LE 0,set(temp4,1););
copy(plugin[map].width , temp4);
);
delayedcall(0.01,do_tab_left_ondown(););
);
</action>
<action name="do_percent">
div(percent, stagewidth, 100);
div(temp, area.pixelx, percent);
txtadd(temp, get(temp), %);
copy(area.x, temp);
div(temp, area.pixelwidth, percent);
txtadd(temp, get(temp), %);
copy(area.width, temp);
div(temp, plugin[map].width, percent);
txtadd(temp, get(temp), %);
copy(plugin[map].width, temp);
</action>
<action name="showfovtext">
copy(fov,view.fov);
roundval(fov,2);
txtadd(msg,get(view.fovtype),'=',get(fov),'°');
txtadd(msg,get(msg),[br],'stage = ',get(stagewidth),' x ',get(stageheight),[br]);
txtadd(msg,get(msg),'area.width_height = ',get(area.width),' x ',get(area.height),[br]);
txtadd(msg,get(msg),'area.pixelwidth_height = ',get(area.pixelwidth),' x ',get(area.pixelheight),[br]);
txtadd(msg,get(msg),'area.x_y = ',get(area.x),' x ',get(area.y),[br]);
txtadd(msg,get(msg),'area.pixelx_y = ',get(area.pixelx),' x ',get(area.pixely),[br]);
txtadd(msg,get(msg),'plugin[map].width = ',get(plugin[map].width),[br]);
showtext(get(msg),FOVTEXT);
</action>
</krpano>
|
....
...This post has been edited 1 times, last edit by "michel" (Jun 15th 2010, 1:36pm)
... If you try to drag and up quickly you will notice that the area.x does not match with the plugin.with...|
|
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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
<krpano version="1.0.8" onstart="showlog(); copy(area.x,plugin[map].width); set(area.width,70%);">
<view fov="120" fovtype="DFOV" />
<preview type="grid(cube, 20, 20, 200, 0xCCCCCC, 0xFFFFFF, 0x000000)" details="12" />
<textstyle name="FOVTEXT" origin="top" edge="top" yoffset="35" textalign="left" background="false" border="false" fontsize="20" textcolor="0xFFFFFF" bold="false" effect="glow(0xFFFFFF,0.7,4,2);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);" showtime="4.0" fadetime="1.0" />
<events onviewchange="showfovtext();" />
<plugin name="map"
url="%SWFPATH%/plugins/googlemaps.swf"
align="left"
width="30%"
height="100%"
parent="STAGE"
key="ABQIAAAA2c--4Vth66ePXVcVzlhLyBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQser8zYS3pHFBZtNof1k5XKvSUmw"
>
</plugin>
<plugin name="tab_left" url="%SWFPATH%/plugins/textfield.swf"
width="48" height="38" align="left"
selectable="false" children="false"
visible="true" enabled="true" handcursor="false" capture="true" children="true"
css="p{color:#000000; font-family:Arial; font-weight:bold; font-size:14; margin-left:5; margin-right:5; text-align:center; }"
backgroundcolor="0xFFFFFF" roundedge="5" shadow="1" borderwidth="0" glow="4" glowcolor="0xFFFFFF"
html="[p]Drag[br]me[/p]"
ondown="set(is_tab_ondown,true);
copy(tab_mouse_offset,mouse.x);
sub(current_mouse_stagex, mouse.stagex, mouse.x);
copy(current_area_pixelwidth, area.pixelwidth);
do_tab_left_ondown();"
onup=" set(is_tab_ondown,false);"
/>
<action name="do_tab_left_ondown">
if(is_tab_ondown ,
trace(mouse.stagex,' - ',mouse.x);
trace('tab_mouse_offset = ',tab_mouse_offset);
trace('current_mouse_stagex = ',current_mouse_stagex);
sub(temp1, mouse.stagex, tab_mouse_offset); trace('temp1 = ',temp1);
if(temp1 LE 0 ,
set(area.x , 0%);
sub(temp2, 0, current_mouse_stagex); trace('temp2 = ',temp2);
sub(temp3, current_area_pixelwidth, temp2); trace('temp3 = ',temp3);
copy(area.width , temp3);
set(plugin[map].width , 1);
,
copy(area.x , temp1);
sub(temp2, temp1, current_mouse_stagex); trace('temp2 = ',temp2);
sub(temp3, current_area_pixelwidth, temp2); trace('temp3 = ',temp3);
copy(area.width , temp3);
sub(temp4, stagewidth, temp3); trace('temp4 = ',temp4);
if(temp4 LE 0, set(temp4,1););
copy(plugin[map].width , temp4);
);
delayedcall(0.01,do_tab_left_ondown(););
,
do_percent();
);
</action>
<action name="do_percent">
div(percent, stagewidth, 100);
div(temp, area.pixelx, percent);
txtadd(temp, get(temp), %);
copy(area.x, temp);
div(temp, area.pixelwidth, percent);
txtadd(temp, get(temp), %);
copy(area.width, temp);
div(temp, plugin[map].width, percent);
txtadd(temp, get(temp), %);
copy(plugin[map].width, temp);
</action>
<action name="showfovtext">
copy(fov,view.fov);
roundval(fov,2);
txtadd(msg,get(view.fovtype),'=',get(fov),'°');
txtadd(msg,get(msg),[br],'stage = ',get(stagewidth),' x ',get(stageheight),[br]);
txtadd(msg,get(msg),'area.width_height = ',get(area.width),' x ',get(area.height),[br]);
txtadd(msg,get(msg),'area.pixelwidth_height = ',get(area.pixelwidth),' x ',get(area.pixelheight),[br]);
txtadd(msg,get(msg),'area.x_y = ',get(area.x),' x ',get(area.y),[br]);
txtadd(msg,get(msg),'area.pixelx_y = ',get(area.pixelx),' x ',get(area.pixely),[br]);
txtadd(msg,get(msg),'plugin[map].width = ',get(plugin[map].width),[br]);
showtext(get(msg),FOVTEXT);
</action>
</krpano>
|
...
..
... Mainly due to how pixel values are rounded from the percent values .
) It is due to the "krpano.com" logo that catchs the mouse and makes the drag tab becomes unreachable...
!!!! Sure, there is a way to do .... If I can reach a working code I will post it...I must admit that I misunderstood the response of VN2009
Quoted
but based on vn2009s reaction seems like good code...
...
now I understand what you mean about vn2009 reaction
... At first I was thinking it was about his first answer
... Many times it costs me a lot to get the meaning of a phrase in English
... Sorry VN2009
...|
|
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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
<krpano version="1.0.8" onstart="showlog(); copy(area.x,plugin[map].width); ">
<view fov="120" fovtype="DFOV" />
<preview type="grid(cube, 20, 20, 200, 0xCCCCCC, 0xFFFFFF, 0x000000)" details="12" />
<textstyle name="FOVTEXT" origin="top" edge="top" yoffset="35" textalign="left" background="false" border="false" fontsize="20" textcolor="0xFFFFFF" bold="false" effect="glow(0xFFFFFF,0.7,4,2);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);" showtime="4.0" fadetime="1.0" />
<events onresize="maths_onresize();" onviewchange="showfovtext();" />
<plugin name="map"
url="%SWFPATH%/plugins/googlemaps.swf"
align="left"
width="30%"
height="100%"
parent="STAGE"
key="ABQIAAAA2c--4Vth66ePXVcVzlhLyBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQser8zYS3pHFBZtNof1k5XKvSUmw"
>
</plugin>
<plugin name="tab_left" url="%SWFPATH%/plugins/textfield.swf"
width="48" height="38" align="left" y="-35"
selectable="false" children="false"
visible="true" enabled="true" handcursor="false" capture="true" children="true"
css="p{color:#000000; font-family:Arial; font-weight:bold; font-size:14; margin-left:5; margin-right:5; text-align:center; }"
backgroundcolor="0xFFFFFF" roundedge="5" shadow="1" borderwidth="0" glow="4" glowcolor="0xFFFFFF"
html="[p]Drag[br]me[/p]"
ondown="set(is_tab_ondown,true);
copy(tab_mouse_offset,mouse.x);
do_tab_left_ondown();"
onup=" set(is_tab_ondown,false);"
/>
<action name="do_tab_left_ondown">
if(is_tab_ondown ,
trace(mouse.stagex,' - ',mouse.x);
trace('tab_mouse_offset = ',tab_mouse_offset);
sub(temp1, mouse.stagex, tab_mouse_offset); trace('temp1 = ',temp1);
if(temp1 LE 0 ,
set(area.x , 0);
copy(area.width , stagewidth);
set(plugin[map].width , 1); <!-- to avoid widht=0 ( bad results if so) -->
,
copy(area.x , temp1);
copy(plugin[map].width , temp1);
sub(area.width , stagewidth, temp1);
);
delayedcall(0.01,do_tab_left_ondown(););
);
</action>
<action name="maths_onresize">
ifnot(is_tab_ondown ,
trace('--- onresize ---');
add(temp1, area.pixelx, area.pixelwidth); trace('temp1 = ',temp1);
div(temp1, stagewidth, temp1); trace('temp1 = ',temp1);
mul(temp2, area.pixelx, temp1); trace('temp2 = ',temp2);
roundval(temp2); trace('temp2 = ',temp2);
if(temp2 GT 0,
copy(plugin[map].width, temp2);
,
set(plugin[map].width, 1); <!-- to avoid widht=0 ( bad results if so) -->
trace('plugin[map].width = ',plugin[map].width);
);
copy(area.x, temp2); trace('area.x = ',area.x);
sub(area.width, stagewidth, area.x); trace('area.width = ',area.width);
);
</action>
<action name="showfovtext">
copy(fov,view.fov);
roundval(fov,2);
txtadd(msg,get(view.fovtype),'=',get(fov),'°');
txtadd(msg,get(msg),[br],'stage = ',get(stagewidth),' x ',get(stageheight),[br]);
txtadd(msg,get(msg),'area.width_height = ',get(area.width),' x ',get(area.height),[br]);
txtadd(msg,get(msg),'area.pixelwidth_height = ',get(area.pixelwidth),' x ',get(area.pixelheight),[br]);
txtadd(msg,get(msg),'area.x_y = ',get(area.x),' x ',get(area.y),[br]);
txtadd(msg,get(msg),'area.pixelx_y = ',get(area.pixelx),' x ',get(area.pixely),[br]);
txtadd(msg,get(msg),'plugin[map].width_height = ',get(plugin[map].width),' x ',get(plugin[map].height));
showtext(get(msg),FOVTEXT);
</action>
</krpano>
|
....
...This post has been edited 1 times, last edit by "michel" (Jun 17th 2010, 8:06pm)
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
My_DragSlide_mc.visible=false;
BG_mc.addEventListener(MouseEvent.MOUSE_OVER, func_OVER);
function func_OVER (e:MouseEvent):void{
Mouse.hide();
My_DragSlide_mc.visible=true;
My_DragSlide_mc.startDrag(true);
}
BG_mc.addEventListener(MouseEvent.MOUSE_OUT, func_OUT);
function func_OUT (e:MouseEvent):void{
Mouse.show();
My_DragSlide_mc.stopDrag();
My_DragSlide_mc.visible=false;
}
|
... I am out of ideas ... Some one can help here? Zephyr |
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<action="doSomething> trace(%1); </action> <plugin name="slider" url="../plugins/slider.swf" keep="true" align="center" direction="horizontal" sliderwidth="100" sliderheight="20" maximum="100" interval="10" startvalue="0" actiontocall="doSomething" /> |
|
|
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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
import fl.controls.Slider;
import fl.events.SliderEvent;
import fl.controls.Label;
import krpano_as3_interface;
var krpano : krpano_as3_interface = null;
var pluginpath : String = null;
var pluginobj : Object = null;
var ActionToCall:String;
//slider in library
var aSlider:Slider = new Slider();
aSlider.liveDragging = true;
aSlider.move(0, 0);
//add handcursor on the handler
var Bar_Target:Object = aSlider.getChildAt(0);
var Scrubber_Target:Object = aSlider.getChildAt(1);
Bar_Target.useHandCursor=true;
Scrubber_Target.useHandCursor=true;
if (stage)
{
stage.scaleMode = StageScaleMode.NO_SCALE;// no automatic scaling
stage.align = StageAlign.TOP_LEFT;// align on top left corne
//demo mode in flash
addChild(aSlider);
aSlider.addEventListener(SliderEvent.CHANGE, changeHandler);
aSlider.width = 200;
aSlider.snapInterval = 10;
aSlider.tickInterval = 10;
aSlider.maximum = 100;
aSlider.value = 100;
}
else
{
this.addEventListener(Event.ADDED_TO_STAGE, startplugin);
//this.addEventListener(Event.REMOVED_FROM_STAGE, stopplugin);
}
function startplugin(event:Event)
{
krpano = krpano_as3_interface.getInstance();
krpano.addPluginEventListener(this, krpano_as3_interface.PLUGINEVENT_REGISTER, registerEvent);
addChild(aSlider);
aSlider.addEventListener(SliderEvent.CHANGE, changeHandler);
}
function registerEvent(evt:DataEvent):void
{
// register event - "data" is the name of the plugin
pluginpath = evt.data;
pluginobj = krpano.get(pluginpath);
var param:* = null
param = krpano.get(pluginpath + ".direction");
if (param != undefined && param != "")
aSlider.direction = String( param ).toLowerCase();
param = krpano.get(pluginpath + ".sliderheight");
if (param != undefined && param != "")
{aSlider.height = parseInt(param);}
else {aSlider.height = 10;}
param = krpano.get(pluginpath + ".sliderwidth");
if (param != undefined && param != "")
{aSlider.width = int(param);}
else {aSlider.width = 200;}
param = krpano.get(pluginpath + ".interval");
if (param != undefined && param != "")
{aSlider.snapInterval = aSlider.tickInterval = parseInt(param);}
else{aSlider.snapInterval = aSlider.tickInterval = 10}
param = krpano.get(pluginpath + ".maximum");
if (param != undefined && param != "")
{aSlider.maximum = int(param);}
else {aSlider.maximum = 100;}
param = krpano.get(pluginpath + ".startvalue");
if (param != undefined && param != "")
{aSlider.value = int(param);}
else {aSlider.value = 0;}
param = krpano.get(pluginpath + ".actiontocall");
if (param != undefined && param != "")
{ActionToCall = String(param);}
}
function changeHandler(event:SliderEvent):void {
krpano.call("ActionToCall(" + event.value + ")");
krpano.trace(0, "ActionToCall(" + event.value + ")");
}
|
Location: Netherlands
Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

: https://pame.virtualtuur.comHi,
i was wondering if we are talking about the thing at top (first post by Milo first link) the blue things? or about the zoom slider...
or something else..
Zephyr? could we use that 1-100 thing to built a personal loader? like a beer glass that fills up slowly
Cheers
Tuur![]()
,
... I particaly like the thing about how to pass variables values from the xml to the swf plugin... Have to study that
...At this moment I can not test your code ... But I have the impression that this aSlider:Slider = new Slider(); thing is not really what I am (and Milo) looking for... It is more a try to substitute the default flash arrow when the mouse is onover a plugin by a customized one (as a slider/drag arrow)... Have a look at the first post from Milo ... and look at the 360cities.com... You will see that the pano has 2 part, a google map and the pano separated by a dragable region... this is what I try to do... I already have the code to do the dragable region but I do not know how to do the custom cursor when onover this dragable region...
Quoted
I don't know what you exaclty want, but I made a slider plugin on which you can stick your own action to it.
... A lot of things to learn inside it
...
...
I think I totally misunderstood your request
(the post from Tuur has made that I realize it).... You are talking about the three boxes on top of the google map, right ?
, all the above is refering to this
...