A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: help me...in actionscript

  1. #1
    Junior Member
    Join Date
    Jun 2001
    Posts
    20

    Actionscript help needed..........urgent....pls

    PART A
    i have an array
    EG.
    my array : 1,2,1,3,1,1,1,4
    extracted array : 2,3,4

    i wan to extract onli the values above 1 and put them in another new array.
    then from there i wan to display input textboxes according to number of number element
    of elements in the "newly extracted array"

    so in the EXAMPLE's case, it would provide 3 textboxes.
    .................................................





    u see i am trying to make an "equation" type of question for the user to input.
    something like this:

    EG.
    _! x _! x _!

    imagine "_" represents the textboxes (from part A) that i wan to appear...so how do i keep
    updating where the "x" or multiplication sign and also the "!" or factorial?



    so how do i do all this?....pls help mi if u can
    I'd really appreciate it..thanks
    PSls dun ask wat a factorial is...its got something to do with probability....i'm sick of it already..
    [Edited by darfiszie on 06-27-2001 at 01:23 PM]

  2. #2
    Senior Member
    Join Date
    Jun 2001
    Location
    Virginia, USA
    Posts
    437
    Here:

    oldArray = new Array (1,2,1,3,1,1,1,4 );
    newArray = new Array();
    trace (oldArray);
    trace (oldArray.length);

    var i=0;
    var j=0;

    while (i < oldArray.length)
    {
    if ( oldArray[i] > 1)
    {
    newArray[j] = oldArray[i];
    j++;
    }
    i++;
    }
    trace (newArray);

  3. #3
    Senior Member
    Join Date
    Jun 2001
    Location
    Virginia, USA
    Posts
    437
    for some reason, the last post took out [i] after oldArray in the if clause. Here's again

    oldArray = new Array (1,2,1,3,1,1,1,4 );
    newArray = new Array();
    trace (oldArray);
    trace (oldArray.length);

    var i=0;
    var j=0;

    while (i < oldArray.length)
    {
    if ( oldArray[i] > 1)
    {
    newArray[j] = oldArray;
    j++;
    }
    i++;
    }
    trace (newArray);

  4. #4
    Junior Member
    Join Date
    Jun 2001
    Posts
    20
    Thanks alot for the coding...
    but can anyone help me with the "symbolic" representation problem?
    cause wen i have this new array, i wan to display textboxes and the textboxes make up an "equation"
    like this:


    EG.
    New array found: 2,4,5

    there would 3 textboxes created....according to the number of elements in the "new array"
    then i wan to make something like this..

    EG.
    __! x __! x __!

    the "__" represents the textboxes created....u see if there are 3 textboxes the above would happen....if there are 5 textboxes(or five elemets in the "new array")...


    EG.
    New array: 2,3,4,5,6

    then this would appear...


    __! x __! x __! x__! x __!


    where "__" reoresents a textbox.


    can i make this appear?how?
    i'd really appreciate it..

  5. #5
    Senior Member
    Join Date
    Nov 2000
    Location
    Malibu
    Posts
    251
    In your textbox creation function set the # created to newArray.length

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