[solved] Problem with zorder in child of textfield layer.

  • Hi! I'm new in programming, but i have read a lot and decide to make my own template, with fixed hotspot tooltips, dynamic scene titles inside and bg pic.

    So my problem is that i cannot see textfield layer behing the layer with a bg pic.. (png) Textfield is a child of hotspot, bg layer is a child of textfield, zorder does not work..

    When i make both textfield and bg layer childr of hotspot, zorder works fine, but bg layer does not fit textfild.. I tried to get "width" of textfield layer but did not sucсeed... please help!

    The Code :

    <style
    name="hs_tooltip_style"
    url="%SWFPATH%/plugins/textfield.swf"
    align="right"
    autowidth="true"
    edge="left"
    zorder="10"
    enabled="true"
    x="0"
    background="false"
    textshadow="0.5" textshadowrange="6.0" textshadowangle="90" textshadowcolor="0x000000" textshadowalpha="1.0"
    css="text-align:center; color:#eeeeee; font-family:roboto_condensedregular; font-size:13px; font-weight:normal; padding-left:7px; padding-right:7px;"
    html=""
    />

    <style name="tooltip_bg" url="%SWFPATH%/skin/assets/tooltip_hotspot_bg.png" alpha="1" align="left" edge="left" x="0" height="30" width="100%" zorder="1"/>

    <action name="add_hs_tooltips">
    for(set(i,0), i LT hotspot.count, inc(i),

    txtadd(hs_tooltip_bg_name, 'hs_tooltip_bg',get(i));
    addlayer(get(hs_tooltip_bg_name));
    txtadd(hs_tooltip_name, 'hs_tooltip',get(i));
    addlayer(get(hs_tooltip_name));

    layer[get(hs_tooltip_bg_name)].loadstyle(tooltip_bg);
    layer[get(hs_tooltip_name)].loadstyle(hs_tooltip_style);

    txtadd(parent_hs_name, 'hotspot[',get(hotspot[get(i)].name),']');

    copy(layer[get(hs_tooltip_bg_name)].parent, hs_tooltip_name);
    copy(layer[get(hs_tooltip_name)].parent, parent_hs_name);

    copy(layer[get(hs_tooltip_name)].html, hotspot[get(i)].tooltip);

    );

    </action>


    <style name="skin_hotspotstyle" url="assets/hotspot.png" scale="1" edge="top" oy="0" distorted="false"
    tooltip=""
    onclick="if(linkedscene, skin_hidetooltips(); tween(scale,0.25,0.5); tween(oy,-20,0.5); tween(alpha,0,0.5); looktohotspot(get(name),100,smooth(200,50,50)); loadscene(get(linkedscene),null,MERGE,BLEND(1)); skin_updatescroll(); );"

    onloaded="if(skin_settings.tooltips_hotspots, if(linkedscene, copy(tooltip,scene[get(linkedscene)].title); loadstyle(skin_tooltips_hotspot); )); add_hs_tooltips();"

    />

    Einmal editiert, zuletzt von ntnj (24. Februar 2015 um 16:52)

  • Thank you for reply!

    I found size of textfield:

    onautosized="set(size, get(width));
    trace(size);
    showlog();"

    How to resize dynamicly generated layers with my background ?

    I try this :

    onautosized="
    set(s1, get(width));
    set(n1, get(name));
    copy(layer[get(n1)].onautosized, s1);
    "

    and

    set(layer[get(hs_tooltip_bg_name)].width, layer[get(hs_tooltip_name)].onautosized);

    but not working..

    2 Mal editiert, zuletzt von ntnj (23. Februar 2015 um 17:13)

  • I made like this and it is working! Maybe it is not right way to get size )

    style
    name="hs_tooltip_style"
    url="%SWFPATH%/plugins/textfield.swf"
    align="right"
    autowidth="true"
    onautosized="get_size();"
    edge="left"
    zorder="5"
    enabled="true"
    x="0"
    background="false"
    textshadow="0.5" textshadowrange="6.0" textshadowangle="90" textshadowcolor="0x000000" textshadowalpha="1.0"
    css="text-align:center; color:#eeeeee; font-family:roboto_condensedregular; font-size:13px; font-weight:normal; padding-left:7px; padding-right:8px;"
    html=""
    />
    <action name="get_size">
    set(hts, get(width));
    set(htn, get(name));
    copy(layer[get(htn)].onautosized, hts);
    for(set(i,0), i LT hotspot.count, inc(i),
    txtadd(hs_tooltip_bg_name, 'hs_tooltip_bg',get(i));
    txtadd(hs_tooltip_name, 'hs_tooltip',get(i));
    copy(layer[get(hs_tooltip_bg_name)].width, layer[get(hs_tooltip_name)].onautosized);
    );
    </action>

Jetzt mitmachen!

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