Try :
public class MathUtil {
- James
On Jan 9, 2008, at 10:00 PM, Dwayne Neckles wrote:
thanks so much for help me out
but its not working still here is the updated code..
** inside fla ************
import com.bigspaceship.util.math.MathUtil;
var num:Number = MathUtil.getRandom(4,100);
trace(num)
***** Class file below
package com.bigspaceship.util.math{
class MathUtil {
static var min_num:Number;
static var max_num:Number;
static var num1:Number;
static var num2:Number;
public static function getRandom(min_num, max_num) {
//return min_num + Math.floor(Math.random() * (max_num
+ 1 - min_num));
}
public static function getRandomFloat(min_num, max_num) {
//return (min_num + Math.random() * (max_num - min_num));
}
public static function getCenterPoint(num1,num2) {
//return (num1 - num2 )/ 2;
}
}
}
Date: Wed, 9 Jan 2008 18:35:18 -0800
From: [EMAIL PROTECTED]
To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] Error 1120?
You're attempting to access instance vars in a static method. Make
min_num and max_num static.
Also, you don't need to put a constructor in a static class.
Also, you should follow common practice and put public before static
when declaring functions and variables.
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_________________________________________________________________
Watch “Cause Effect,” a show about real people making a real
difference.
http://im.live.com/Messenger/IM/MTV/?
source=text_watchcause_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
James Booth
[EMAIL PROTECTED]
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders