x3fold's Forum Posts

  • Thanks guys. I had actually figured it out in the end.

    Am using the following with several instances of the same object

    System -> For "i" from 0 to 4
        System -> Pick myTextBox0 instance loopindex("i"):   myTextBox0 -> Set text to myArray.At(loopindex("i"), 0)
    [/code:1yheo6zg]
    
    Still finding my feet with C2, its difficult when you're used to hand coding stuff to then work with event and behaviors
  • Yes I'm using separate text box objects as if I just use one then they all show them same text each time.

    Also I'm not sure if it makes a difference but its the text field object I'm using not a text box (my mistake for use of phrase)

  • Hi,

    I'm used to programming in different language and I'm giving construct a try to see if I can make prototypes quicker using it.

    I'm struggle a little bit with what should be basic stuff, but I can't figure out if theres a quick way of doing this.

    I need to pull multiple values out of an array and enter each one into a series of text boxes.

    Normally I would right something similar to this:

    for (i = 0; i < 10; i ++){
    	this.myTextBox[i] = myArray[i,0]
    }[/code:1lwa1qi6]
    
    However, when using C2 I can't see a way to access multiple text boxes at once using a for loop. Do I have to write to each one separately?
    
    [code:1lwa1qi6]
    myTextBox0: Set text to myArray.At(0,0)
    myTextBox1: Set text to myArray.At(1,0)
    myTextBox2: Set text to myArray.At(2,0)
    myTextBox3: Set text to myArray.At(3,0)
    myTextBox4: Set text to myArray.At(4,0)
    myTextBox5: Set text to myArray.At(5,0)
    myTextBox6: Set text to myArray.At(6,0)
    myTextBox7: Set text to myArray.At(7,0)
    myTextBox8: Set text to myArray.At(8,0)
    myTextBox9: Set text to myArray.At(9,0)
    [/code:1lwa1qi6]
    
    Surely I'm missing something obvious here??
  • ah yes, of course

    using TextBox.Text="" works fine

    thanks

  • sorry it was a typo above I meant ""

    currently I have

    Button On Clicked
    System -> Compare Two Values -> int(TextBox.Text) = ""
    Text -> Set text to "empty"[/code:21sy3pkg]
    
    I set the Text field up so I could see if there function was working... which it isn't
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • thanks, that worked perfectly

    one further question... is there such a thing as null values in Construct?

    I have it set that if the Textbox is equal to CorrectAnswer its correct, else its wrong, but I would like it that if nothing has been entered into the Textbox then nothing happens

    I've tried

    Int(TextBox.Text) equals " "
    Int(TextBox.Text) equals Null
    Int(TextBox.Text) equals NaN[/code:378j1uy1]
    
    So I'm guessing this isn't the way to do it in Construct
  • Yes, I already have a textbox, but I don't know how to access/compare when the button is pressed?

  • Hi,

    I'm trying to make some elearning math content.

    I need to be able to show on screen a question (eg 1 + 2), then have a input text field that the user will enter the answer into.

    Once they've entered the answer they need to click a check answer button that then marks the question right or wrong.

    Can someone point me in the right direction, I've look through the docs and the forum but can't see anything similar to this.

    Thanks

  • Hi,

    I need to add a single php require_once statement to the default index.html file that is created when publishing to html5.

    In the past when I've create website and web apps I've just been able to add the php code to a page/file and change the extension of the file from .html to .php and its all worked fine.

    Unfortunately that doesn't seem possible when using C2.

    Not sure if this is possible or if someone has a workaround/can point me in the right direction.

    Thanks