• Hallo,
    ich moechte in einem action script eine Funktion aufrufen und eine variable setzen.
    Leider verstehe ich die Syntax nicht und hab jetzt rumgegoogelt und rumversucht aber es funktioniert nicht.

    hiermit funktioniert einschalten, aber ausschalten funktioniert nicht:


    <action name="show_gallery">

    if(show_gallery[%1] == true );
    hide_gallery();
    //set(show_gallery[%1],false);
    //show_gallery[%1]=false;
    show_gallery=true;

    if(show_gallery[%1] == false );
    start_gallery();
    //set(show_gallery[%1],true);
    //show_gallery[%1]=true;
    show_gallery=true;

    else;
    start_gallery();
    //set(show_gallery[%1],true);
    //show_gallery[%1]=true;
    show_gallery=true;

    </action>


    ich weiss nciht wie ich die Variable setzen soll, dass es passt :-/

    Bitte hilft mir jemand kurz.

    Gruss,
    Torres

  • Ja, hatte ich dann auch versucht, aber funktioniert auch nicht:

    so habe ich es versucht: (beide Varianten funktionieren nicht, zumindest wird hide_gallery nie ausgefuehrt)

    if( foo == true ,
    hide_gallery()
    var foo = false;
    set(foo, false);
    ,
    start_gallery()
    var foo = true;
    set(foo, true);
    );

    Gruss,
    Torres

  • Servus,

    so schaut das aus was ich verwende:

    <!--
    <plugin name="foobar"
    style="button"
    x="-290" crop="299|2|27|19" onovercrop="326|2|27|19" ondowncrop="354|2|27|19"
    onhover="showtext(Gallerie,buttonstyle);"
    onclick="start_gallery();" />

    <plugin name="foobar2"
    style="button"
    x="-260" crop="299|2|27|19" onovercrop="326|2|27|19" ondowncrop="354|2|27|19"
    onhover="showtext(Gallerie,buttonstyle);"
    onclick="hide_gallery();" />
    -->

    <plugin name="foobar3"
    style="button"
    x="-290" crop="299|2|27|19" onovercrop="326|2|27|19" ondowncrop="354|2|27|19"
    onhover="showtext(Gallerie,buttonstyle);"
    onclick="show_gallery();" />

    <action name="show_gallery">

    if( foo == true ,
    hide_gallery()
    //var foo = false;
    //set(foo, false);
    ,
    start_gallery()
    //var foo = true;
    //set(foo, true);
    );

    </action>

    ----------------------------------------

    das start- und hide funktioniert so wie oben auskommentiert, dann sind es aber zwei Knoepfe.

    ----------------------------------------

    und das folgende habe ich im panorama forum gefunden:

    <include url="../xml_all/gallery_button.xml" />
    <include url="../xml_all/thumbbar.xml" />

    <action name="start_gallery">

    create_thumbbar(6, righttop, v, 10,10, 90,60, 6);

    thumbbar_addimage('images/0985280709/20978.jpg');
    thumbbar_addimage('images/0985280709/21004.jpg');
    thumbbar_addimage('images/0985280709/21042.jpg');
    thumbbar_addimage('images/0985280709/21053.jpg');
    thumbbar_addimage('images/0985280709/21055.jpg');
    thumbbar_addimage('images/0985280709/21056.jpg');


    tween(plugin[thumbbar].alpha, 0.5,1);

    tween(plugin[thumbbar_image_0].alpha, 1,1);
    tween(plugin[thumbbar_image_1].alpha, 1,1);
    tween(plugin[thumbbar_image_2].alpha, 1,1);
    tween(plugin[thumbbar_image_3].alpha, 1,1);
    tween(plugin[thumbbar_image_4].alpha, 1,1);
    tween(plugin[thumbbar_image_5].alpha, 1,1);
    tween(plugin[thumbbar_image_6].alpha, 1,1);

    set(plugin[thumbbar_image_0].enabled, true);
    set(plugin[thumbbar_image_1].enabled, true);
    set(plugin[thumbbar_image_2].enabled, true);
    set(plugin[thumbbar_image_3].enabled, true);
    set(plugin[thumbbar_image_4].enabled, true);
    set(plugin[thumbbar_image_5].enabled, true);
    set(plugin[thumbbar_image_6].enabled, true);

    </action>

    <action name="hide_gallery">

    tween(plugin[thumbbar].alpha, 0,1);
    tween(plugin[thumbbar_image_0].alpha, 0,1);
    tween(plugin[thumbbar_image_1].alpha, 0,1);
    tween(plugin[thumbbar_image_2].alpha, 0,1);
    tween(plugin[thumbbar_image_3].alpha, 0,1);
    tween(plugin[thumbbar_image_4].alpha, 0,1);
    tween(plugin[thumbbar_image_5].alpha, 0,1);
    tween(plugin[thumbbar_image_6].alpha, 0,1);

    set(plugin[thumbbar_image_0].enabled, false);
    set(plugin[thumbbar_image_1].enabled, false);
    set(plugin[thumbbar_image_2].enabled, false);
    set(plugin[thumbbar_image_3].enabled, false);
    set(plugin[thumbbar_image_4].enabled, false);
    set(plugin[thumbbar_image_5].enabled, false);
    set(plugin[thumbbar_image_6].enabled, false);
    </action>


    Gruss,
    Torres

  • Hi,

    ich moechte in einem action script eine Funktion aufrufen und eine variable setzen.
    Leider verstehe ich die Syntax nicht und hab jetzt rumgegoogelt und rumversucht aber es funktioniert nicht.

    Achtung - ich glaube du verwechselt das etwas - die 'Actions' in krpano und 'Actionscript" sind nicht dasselbe:

    Actionscript ist die Programmiersprache von Flash, und kann nur innerhalb von .swf Dateien (Plugins) verwenden werden,

    krpano selbst hat nur eine einfache Scriptsprache, bei der Befehl für Befehl schrittweise ausgeführt wird, wobei alle Befehle (Actions) folgenden Aufbau haben:

    Code
    action1(parameter); action2(parameter1,parameter2);   ...

    action1/action2 ... steht hier für den Namen des Befehls,

    das können entweder die vordefinierten Befehle sein,
    siehe hier: https://krpano.com/docu/actions/
    oder auch selbst per <action> Tag definierte,

    d.h. Variablen anlegen mit "var" oder Zuweisungen wie "a = b" gibt es nicht,
    (Kommentare wie '//' eigentlich auch nicht, wobei der Parser Befehle die mit '//' beginnen aber ignoriert )

    um eine Variablen auf den bestimmten Wert zu setzen, muss - set(var,wert) - verwendet werden,

    für mehr Information zum "if" Befehl, bitte (momentan noch) einen Blick in die "Releasennotes" Text Datei werfen,

    Schöne Grüße,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!