hotspots with double actions

  • Hello!

    I have made my first pano with zooming pictures. http://www.pernylen.se/pano/entrappaner/
    Now i would like to have a small button for each picture for the visitor to click and get to another site/url where you can buy that painting. My question is, how do you write the code so you get that button beside each pic with a unique url attached ?
    I have tried with parent and the plugin but without any success. Is there anyone who have any idea?
    I attached the xmlfile if that helps any of you to help me. *smile*

    Many thanks in advance.

    Per Nylén

  • Hello again!

    Now I have solved the problem, instead of textfield.swf I made my own swf Flash with the correct information. At last. I still have some programming questions though. How to get a generic load function for my <action name="order field">. It would be nice not to add a new <action name="order field"> for each hotspot and a new <plugin name="htmltext" url="%SWFPATH%/plugins/zara2.swf" /> for each plugin as well.

    Can you incorporate my "orderfield with the flyin or flyout or showpic actions like pic="sven" in the hotspot code. I just would like to add the swf name for each hotspot. And also close the orderfield when the picture is closed which I achieved, but its not a good programming solution. I am not a programmer but I think that someone of you can give some hints. *smile*

    <action name="flyin">
    if(hotspot[%1].flying == 0.0, hotspot[%1].resetsize(); calc_flyout_size(%1); );
    if(hotspot[%1].oldscale === null, copy(hotspot[%1].oldscale, hotspot[%1].scale) );
    if(hotspot[%1].oldrx === null, copy(hotspot[%1].oldrx, hotspot[%1].rx) );
    if(hotspot[%1].oldry === null, copy(hotspot[%1].oldry, hotspot[%1].ry) );
    if(hotspot[%1].oldrz === null, copy(hotspot[%1].oldrz, hotspot[%1].rz) );
    set(hotspot[%1].enabled,true);
    set(hotspot[%1].visible,true);
    tween(hotspot[%1].alpha, 1.0);
    tween(hotspot[%1].flying, 1.0);
    tween(hotspot[%1].scale, 1.0);
    tween(hotspot[%1].rx, 0.0);
    tween(hotspot[%1].ry, 0.0);
    tween(hotspot[%1].rz, 0.0);
    </action>

    <!-- fly the hotspot out/back -->
    <action name="flyout">
    set(plugin[htmltext2].visible,false);
    set(plugin[htmltext].visible,false);
    set(hotspot[%1].enabled,false);
    tween(hotspot[%1].alpha, 0.0, 0.5, default, set(hotspot[%1].visible,false); );
    tween(hotspot[%1].flying, 0.0);
    tween(hotspot[%1].scale, get(hotspot[%1].oldscale));
    tween(hotspot[%1].rx, get(hotspot[%1].oldrx));
    tween(hotspot[%1].ry, get(hotspot[%1].oldry));
    tween(hotspot[%1].rz, get(hotspot[%1].oldrz));
    </action>

    <action name="showpic">
    <!-- creates a new hotspot and fly it out -->
    if(hotspot[get(pic)] === null,
    txtadd(picfilename,'%CURRENTXML%/graphics/pic_',get(pic),'.jpg');

    addhotspot(get(pic));
    getcenter(hsath,hsatv);
    copy(hotspot[get(pic)].ath, hsath);
    copy(hotspot[get(pic)].atv, hsatv);
    set(hotspot[get(pic)].visible,false);
    set(hotspot[get(pic)].distorted,true);
    set(hotspot[get(pic)].zorder,2);
    set(hotspot[get(pic)].scale,0.1);
    set(hotspot[get(pic)].alpha,0.0);
    <!--set(hotspot[get(pic)].effect,glow(0xFFFFFF,1.0,30,10000);dropshadow(10,45,0x000000,10,0.3););-->
    set(hotspot[get(pic)].onloaded, flyin(get(name)) );
    set(hotspot[get(pic)].onclick, flyout(get(name)) );
    copy(hotspot[get(pic)].url,picfilename);
    ,
    flyin(get(pic));
    );
    </action>

    <action name="orderfield">


    tween(plugin[htmltext].alpha,1,0);
    tween(plugin[htmltext].textblur,0,0);
    tween(plugin[htmltext].blur,0,0);
    set(plugin[htmltext].visible,true);
    set(plugin[htmltext].enabled,true);
    tween(plugin[htmltext].y,0);
    </action>

    <action name="orderfield2">

    set(plugin[htmltext2].y,-1200);
    tween(plugin[htmltext2].alpha,1,0);
    tween(plugin[htmltext2].textblur,0,0);
    tween(plugin[htmltext2].blur,0,0);
    set(plugin[htmltext2].visible,true);
    set(plugin[htmltext2].enabled,true);
    tween(plugin[htmltext2].y,0);
    </action>

    <hotspot name="huspamoln" devices="all"
    keep="false"
    visible="true" enabled="true" usecontentsize="false" handcursor="true" capture="true" children="true" maskchildren="false"
    zorder="0"
    fillcolor ="0xffffff" fillalpha ="0.00" borderwidth ="0.0" bordercolor ="0xffffff" borderalpha ="0.00"
    fillcolorhover="0xffffff" fillalphahover="0.10" borderwidthhover="4.0" bordercolorhover="0xffffff" borderalphahover="0.80"
    fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
    onover=""
    onhover=""
    onout=""
    ondown=""
    onup=""
    onclick="action(orderfield);showpic();"
    altonloaded="if(isphone, mul(scale,2));"
    alturl="hotspots/zoomicon.png"
    pic="sven"
    >
    <point ath="-50.1100" atv=" 11.5643" />
    <point ath="-34.0977" atv=" 11.7832" />
    <point ath="-33.8845" atv=" 24.4127" />
    <point ath="-50.7315" atv=" 23.6175" />
    <point ath="-50.0115" atv=" 11.6573" />

    </hotspot>

    <hotspot name="kallt" devices="all"
    keep="false"
    visible="true" enabled="true" usecontentsize="false" handcursor="true" capture="false" children="true" maskchildren="false"
    zorder="0"
    fillcolor ="0xffffff" fillalpha ="0.00" borderwidth ="0.0" bordercolor ="0xffffff" borderalpha ="0.00"
    fillcolorhover="0xffffff" fillalphahover="0.10" borderwidthhover="4.0" bordercolorhover="0xffffff" borderalphahover="0.80"
    fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
    onover=""
    onhover=""
    onout=""
    ondown=""
    onup=""
    onclick="action(orderfield2);showpic();"
    altonloaded="if(isphone, mul(scale,2));"
    alturl="hotspots/zoomicon.png"
    pic="olle"
    >
    <point ath=" 49.3580" atv=" 17.0635" />
    <point ath=" 72.0554" atv=" 16.3666" />
    <point ath=" 73.2437" atv=" 39.6962" />
    <point ath=" 48.6403" atv=" 40.5547" />
    <point ath=" 49.3580" atv=" 17.0635" />
    </hotspot>



    <plugin name="htmltext" url="%SWFPATH%/plugins/zara2.swf"
    align="right" width="" height="" x="10" y="-1100" visible="false"

    autosize=""
    />

    <plugin name="htmltext2" url="%SWFPATH%/plugins/zara3.swf"
    align="right" width="" height="" x="10" y="-1100" visible="false"

    autosize=""
    />


    Regards and many thanks in advance!

    /Per

Participate now!

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