Re: [Flashcoders] Error 1120?
It took me four times getting burned by not declaring a class as public before I started doing it. The error isn't exactly clear, either, which makes it even tougher. I don't think you need to go back to the drawing board, but you might need to get zapped by it a couple of times until it sticks. :) Steven Sacks Flash Maestro Los Angeles, CA -- blog: http://www.stevensacks.net gaia: http://www.gaiaflashframework.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
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
RE: [Flashcoders] Error 1120?
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
Re: [Flashcoders] Error 1120?
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
RE: [Flashcoders] Error 1120?
It worked.. Guys you have no idea how much I appreciate your assistance! Does that mean that brushing up on the basics of as3 should be in order? geez.. add public IS important! Thanks Everyone!! From: [EMAIL PROTECTED] Subject: Re: [Flashcoders] Error 1120? Date: Wed, 9 Jan 2008 23:21:55 -0500 To: flashcoders@chattyfig.figleaf.com 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 _ Put your friends on the big screen with Windows Vista® + Windows Live™. http://www.microsoft.com/windows/shop/specialoffers.mspx?ocid=TXT_TAGLM_CPC_MediaCtr_bigscreen_012008___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders