next & previous with 2 buttons
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
next & previous with 2 buttons
hi.
I don't know if this question have answered before,i have use the search button but i don't find anything..
i have 2 buttons next and previous,and in the same card i have some groups to show some infos.
is possible to cycle this groups back and forward with the buttons (next-Previous) ?
thank you..
I don't know if this question have answered before,i have use the search button but i don't find anything..
i have 2 buttons next and previous,and in the same card i have some groups to show some infos.
is possible to cycle this groups back and forward with the buttons (next-Previous) ?
thank you..
Re: next & previous with 2 buttons
in next button
in previous button
Code: Select all
on mouseUp
go to cd(the number of this cd+1)
end mouseUp
Code: Select all
on mouseUp
go to cd(the number of this cd-1)
end mouseUp
Re: next & previous with 2 buttons
thank you magice..
I know how to go between card's,i don't want to change cards i want to change the groups that exist in the card like slide
I know how to go between card's,i don't want to change cards i want to change the groups that exist in the card like slide
Re: next & previous with 2 buttons
Hi brandcode,
You have to create a global or local variable to store the current group
Something like that:
Best regards
Jean-Marc
You have to create a global or local variable to store the current group
Something like that:
Code: Select all
local sGroupName,sCurrentGroup
on opencard
put "myGroup1,myGroup2,myGroup3" into sGroupName
repeat for each item tGroup in sGroupName
hide group tGroup
end repeat
put 1 into sCurrentGroup
doShowMyGroup
end opencard
on goNextGrp
if sCurrentGroup = the num of items of sGroupName then
beep
exit goNextGrp
end if
doHideCurrentGrp
add 1 to sCurrentGroup
doShowMyGroup
end goNextGrp
on goPrevGrp
if sCurrentGroup = 1 then
beep
exit goPrevGrp
end if
doHideCurrentGrp
subtract 1 from sCurrentGroup
doShowMyGroup
end goPrevGrp
on doShowMyGroup
show group (item sCurrentGroup of sGroupName)
end doShowMyGroup
on doHideCurrentGrp
hide group (item sCurrentGroup of sGroupName)
end doHideCurrentGrp
Jean-Marc
https://alternatic.ch
Re: next & previous with 2 buttons
You can do a number of things. One very simple way would be to
you can get more stylish by locking the screen for visual effect and unlocking again to deliver that effect-you can also apply the effect to just the part of the screen, but that's a bit hard to check and explain while just using this phone at the moment.
Code: Select all
set the visible of group "slideOne to false
Set the visible of group "slideTwo" to true
Re: next & previous with 2 buttons
thank you jmburnod and sparkoutjmburnod wrote:Hi brandcode,
You have to create a global or local variable to store the current group
Something like that:
Best regardsCode: Select all
local sGroupName,sCurrentGroup on opencard put "myGroup1,myGroup2,myGroup3" into sGroupName repeat for each item tGroup in sGroupName hide group tGroup end repeat put 1 into sCurrentGroup doShowMyGroup end opencard on goNextGrp if sCurrentGroup = the num of items of sGroupName then beep exit goNextGrp end if doHideCurrentGrp add 1 to sCurrentGroup doShowMyGroup end goNextGrp on goPrevGrp if sCurrentGroup = 1 then beep exit goPrevGrp end if doHideCurrentGrp subtract 1 from sCurrentGroup doShowMyGroup end goPrevGrp on doShowMyGroup show group (item sCurrentGroup of sGroupName) end doShowMyGroup on doHideCurrentGrp hide group (item sCurrentGroup of sGroupName) end doHideCurrentGrp
Jean-Marc
i am sure i have long way to learn..thank you for point me the right way
Re: next & previous with 2 buttons
Hi.
Do you want to hide all the groups but the current one of interest? Or just hilite that group in some way, to set it apart visually? In either case, the solution is simple and fun.
Where are you with LC? How long have you been working with it? Have you written any handlers on your own yet? Please write back, and we will give you a good running start.
Craig Newman
Do you want to hide all the groups but the current one of interest? Or just hilite that group in some way, to set it apart visually? In either case, the solution is simple and fun.
Where are you with LC? How long have you been working with it? Have you written any handlers on your own yet? Please write back, and we will give you a good running start.
Craig Newman
Re: next & previous with 2 buttons
Hi again.
Here is an experiment for you:
On a new card make five buttons. Name them "Next", "xx1", "xx2" and "xx3" and "xx4".
In the script of btn "next":
Now hide btns "xx2", "xx3" and "xx4". Only "xx1" and "next" should be visible. Click on the "next" button. Simple, eh? But what happens after the fourth click? How can we fix this? Can you write the handler for a new button that you will name "previous"? Will the same sort of problem exist there as well? To make your life easier while playing, you might want to make yet another button that shows all the buttons, or maybe hides all the "xx" buttons but one. You will learn a lot just making tools that allow you to work out the actual issues with your project.
Get going.
Craig
Here is an experiment for you:
On a new card make five buttons. Name them "Next", "xx1", "xx2" and "xx3" and "xx4".
In the script of btn "next":
Code: Select all
on mouseUp
repeat with y = 1 to the number of btns
if the name of btn y contains "XX" and the visible of btn y then
hide btn y
show btn (y+1)
exit to top
end if
end repeat
end mouseUp
Get going.
Craig