Hi Guys,
I always come here when I loose almost a day trying to make things work as I expect them to.
I have this situation:
I have a 3 languages layout.
Each language button when selected, have it's opacity at "1" and when not selected, at "0.5".
I created an action that calls the layout of each language when clicking on the desired language.
So.... this is the action:
<action name="change_alpha_flag">
set(plugin[btn_language1].alpha, 0.5);
set(plugin[btn_language2].alpha, 0.5);
set(plugin[btn_language3].alpha, 0.5);
wait(blend);
set(plugin[%1].alpha, 1);
</action>
I than created an action to change each language layout:
<action name="change-layout-en">
set(plugin[menu].url, %SWFPATH%/menu-en.gif);
set(plugin[show-map].url, %SWFPATH%/menu-map-en.png);
set(plugin[show-images].url, %SWFPATH%/menu-images-images-en.png);
set(plugin[menu-background].url, %SWFPATH%/menu-background-en.png);
if(plugin[btn_english].alpha == 1, infotext-en, infotext-es);
</action>
Here is the language button:
<plugin name="btn_spanish"
style="moduly_style"
url="%SWFPATH%/btn_spain.png"
alpha="0.5"
onhover="showtext(Español,STYLE1);"
x="80"
onclick="change_alpha_flag(btn_spanish); action(change-layout-es);" />
Here are some problems:
Some of the panos have a textbox that has 3 txt entries (1 for each language).
When I click each button, all layout structure and languages texts (textbox and other things) changes with no problems.
Considering I created for each one an action like: change-layout-en...... change-layout-es........ change-layout-pt
How can I select spanish language button (for example), then click into another panorama and keep this language selected?
It's restarting to the main language (language1).
I opted to keep="false" on most plugins cause they don't appear in all panoramas.
Considering that when clicking on the language buttons I have the layout changed perfectly with all texts and images updated, I decided to create this code:
<event onxmlcomplete="keep-layout"
<action name="keep-layout">
if(plugin[btn_language1].alpha == 1, change-layout-en, );
if(plugin[btn_language2].alpha == 1, change-layout-pt, );
if(plugin[btn_language3].alpha == 1, change-layout-es, );
</action>
BUT... it didn't work.
What's wrong with my structure? Am I thinking it wrong?
Another question:
I had an image that's a menu.
This menu has several children.
I couldn't update the url of this menu image (to change to another language text) cause it gone on top of all children when clicking on the languages buttons to change layout.
I tryed to insert a zorder command and it made no effect.
What happens to the plugins and children when an action changes its url?
Well... I think it got a little complicated to explain.
If you couldn't understand, please let me know.
I'm really getting crazy with it! :)
Thanks!!!!!!!!!!!!!!!!!!
Daniel