Posts by pinsane

    Here's an example of flashing hotspots that uses a variant of the 2nd method detailed in the above post by Michel.

    Goodyear Blimp

    Once the intro screen completes, click on the "learning center" button in the upper left corner (it looks like a graduation cap--mortar board). Click on INSTRUMENTS. After the page loads, mouse over any of the items in the menu and you should see the appropriate instrument flash.

    There are still a few bugs to work out, but you should get the idea.

    steve

    I think this is a bug in the looktohotspot function. This seems to be happening because the ath coordinates are crossing over from negative numbers (> -180) to positive (< 180) which is of course correct, but prevents the looktohotspot function from zooming in as it seems to think the hotspot is infinitely large. I've seen this happen also when the range of values for ath is greater than 360 degrees in a polygonal hotspot.

    Try changing

    to


    Sorry but the delayCall which seem to be the most accurate function doesn't work with random
    ...
    What is going on ?

    try changing

    Code
    delayedcall(randomvalue, action(playS1); );

    to

    Code
    delayedcall(get(randomvalue), action(playS1); );

    Without the get() you're passing the string value "randomvalue" as the first argument of delayedcall. get() will pass the value of the variable randomvalue.

    hope this helps

    steve

    there is an 'ondone' ? i was not aware of this parameter.


    It's actually documented at the donecall argument, not the ondone--sorry. It's the fifth argument for the tween command.

    i just can't wrap my head around why it used to work. nothing had changed.

    There were definitely some changes to the way some of the commands worked in one of the recent releases. I would not set the onout parameter as a default and set it inside the onovercrop event (as the last command). That may fix your problem.

    Sorry if this is bogus, I'm on my phone and can't check it, but for the onout event shouldn't you set the visibility in the "ondone" parameter of the tween command? Otherwise you start the tween and then immediately execute the next command which changes the visibility...

    My best guess...

    Steve

    Thank you Steve!!
    How should I insert this code?


    Daniel

    That's javascript, not xml. You can put it in a file called kr_languages.js and then load it by putting the following line in the body of your html:

    Code
    <script type="text/javascript" src="kr_languages.js"></script>

    steve

    Glad you got it working tuur!

    Here's a different approach that you might find useful. I too found that the image would dissappear if you used an action to write the contents of a data field. I'm still not sure I understand how to get around that issue. Are you using full blown url paths to remedy the problem?

    At any rate, here's a solution that does what you asked for and seems to preserve the images as well. It allows you to put get statements in a data node, and automatically replace the get statements with the values of the variable. I've taken the liberty of including an example using your html data node:

    Code
    <data name="thumb1">
    		<p align="middle"><font face="Verdana"   size="11"><textformat leftmargin="" rightmargin="">
    		<img src="../thumbs_lanterna/lanterna1.jpg" height="" width="" align="top"/>
    		here i like to have something like :
    			the language is get(language) <br/> <b> get(phrase[thumb1].language[get(language)].text) </b><br/>
     		but then that it works.. ??
    	
    	            </textformat></font></p>     
    </data>


    Note that there is both a simple get statement (get(language)), and a very complicated one (get(phrase[thumb1].language[get(language)].text) embedded in the html. The second get statment accesses the appropriate language via an associative array I'll describe later.

    First, the following javascript needs to be included in your tour:


    These functions allow you to place get() statements inside your data node, and then replace them with their values on demand simply by calling kr_eval_get_in_string with the argument data[thumb1].contents.

    I'm including an example that shows how you can build an associative array to manage the language customization.

    Code
    <phrase name="thumb1" >
    		<language name="dutch" text="goedemorgen" />
    		<language name="english" text="good morning" />
    		<language name="spanish" text="buenas días" />
    		<language name="japanese" text="ohayou gozaimasu" />
    		<language name="french" text="bonjour" />
    		<language name="german" text="guten morgen" />
    		<language name="pig_latin" text="oodgay orningmay" />
    	</phrase>

    Note that by using this approach you can handle multiple languages in the onhover event for with a relatively clean xml command:

    Code
    <plugin name="foo"
    	...
    	onhover="showtext(get(phrase[get(name)].language[get(language)].text)"
    	...


    Here we access the appropriate associative array by naming it with the same name as the plugin, then we access the appropriate language using a global variable named language.

    Here's a working example xml file that allows you to change the language on-the-fly using a combobox selector. Note that the default language value is set in the first line:

    Hope this helps!

    steve

    That seems strange. Have you looked carefully around the wait statement for mismatched parenthesis, or quotes? These can sometimes cause very bizzare problems.

    Rather than an onend event which would fire every time an action completed, perhaps we could get an onerror event. That's where it would most make sense to put your cleanup code.

    I agree that error messages with line numbers and tracebacks would be a great addition, as well as the ability to have unlimited action depth.

    good luck. I know how frustrating this can be...

    steve

    This is odd. Perhaps you could try this:

    Code
    <action name="show_hover_image">
    set(plugin[hover_image].visible,false);
    set(plugin[hover_image].parent,plugin[%1]);
    set(plugin[hover_image].url,%2);
    set(plugin[hover_image].visible,true);
    </action>

    steve

    Krpano's new frame capability should do most of what you're looking for (no soft blending though, if the tile for the new frame is not in memory then you get a low red version and then it loads the tile(s) automagically like preview mode)

    Bear in mind if you have a lot of frames the startup time will suffer.

    Steve


    It's possible?

    It would be great if Klaus could add looping constructs to the krpano language. In the meantime, the krpano's language is flexible enough to write your own for-loop action:


    Here is how you would call the above for-loop action. You would have to use krpano action syntax for the initialization, loop condition, and incrementing as well as the loop actions:

    Code
    <action name="for_test1">
    					for (set(a,0),a LT 5,inc(a),
    						trace("a=",get(a));
    					);
    			</action>


    Multiple statements can be put into the initalization, increment and body sections:

    Code
    <action name="for_test2">
    				for (trace(initializing);set(a,0),a LT 5,trace(incrementing);inc(a),
    					trace("a=",get(a));
    					trace("looping");
    				);
    			</action>


    You can nest for loops as well. Note that if you loop over a large number of iterations you will run into krpano's actions overflow limitation (more info here). You can work around this with a wait(0} statement:

    Code
    <action name="for_test3">
    			for(set(a,-360),a LE 360,inc(a,30),
    				for(set(b,-360),b LE 360,inc(b,30),
    					trace("looping a=",get(a)," b=",get(b));
    				);
    				wait(0);   <!--BUGFIX appears to be necessary to prevent action overflow -->
    			);
    		</action>


    hope this helps

    steve