Archived

This topic is now archived and is closed to further replies.

Alba

Simple on/off switch

Recommended Posts

Hi Guys,up till now I have been using Panel Studio to redo my panels. Nice and easy using default and 3rd party gauges. Now when I want to try and make a simple switch myself following an XML tutorial, I cannot get the switch to change bmps. I know it will be simple for you to see what's wrong but as a beginner I am stuck.Here's the code :-(G:Var1, bool)90 (>K:PANEL_ID_TOGGLE)Display/Hide a/c radarIt toggles the panel window ok but the bmps don't change. Could someone show me what I've done wrong please?Regards...Kenny

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi,Your bitmaps change by (G:Var1) variable so you need (G:Var1) in the section.like:(G:Var1)(G:Var1) ! (>G:Var1) 90 (>K:PANEL_ID_TOGGLE)Hope it helpsJan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Hello Jan. Thanks for coming in but unfortunately your tip still does not change the bmp. The off bmp still stays and the on bmp does not show. The window toggles ok but the code still needs a tweak somewhere.Can you think of any other option? I will check my Tutorial again and also check my bmps. As a newbie I may have screwed up elsewhere and coding could be ok.Regards...Ken

Share this post


Link to post
Share on other sites

Hi,May be this, with L variable, works(L:radar switch,enum)(L:radar switch,enum) 0 == if{ 1 (>L:radar switch,enum) } els{ 0 (>L:radar switch,enum) } 90 (>K:PANEL_ID_TOGGLE) Display/Hide a/c radar

Share this post


Link to post
Share on other sites

Hello again Jan.Yes, that works fine thanks. I also got some code info from Rob in my post about cab files. His code works also. I realise now that there are several options when coding XML. The tutorial I am following just gives the basics and like most tutorial it assumes a knowledge of XML. It does not allow for complete beginners who initially need led by the hand regarding some basic rules.Thanks again.Regards...Kenny

Share this post


Link to post
Share on other sites