Ask Experts Questions for FREE Help !
Ask
    tarun khurana's Avatar
    tarun khurana Posts: 1, Reputation: 1
    New Member
     
    #1

    Nov 3, 2008, 12:04 PM
    action scripting
    hello sir! I want to ask that question about random numbers.I know how to generate random nos but I don't know how to save that number example:
    like that I show u below:
    :confused:// command: trace(Math.floor(Math.random()*10));
    some no. appears on the screen like 4
    I want to save that no above so that I can use it further,again I traced the command
    some no appears like 6 I want that the previous no and the current no adds,subtract etc.
    like 4+6=10;
    how to do so?
    what scripting I use there?
    help me!
    I'm very thankful to u if I get the answer:)
    cheeseycheese's Avatar
    cheeseycheese Posts: 11, Reputation: 2
    New Member
     
    #2

    Dec 15, 2008, 08:29 AM
    Quote Originally Posted by tarun khurana View Post
    hello sir! i want to ask that question about random numbers.i know how to generate random nos but i dont know how to save that number example:
    like that i show u below:
    :confused:// command: trace(Math.floor(Math.random()*10));
    some no. appears on the screen like 4
    i want to save that no above so that i can use it further,again i traced the command
    some no appears like 6 i want that the previous no and the current no adds,subtract etc.
    like 4+6=10;
    how to do so?
    what scripting i use there?
    help me!
    i m very thankful to u if i get the answer:)
    your kidding rite? I mean yes that's how you make a random number, but usually people learn the basics of programming before looking into functions in specific languages.

    Anyway, you would simply store it in a variable
    e.g..

    var1 = Math.floor(Math.random()*10);
    trace(var1)l
    //then to do a calculation of it

    trace(var1+5);

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Best course of action [ 3 Answers ]

I have been saving for a house (my first) and the market is great now to buy one. I remember a couple of years ago a lender advised me that I should have 3 lines of credit. He noted this when he saw I only had 2 credit cards. I need to buy a car. Mine was wrecked. So am I wondering if I should...

Can I take Action? [ 6 Answers ]

I did some engine work for a company that went belly up resulting in two bounced checks totaling 1,300.00. I know the owner of the boat that had the work done to it. Can I sue the boat owner for money?

How to useShell scripting ? [ 1 Answers ]

Hai every buddy, I would like to know about scripting... I am trying to figure it out for a long time... Call any buddy help me Thanking you Bibu Bharathan

What action to take [ 2 Answers ]

I have a roommate who I have asked to leave on Dec 1, 2007. He is finally getting on his feet and take care of himself now. He moved in... Dec 7, 2006 and had just got out of prison... felony... "white collar crime" of bribery is all I could find out. He did nothing for the first 3 months. Then...

Can any action be taken [ 1 Answers ]

I just recently got a phone call at work about a judgment that I had against me in 98 over breaking a lease by leaving before my 60 day notice was up so they garnished my wages and got there money but now they are telling me that ten years later they didn't get all there money and if I want to pay...


View more questions Search