|
|
|||||
Topic, Sharing AS3 Classes | ||||||
| ||||||
You must register or log in to post a message.Instructions: If you don't have your own testing server, don't download the PHP file at all. I have an example server, which works. Next, upload the PHP file to your server and replace the line with: var mailAddress:URLRequest = new URLRequest(The link to your server); And delete the comment. Remember, this is optional. Arguments: Email(sender:String, recEmail:String, subject:String, body:String); sender = You recEmail = Reciever's E-mail Address subject = Self-explanatory body = Self-explanatory All in String data type. How is it useful? Well, instead of all that stupid code with URLVariables and URL Request you'll only have to type: import root_folder.Email; var msg:Email = new Email("Jonathan", "randomguy@gmail.com", "Hello!", "Hello World! This E-mail has been sent from Flash using my very own Email class, courtesy of Manufan!"); Now you've seen it, who wants it? Top that. Please, take a seat. What I need to use your class: import folder.Ellipse var ell:Ellipse = new Ellipse(0, 0, 50, 50, 0xFFFFFF); That's one less line than it would've been without your class, and way more intensive. [Edit: Allyally will object, this is supposedly beyond shite until I produce V.02] Please tell me if I have coded correctly though. :) Here [V.01] AS3 Arguments: Ellipse(x:uint, y:uint, w:uint, h:uint, color:uint); You'll know what to do. ;) Example if anyone needs it (;P): Ellipse(10, 10, 10, 10, 0xff0000); Next Update: It's called Ellipse. If you are interested, I will give you the link. All I want to know is whether it is right and you think you can use it properly. After that, then I will start to create more useful classes. Telling me it is a piece of shite doesn't help at all. BTW, I also edited it A HELL OF A LOT last night and this morning. Typing var num:int = 1+2; is way easier than importing your class, making an instance of it (unless your functions are static) and calling a function in it. Hell, even when you get everything you've talked about into it, the built-in Math class covers more than we'd ever need. Also, why the f*** do you trace the answer? Ever heard of the return command? Useful to have if you don't want to faff around trying to open up your computer's cheap calculator and enter the opposites, hypotenuses and adjacents and whatever to get a sine of something when all you really need is another window open in Flash. Here: Calculator.as Arguments: More Suggestions Welcome. :String - A simple text which can be A-Z, a-z or Symbols. :Number - Any Numeric value. :Boolean - Refers to the Boolean Algebra, output is True or False. :Array - A Group (well, sort of). I can enhance allyally's class to make it as2 but instead of :uint I would have to use :Number Don't worry, it will be 'enhanced by Manufan' original by Allyally Here it is. Is it right? New Function: public function customTF(x:Number, y:Number, font:String, size:Number, colour:Number, Obj:Object, property:String) Its will basically take a property of an object that you want a TF to display, then display that property & automatically update it when it changes. Arguments: public function customTF(x:uint ,y:uint, font:String, size:uint, colour:uint, Obj:Object, property:String) x & y = position, font = the text field font size = he texts size colour = the text colour, Obj = the Object that has the property that you want your Textfield to display property the property of the Obj that you want to textfield to display, For example: public function customTF(4 ,4, "Arial", 16, 0xffffff, mySprite, "x") but yeh, most people who use AS know colour codes :P | Flash game developmentFirst post of the topicIf you are still using AS2, I highly recommend downloading the free Flex SDK and FlashDevelop tools. There's a great tutorial on the FlashPunk site. AS3 SFXR is great tool for making video game sound effects. Use the interface to perfect your noise, then use the free SfxrSynth class to generate and play your sounds on the fly without importing any .wav files! Magic. Flixel and FlashPunk (thanks to JP for pointing them out) are both libraries which allow you to make sprite-based games easily by extending the base classes. Calista is a collection of cryptography classes. You will need a SVN client to download it though, or you could use the source browser to copy the files individually. Tweener will help you to move things around the stage smoothly using only code. Great when you're using Flex. |
make something that can parse a string such as "2(4+5/(3*4))^(1/7)"