• I'm trying to create a button the continually pans the map when you hold it down. I can get it to move on every mousedown but if I try and get it to loop and keep moving it just crashes.

    Here's what I've tried:

    Code
    <action name="mapmove">
    set(mapmove_off,false);
    plugin[map].panby(%1,%2);
    if(mapmove_off !=true, mapmove(%1,%2));"
    </action>..........
    
    
    <plugin name="mapnavbut_up" url="%SWFPATH%/assets/buttons/map_nav_but.png" alpha="0" parent="mapnav"  handcursor="true" visible="true" enabled="true" keep="true" align="center" edge="center" x="0"y="-44" ondown="mapmove(0,-1)" onup="set(mapmove_off,true)" onover="set(plugin[mapnavbut_up].alpha,1)" zorder="111" onhover="" onout="set(plugin[mapnavbut_up].alpha,0);set(mapmove_off,true)"/>
  • Hi,

    it crashes/stops because the "mapmove" action is an endless loop
    (during execution no events will be processed and so the "mapmove_off" will be never set)

    the flashplayer works in an single-threaded way:
    1. execute actionscript code (krpano actions too)
    2. then the graphics will be rendered
    3. then the events will be catched/processed
    4. and then it loops again

    see here:
    http://onflash.org/ted/2005/07/fl…del-elastic.php

    so the action must stop at a time and continue later (in the next processing loop),
    this can be done in krpano by using delayedcall(),
    e.g.

    Code
    <action name="mapmove">
      set(mapmove_off,false);
      plugin[map].panby(%1,%2);
      delayedcall(0.1, if(mapmove_off !=true, mapmove(%1,%2)); );
    </action>

    best regards,
    Klaus

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!