XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 10th, 2025, 2:38 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: February 5th, 2014, 7:32 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Guys can you help me with this function/script?

I have a button and I want with a click on it to open 4 layers but with 0.5sec delay for each one (effect of a fan)

Click Button = open->layer1, layer2-delay 0.5s, layer3-delay 1sec, layer4-delay 1.5sec

Thanks in advance!

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: February 6th, 2014, 3:18 pm 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
use this code:
(don't forget to add [button1OnClick] to [OnClick] of button1 in the [function tab] of inspector)
Code:
function button1OnClick(Sender)
{
    i=1
    setTimeout("Visibler",500)
}

function Visibler()
{
  eval('layer'+i).Visible=1
  i+=1
  if(i>4)
  {
    return;
  }
  setTimeout("Visibler",500)
}


Top
 Profile  
 
PostPosted: February 6th, 2014, 4:33 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Thanks hamid!!! Works great! :)
But I would like to have a show/hide control.. How can I edit the code for this...?

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: February 6th, 2014, 7:58 pm 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
Code:
function button1OnClick(Sender)
{
    i=1
    setTimeout("Visibler",500)
}

function Visibler()
{
  eval('layer'+i).Visible=!eval('layer'+i).Visible
  i+=1
  if(i>4)
  {
    return;
  }
  setTimeout("Visibler",500)
}


Top
 Profile  
 
PostPosted: February 6th, 2014, 8:44 pm 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
why i have used it that way (with return!!!);
it could be simpler this way:
Code:
function button1OnClick(Sender)
{
    i=1
    setTimeout("Visibler",500)
}

function Visibler()
{
  eval('layer'+i).Visible=!eval('layer'+i).Visible
  i+=1
  if(i<=4)
  {
  setTimeout("Visibler",500)
  }
}


Top
 Profile  
 
PostPosted: February 7th, 2014, 3:23 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Now it's perfect! Thanks man!!! :D

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 26 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group