How to use Style with every scrolling Thumbs ?

  • Hi,

    i'm using a customised version of the scrolling thumbs generated by VTour Editor,
    and want to assign style to thumbs, in my case i want to attach every thumbs a tiny pic, (small pic stay in bottom left corner of thumb while scrolling)

    so code looks like this :

    Code
    <layer name="thumb1" scale="0.5" style="thumb_style" url="panos/pano01/Panorama.tiles/thumb.jpg" align="left" x="16"  onclick="action(load_pano_01);" ondown="set(plugin[on_over].parent, layer[thumb1]);tween(plugin[on_over].alpha, 1, 0.3);" onup="tween(plugin[on_over].alpha, 0, 0.3);"/>
    <layer name="thumb2" scale="0.5" style="thumb_style" url="panos/pano02/Panorama.tiles/thumb.jpg" align="left" x="160" onclick="action(load_pano_02);" ondown="set(plugin[on_over].parent, layer[thumb2]);tween(plugin[on_over].alpha, 1, 0.3);" onup="tween(plugin[on_over].alpha, 0, 0.3);"/>
    			
    ...
    
    
    and i define my style like this :
    <style name="thumb_style" alpha="1" onloaded="set(plugin[thumb_360pic].parent, layer[thumb1])"  />

    it works for "thumb1" but i want a code to apply every thumbs, how to do that ?

    and second question, if i have 2 styles,
    how to apply the style to every thumbs assigned with the style ?

    i don't know if an image plugin can have several parents or not,
    may be there another solution,
    i don't get it for now *confused*

    thanks *smile*

    z

  • well i make some progress...

    i can select all thumbs with the same style and remove them with :

    then next step is to trigger an action on selected thumbs, for testing i want alpha 0.5 :

    Code
    <!--  SELECT THUMBS with specific attributes AND apply action -->
     for(set(i,0), i LT layer.count, inc(i),
     <!-- SELECTION  -->
      if(layer[get(i)].style == thumb_style1,
    <!-- ACTION ON SELECTED -->
      set(layer[get(layer[get(i)].name)].alpha, 0.5);<!-- set(layer[get(variable_name)].attribute,value); -->
    
    
      );
    );


    works ok here,

    and final step will be to attach the small pic to the selected thumbs...

    any help welcome

    Thanks

    z

    2 Mal editiert, zuletzt von zadda (17. Februar 2013 um 19:43)

  • Hi!
    for set some layer attribute you need to do so

    set(layer[name].attribute,value);
    or
    set(layer[name].attribute,get(variable));

    or
    set(layer[get(variable_name)].attribute,value);

    or
    set(layer[get(index_var)].attribute,value);

    or
    copy(layer[name].attribute,variable);


    or (I love this option)
    copy(layerobj,layer[name]);
    and then set attributes
    set(layerobj.attribute,value);


    Hope it help
    Regards
    Andrey *thumbup*

  • ok, Thanks,
    you see my mistake with fresh eyes *thumbup*
    so, i correct it and its working as expected,
    but now i have to find a way to paste my tiny pic to the styled thumbs *confused* as it was my goal in first instance,
    but i progress by small steps....

    z

  • well,
    i can attach my tiny pic to selected thumbs, but there something wrong in my action as only the last selected thumbs got the pic, i think action loop and jump from thumbs to thumbs until the last one :

    my 360_pic is a plugin image,
    so it is possible to load it several time being parent of each thumbs or there another easier solution ?? *confused*

    Thanks *smile*

    z

Jetzt mitmachen!

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