A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: change (-) position

  1. #1
    Senior Member
    Join Date
    May 2016
    Posts
    451

    change (-) position

    hello evryone
    4-6=-2
    what ac3 code to make it 4-6=2-
    it mean how can i change (-) to right
    thanks so mutch

  2. #2
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    var equaled;
    function subtract(a,b){
    equaled = a-b;
    if(equaled.toString().charAt(0)=="-"){
    equaled=equaled.toString().split("-")[1]+"-"
    }
    return equaled
    }

    trace(subtract(4,6));

  3. #3
    Senior Member
    Join Date
    May 2016
    Posts
    451

  4. #4
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    haha, nice

  5. #5
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi

    Or another way for you to study Alloy, and Kofa.

    PHP Code:
    var c;

    function 
    moveMinus)
    {
        
    b;
        if ( 
    )
        {
            
    c.toString().substr(1) + "-";
        }
        return 
    c;
    }

    tracemoveMinus) ); 

  6. #6
    Senior Member
    Join Date
    May 2016
    Posts
    451

  7. #7
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    yeah use fruitbeards, his if statement uses less processing power.

  8. #8
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Jealousy, sarcasm, I'm not sure?

    Just another way instead of your long winded string things.

    I know now, it's another excuse to reach 1000, use any you like Kofa, it was not intended to be a competition.

  9. #9
    Senior Member
    Join Date
    May 2016
    Posts
    451
    I'm a student who likes to learn from his professors and each professor has his own way of delivering information to his student
    Finally all thanks and appreciation to all

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