dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: layout and interspersing of dynamic and input fields on the fly

  1. #1
    seeking wisdom
    Join Date
    Oct 2000
    Location
    all environments
    Posts
    50

    layout and interspersing of dynamic and input fields on the fly

    I have an interesting layout/DB problem in Flash that I don't know how to solve:

    I need to dynamically create a list of fill-in-the-blank questions. The text will be dynamically created using variable(s) from a DB, and the input boxes for fill-in-the-blank will appear at various places in each sentence, in-line. Once the submit button is hit, the contents of the input boxes will be sent back to the DB.

    For example, if the fill-in exercise is:
    "The United States is _______ miles from the moon."
    - the text string "The United States" is a variable that will come from the DB (and could be the name of whatever country the user selected as the topic for the exercises)
    - the input box would go where the underscores are

    Some background:
    I am using Flash MX 2004 Pro *but* I have to publish for Flash Player 6 and lower

    *Can* I do this on the fly? And if so, how?

    Thanks so much in advance for any help.

    Best,
    Sarah
    Make your life a work of art and your art a work of life

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    It will be very hard to place the textbox dynamically and also change its size depending on the length of the answer. Much easier if you have a separate textbox on the side that the user fills in OR have them just write in the textfield where the question is. To detect the correct answer you can use the indexOf() function.

    if (textfieldName.indexOf("234567") > 1){
    // Correct action here
    }else{
    // No completely wrong!! action here
    }

    ...or use the variable with the corrext answer.....

    if (textfieldName.indexOf(variableFromDB) > 1){


    ...should also work.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center