A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Array Struggles

Hybrid View

  1. #1
    Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    1,068

    Array Struggles

    Hi guys, I am having some issues hopefully someone here can guide me a bit..

    I have an array that outputs 1,2,1,3,1,2,3,2,4

    how can I make it so that it auto edits each number to be a letter, like every 1 turns into an A, every 2 in the array turns into a B, etc..

  2. #2
    Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    1,068
    Never mind I got what I needed done, was just a bit confused, if anyone wants the code and hopefully it'll help them some how here it is:
    PHP Code:
    var bfd:String
    dby 
    "a";
    bfd dby;
    var 
    rr:Array = new Array(bfdbfdbfd);
    trace(rr); 

  3. #3
    Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    1,068
    or better yet, more like:
    PHP Code:
    var bfd:String
    dby 
    "a";
    bfd dby;
    var 
    rr:Array = new Array();
    var 
    bf:Number rr.push(bfdbfd);
    trace(rr); 

  4. #4
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    Hi,

    Maybe something like

    PHP Code:
    var letters:Array = new Array("dummy""a""b""c""d""e""f""g""h""i""j""k""l""m""n""o""p""q""r""s""t""u""v""w""x""y""z");
    var 
    numberArray:Array = new Array(121343219);

    var 
    newLetters:Array = new Array();

    for (var 
    i:Number 0numberArray.lengthi++)
    {
        
    newLetters.push(convert(numberArray[i]));
        
    //trace(convert(numberArray[i]));
    }

    trace(newLetters);

    function 
    convert(number:Number):String
    {
        return 
    letters[number];


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