It seems when I load a scene (using loadscene) it triggers a onresize event. This shouldnt happen I think. Since im not resizing the browser/area.
Flash 11.0.1.152 WIN
krpano 1.0.8.14 build 2011-05-20
It seems when I load a scene (using loadscene) it triggers a onresize event. This shouldnt happen I think. Since im not resizing the browser/area.
Flash 11.0.1.152 WIN
krpano 1.0.8.14 build 2011-05-20
are your <level> settings right?
<image type="CUBE" multires="true" tilesize="1100" progressive="false">
<level tiledimagewidth="2200" tiledimageheight="2200">
<cube url="../pics/zephyr.tiles/%s_%0v_%0h.jpg" />
</level>
</image>
or something ...in the scene tag?
or the MFOV etc...settings??
so when u have global fov settings and also in the scene tag... problems..
Tuur
Hi,
right, there is always an 'initial' onresize event after loading an new pano or scene,
this is done to allow an onresize event adjusting new elements correctly,
best regards,
Klaus
Shouldnt those elements be positioned using onpreview/onloadcomplete? Loading another panorama wouldnt trigger a bigger area/screen size. Same size, different location
Hi,
not the pano image - the plugin images,
e.g. when new plugin elements were defined in the new pano/scene and they should be positioned by the onresize event or when the onresize event should set a custom area size via code (e.g. like the fixed-aspect example),
best regards,
Klaus
Ok, I want the onresize action only trigger when there is an actiual resize (i have some plugins that reset there coordinates to 0,0 when a true resize happens). But I cant seem to get it working...
<events onresize="resizeevent()" />
<action name="resizeevent">
delayedcall(0.01,
ifnot($_PREVIOUS_STAGEHEIGHT == stageheight,
copy($_PREVIOUS_STAGEHEIGHT, stageheight);
resizehandler();
,
ifnot($_PREVIOUS_STAGEWIDTH == stagewidth,
copy($_PREVIOUS_STAGEWIDTH, stagewidth);
resizehandler();
);
);
);
</action>
Alles anzeigen
resizehandler is the action that should be triggered if either stageheight/stagewidth got changed. If I trace the value, it seems that stagewidth and $_previous_stagewidth are a few pixels between eachother. I though adding a delay would help, but it doesnt.
Any pointers?
Hi,
I have tested your code and there was unforatunaly a bug in the if() parsing that avoids the correct working in this case:
the current if() action parser detects the "GE" in the "_PREVIOUS_STAGEHEIGHT" variable name as GE (greater or equal) operator - which is wrong of course and leads to a wrong test condition,
all string compare operators like LE, LT, GE, GT or EQ are affected by that problem when the variable name contains these strings in upper-case (lower-case will work),
this will be fixed in the next release (and additionally the new and fixed if() operator parser will be ~1900% faster )
a workaround for the moment would be to use lower-case variables,
e.g. here the solution that I would recommend:
<action name="resizeevent">
set(stagesizechanged,false);
if($_previous_stagewidth !== stagewidth, set(stagesizechanged,true));
if($_previous_stageheight !== stageheight, set(stagesizechanged,true));
if(stagesizechanged,
copy($_previous_stagewidth, stagewidth);
copy($_previous_stageheight, stageheight);
resizehandler();
);
</action>
best regards,
Klaus
Thanks Klaus, that did the trick :)
I capatalize my global variables, I should keep this bug in mind when using if statements :)
btw will there be support for || and && (OR and AND) in the future? Alsoo adding a ELSE (instead of , would be nice too. A comma gets overread sometimes
Hi,
btw will there be support for || and && (OR and AND) in the future? Alsoo adding a ELSE (instead of , would be nice too. A comma gets overread sometimes
yes, I have already plans for that.
best regards,
Klaus
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!