Get a value from a segmented control...

Discussion in 'Jiggy Runtime Development' started by blackjak231, Jun 19, 2008.

  1. blackjak231

    blackjak231 Member

    Joined:
    Oct 1, 2007
    Messages:
    759
    Likes Received:
    6
    Device:
    iPhone 4 (White)
    Hey guys!

    I'm working on some code, and i want to put a segmented control and get a value from it.
    I know how to get the value from a slider, its easy, but i now want to get the value of a segmented control.
    The problem is, i want to have words in the segmented control, but i need to get a number....
    Basically i have this code(this is just an example!):
    Code:
    sc = new UISegmentedControl( [ 10 , 40 , 300 , 48 ] , 0 );
    
    sc.insertTitleSegment( 0 , "First" , true );
    sc.insertTitleSegment( 1 , "Second" , true );
    sc.insertTitleSegment( 2 , "Third" , true );
    
    sc.selectedSegment = 1;
    
    and lets say i want the cell title to change when i hit one of the buttons, so i use this:
    Code:
    cell.title=sc.value;
    BUT, instead of having "First", "Second", or "Third" to show i want a number to show, for example 10 for first...Etc

    I hope someone out there has an answer!
    bye
  2. blackjak231

    blackjak231 Member

    Joined:
    Oct 1, 2007
    Messages:
    759
    Likes Received:
    6
    Device:
    iPhone 4 (White)
    Ok, just a tiny bump to explain what i want a little bit better...

    Basically, i am trying to do levels for a game, and to increase the difficulty, i have to increase a number ine the code, and i dont know how to do that from a segmented control...

    I hope this explains it a little better....
    Plz, if anyone, help me

    Please Register or Log in to view images

Share This Page