Play the games, create the levels

Topic, Sharing AS3 Classes

Checkout our iPhone & iPad games!

You must register or log in to post a message.

SimonM 8 months ago
  Come to chat. Average is very simple. Nobody uses the most of the others.
manufan 8 months ago
  MathUtils contains:

MathUtils() [Throws an Error]

average(a:Array) [Returns the average of the numbers in an array]

formatAsCurrency(c:String, n:Number, english:Boolean, decimal:Boolean) [See FlxU.formatMoney() - c = the symbol]

formatAsDate(d:Date) [Returns a String along the lines of "Monday 3rd September 2012"]

formatAsTime(d:Date, seconds:Boolean, showGMT:Boolean) [Returns a string along the lines of "14:31:00 (GMT +1)"]

roundToNearest(n:Number, r:Number) [Returns an integer.]

Other functions MathUtils has are used by other functions, such as formatAsDate() uses getWeekday().
SimonM 8 months ago
  MathUtils, what kind of math functions will it contain?
manufan 8 months ago
  At the moment, there is a MathUtils class. It uses some of the old BL MathUtils and some new ones to do with dates - and even uses one function from Flixel. All functions in that class are public static also.

If you want to work on it with me, I'll create a shared folder for it on DropBox.
SimonM 8 months ago
  What kind of utilities? Maybe I could help you with it.
manufan 8 months ago
  Simon, I wasn't actually making a library just for the data. XD

I was making a library to help with games as a whole - utilities that could take forever to script in a game - especially when you want to keep the file size down.

For Beginners: Object Oriented Programming in AS3
SimonM 8 months ago
  I hope, you know understand why making a library for this is not very useful, because it can be done in a few lines.
manufan 8 months ago
  Very Good Simon - nice & detailed, (of course I know it), gives users a very good 'grip' on what they are learning. Your comments were very clear also.
SimonM 8 months ago
  Made a small very compact explanation of level data things in BL with AS3: level data
SimonM 8 months ago
  A library for that is not really needed, because it's just a few lines of code in AS3.
manufan 8 months ago
  I'm making an ActionScript 3.0 Library, but I'm not sure what to call it. The name will be the prefix of all the classes, a bit like Flixel - FlxG, FlxText, etc.

At the moment, I'm sticking with Game as the prefix. The idea of the library is to help with making Games that involve level data serialization (e.g. BL Games).
manufan 10 months ago
  Bump!

I'm not sure whether it's very good, I'd just like feedback infact, but I decided to code an Animation Engine in AS3. It's not that user friendly, but I just want to know:

a) Whether my code is right.
b) Is it actually useful.

It was targeted at the FlashDevelop Community, even though this was made in Flash CS6, due to the fact that everything has to be coded, and so there's no drawing MovieClips or IK.

Parameters & Functions

PRIVATE: EMPTY_OBJECT (An Empty MovieClip)
PRIVATE: MOVIE_LIST (An Array storing all MovieClips)
PRIVATE: TOTAL_FRAMES (Total Frames of the MovieClip)

CONSTRUCTOR: Animation(empty_object:MovieClip, movie_list:Array, total_frames:int)

The class also includes 7 other functions (one private, containing a 'for' loop) and the others for timeline control, such as gotoAndStop();

Download
Animation.as

Next Updates
- No need to supply an Empty MovieClip
- More Suggestions Welcome
Hexicube 1 year ago
  "@Birjo: No, but it is Great as a remote E-mail if your Internet Access is down..."
if your internet is down it wont work...
manufan 1 year ago
  Bump! Just finished a "Mouse" class in AS3 which does what Gecko's "Keys" class does but with the Mouse. However, I need to rename it because there is already a Mouse class with the root flash.ui.Mouse (thanks to allyally for pointing it out). Any ideas?

It's a static class, so goofy names won't work. :S

@Gecko: Also, you said throwing exceptions was good practice. How come you didn't throw an exception for your constructor function in your "Keys" class?
SimonM 1 year ago
  Manufan, you can use Array.sortOn(Array.DESCENDING | Array.NUMERIC) and Array.sortOn(Array.NUMERIC) for ascending numbers in AS3.
manufan 1 year ago
  Not really a class, just a discovery, but I figured out that not only does Array.sort(); sort Strings alphabetically, but also sorts Numbers Numerically, and possibly (not tried it out yet) sorts Dates chronologically!

Edit: You'll need Array.reverse(); if you want to sort them Chronologically, it does it backwards!
manufan 1 year ago
  I've ran out of ideas for my editor class! Can anyone help?
manufan 1 year ago
  Jasper, this is not an AS3 thread, it is about producing classes for AS3 or AS2 (Gecko doesn't mind exceptions).
jasperpostema 1 year ago
  Why using sites or books when you have reallife persons :P
BTW I love making games.
manufan 1 year ago
  Bump!

I'm thinking about making a very useful class, a basic editor class that I will use, that extends from MyEditorManager. You can enhance the code in any way you like, to your specifications, and before you aks "WHERE DA F*** IS THE LINK?" there isn't one, becuase it hasn't been made yet. :)
manufan 1 year ago
  @Birjo: No, but it is Great as a remote E-mail if your Internet Access is down...

I used the mail function in PHP, that's how it actually e-mails people.
birjolaxew 1 year ago
  "That many people will find useful" Wait a minute... How is it useful? Seriously...

It's no good adding it to a website. Both HTML, PHP and Javascript have easy e-mail functions available.
There's no reason to add it to a standalone .swf because... Well, why would you?
manufan 1 year ago
  Here we are, my Email class file. For the PHP File, please PM me.

Email [V.0.1] AS3 by Manufan.
manufan 1 year ago
  I'm not teaching anyone GIS, just asking whether they want this Class.

@Birjo: Epic! I will post my code soon
birjolaxew 1 year ago
  Just dropping this off here. Decided to code a bloom filter.

And some example code. For an actual example of it in action, see this.
gameinsky 1 year ago
  Manufan, if you are so eager on "teaching" us, why not make your own topic...
Hexicube 1 year ago
  "Bumpity Bump, here is a correct Calculator class in AS2."
make something that can parse a string such as "2(4+5/(3*4))^(1/7)"
manufan 1 year ago
  Bumpity Bump, I have an E-mail class, in AS3, which can E-mail anyone, just about anywhere in the world. In addition to the main class, there is a PHP file, which handles some of the data.

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?
allyally 1 year ago
  also. as for your calculator class. I have a collection of claass which ill upload soon that can do this, (type ? for help).

Top that.
birjolaxew 1 year ago
  ಠ_ಠ


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.

[1] [2] [3]

Flash game development

First post of the topic

geckojsc 2 years ago
  Here's a topic for developers to find, create and share AS3 classes/libraries.
If 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.
Our free flash games   Games for your site   Games for your iPhone   Contact   Twitter @jpsarda & @bonuslevelorg