I'm trying to create an action to create a layer and sub-layers, and even sub-layers of a sublayer.
Is this possible? Any hint on how to do this?
Thanks,
Set a layer dynamically as a child
-
-
Yes, it's possible
For set some layer as childJust set parent attribute as parent layer name
Regards
Andrey -
Do you mean...
... if this is what I want:
Code
Alles anzeigen<layer name="img_bg1" url="plugins/textfield.swf" keep="true" type="container" visible="false" align="center" width="720" height="605" x="0" y="0" zorder="10" background="true" backgroundcolor="0xFFFFFF" backgroundalpha="0.7" roundedge="20"> <layer name="title1" url="plugins/textfield.swf" enabled="false" align="top" edge="top" width="700" x="0" y="10" autoheight="true" background="false" border="false" roundedge="10" css="text-align:left; color:#444444; font-family:Arial; font-size:20px;" html="[b]TITOLO[/b]" /> <layer name="close_img_bg1" url="plugins/textfield.swf" enabled="true" align="topright" edge="topright" width="30" x="10" y="10" autoheight="true" background="true" backgroundcolor="0x000000" backgroundalpha="0.9" border="false" roundedge="10" css="text-align:center; color:#888888; font-family:Arial; font-size:20px;" html="[b]X[/b]" onclick="switch(layer[img_bg1].visible); set(layer[info_data1].visible,false);" /> ... </layer>
...and this is the action to build the above stucture:
Code
Alles anzeigen<layer name="button" visible="true" url="skin/zoominhotspot.png" orientation="portrait" keep="true" align="righttop" x="50" y="50" onclick="checkoriantation();" /> <action name="checkoriantation"> if(layer[%1].orientation == 'landscape', build_hbox(), build_vbox()); </action> <action name="build_hbox"> </action> <action name="build_vbox"> set(layer[img_bg1].'url,plugins/textfield.swf'); set(layer[img_bg1].keep,true); set(layer[img_bg1].visible,false); set(layer[img_bg1].align,center); set(layer[img_bg1].width,720); set(layer[img_bg1].height,605); set(layer[img_bg1].x,0); set(layer[img_bg1].y,0); set(layer[img_bg1].zorder,10); set(layer[img_bg1].background,true); set(layer[img_bg1].backgroundcolor,'0xFFFFFF'); set(layer[img_bg1].backgroundalpha, 0.7); set(layer[img_bg1].roundedge,20); set(layer[title1].parent,layer[img_bg1]); set(layer[title1].url,'plugins/textfield.swf'); set(layer[title1].enabled,false); set(layer[title1].align,top); set(layer[title1].edge,top); set(layer[title1].width,700); set(layer[title1].x,0); set(layer[title1].y,10); set(layer[title1].autoheight,true); set(layer[title1].background,false); set(layer[title1].border,false); set(layer[title1].roundedge,10); set(layer[title1].css,'text-align:left; color:#444444; font-family:Arial; font-size:20px;'); set(layer[title1].html,'[b]TITOLO[/b]'); set(layer[title1].height); set(layer[title1].height); set(layer[close_img_bg1].parent,layer[img_bg1]); set(layer[close_img_bg1].url,'plugins/textfield.swf'); set(layer[close_img_bg1].enabled,true); set(layer[close_img_bg1].align,topright); set(layer[close_img_bg1].edge,topright); set(layer[close_img_bg1].width,30); set(layer[close_img_bg1].x,10); set(layer[close_img_bg1].y,10); set(layer[close_img_bg1].autoheight,true); set(layer[close_img_bg1].background,true); set(layer[close_img_bg1].backgroundcolor,'0x000000'); set(layer[close_img_bg1].backgroundalpha,0.9); set(layer[close_img_bg1].border,false); set(layer[close_img_bg1].roundedge,10); set(layer[close_img_bg1].css,'text-align:center; color:#888888; font-family:Arial; font-size:20px;'); set(layer[close_img_bg1].html,'[b]X[/b]'); set(layer[close_img_bg1].onclick,'switch(layer[img_bg1].visible); set(layer[info_data1].visible,false);'); ... </action>
Am I doing well?
As you can see, my intension is to click on a button(hotspot) to open an image inside a box(textfield) and show some info.
Also, images can be portrait or landscape: how can I check orientation of the photo without giving the parameter "orientation" to the button?
Thanks.
Regards, -
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!