The Daily Click ::. Forums ::. Klik Coding Help ::. Weird List object problem
 

Post Reply  Post Oekaki 
 

Posted By Message

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
1st June, 2008 at 05:39:09 -

I have set up two buttons to scroll up and down through an offscreen list object. the selected line is displayed in an edit box and this all works ok. I have setup 2 counters to show which line of the list you are on out of the total number of lines. I want it so that if you press up or down at the bottom or top of the list it scrolls to top or bottom depending on where you are. e.g. bottom of list goes to top and top goes to bottom. I have succesfully got it to perform the top to bottom scroll but i cannot get it to do bottom to top. here is the code i am using:

Button "Up" Clicked
+ Counter "Line number" = 1
---- Set Current Line of "List Object" to Current Value of "Number of Lines"

This bit above works!!

Button "Down" Clicked
+ Counter "Line number" = Counter "Number of lines"
---- Set Current Line of "List Object" to 1

In theory this works but in practice it jumps to line 2!! Can anyone tell me why??

 
n/a

Nova Soft



Registered
  16/10/2005
Points
  427
1st June, 2008 at 06:03:21 -

Post deleted by user

Image Edited by the Author.

 
By a route obscure and lonely,
Haunted by ill angels only,
Where an Eidolon, named night,
On a black throne reigns upright,
I have reached these lands but newly
From an ultimate dim Thule
From a wild clime that lieth, sublime,
Out of space
Out of time.

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
1st June, 2008 at 12:57:15 -

Post deleted by user???

Can anyone hlp me with this??

 
n/a

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
1st June, 2008 at 15:03:51 -

Counter = number of lines plus or minus one maybe? (I can't remember which, my school brain's turned off.)

 

  		
  		

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
1st June, 2008 at 15:27:41 -

Assuming MMF does it like this:
line number/text
0 blah blah blah
1 blah blah blah
2 blah blah blah
3 blah blah blah

To get the first line you would need to jump to line #0

Example

"Up" pressed
+ Current Line = 0
:Set Line to ("Number of lines") - 1

"Down" pressed
+ Current Line = ("Number of lines") - 1
:Set Line to 0

 
My signature is never too big!!!

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
1st June, 2008 at 15:50:13 -

That's what I meant to communicate. But as I said, my school brain is off.

 

  		
  		

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
2nd June, 2008 at 01:43:52 -

the list object is set to a 1-based index and the first line is line 1. try setting the same thing up yourself and see if it does it for you.

 
n/a

Noyb



Registered
  31/05/2004
Points
  1117

VIP Member
6th June, 2008 at 12:19:22 -

Works for me: http://realnoyb.googlepages.com/ListScroll.mfa

Always: set list line number to counter
Up is pressed: subtract 1 from counter.
Down is pressed: add 1 to counter.
Counter == 0: set counter to number of lines.
Counter == number of lines + 1: set counter to 1.

I think your error is probably in how the code you posted interact with your standard list object moving (possibly in their relative order), but I'm not sure.

 
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
21st June, 2008 at 09:13:10 -

Help

I have got the following code setup but it is now jumping lines 1 and 160.

Image

 
n/a

Marko

I like you You like you

Registered
  08/05/2008
Points
  2804

Has Donated, Thank You!Game of the Week WinnerVIP Member360 OwnerDos Rules!Happy FellahCrazy EvilI am an April FoolGingerbread House
21st June, 2008 at 09:57:54 -

Button "Down" Clicked
+ Counter "Line number" = Counter "Number of lines"
---- Set Current Line of "List Object" to 1

In theory this works but in practice it jumps to line 2!! Can anyone tell me why??

.....dunno if it'll work, but try changing the third line to:

---- Set Current Line of "List Object" to 0

Let me know if it works; MMF can be a bit weird and i have found solutions like the above have worked in the past! If it jumps to line 2 instead of 1, this (in theory) should work. Should

 
Image

Subliminal Dreams. . ., daily gaming news and the home of Mooneyman Studios!
www.mooneyman-studios.webs.com

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
21st June, 2008 at 15:39:05 -

nope - didn't work. my list object is 1-based so that may be the reason that didn't work. anyone else got any ideas. Thanks though


EDIT: I fixed it. needed to swap around a little bit of code but it works now.

Image Edited by the Author.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click