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.

allyally 12 years ago
  That is honestly the lamest & most useless class i have ever seen. My path class collection rapes that pathetic excuse for a .as file.
manufan 12 years ago
  MEGA BUMP!

Since Hexicube was allowed to put up an AS2 class I should be able to shouldn't I?

Anyway it is a class that will make Colouring in Flash Easier. i.e. the beginFill and other methods that use Colour ID's. I don't know whether it works tho. :P

EasyColour.as

This is Version 0.5 and 0.75 Coming Out Soon!
Hexicube 13 years ago
  undefined also means lack of value, hence why its returned for functions without a return statement or for variables that dont exist
I also have some levels on P4M I need you to evaluate(I dont like evaluating my own levels)
[edit] my expander shows everything, if you create a multi-depth object for example it will show every single value
try it out
[re-edit] I did comment out 2 lines inside analyze(obj,depth,name) and forgot to uncomment, they show the value
geckojsc 13 years ago
  Void represents the absence of a value: one of its reasons for existence is to show that a function doesn't return anything. I don't see how it could cause you problems unless you tried to get the return value of a function that doesn't return anything.
Anyways, what can possibly go wrong in the start function? The only mistake would be if you didn't give it a working reference to the stage object, and Flash would give you a runtime error involving the stage anyway if that happened, making it pretty clear what the problem was.

[edit]
Your expander class is very nice. It seems like a better, more descriptive version of the object toString method.
Hexicube 13 years ago
  not really, its simpler and faster if the code returns false, or even a nuber to help show what part went wrong
void just doesnt make sense there is already undefined and null, also void causes problems in AS2(yes this is AS3 but JP used void in his AS2 BLLevels.as file and it annoyed me)
also feedback on expander.as
geckojsc 13 years ago
  Functions should always have a return type for performance/clarity, and it would be better practise to throw an exception instead of return false, if there was an error in the start function.
Hexicube 13 years ago
  I do have an expander class I made a while ago for debugging purposes...
it basically returns a formatted list of every variable inside the object you put into beginAnalysis(obj,name)
obj being the object(array,MC,or object)
name being whatever you want, its not used for much
Hexicube 13 years ago
  gecko dont use void at all use undefined or just dont have anything what-so-ever
also start should return a Boolean showing if it initialized properly
SuperDog 13 years ago
  Oops! This page doesn't exist anymore!

[edit]It's fixed now, weird
geckojsc 13 years ago
  In what way?
SuperDog 13 years ago
  It says it is an error
geckojsc 13 years ago
  Whilst I was teaching SimonM, I made a static class to make AS3 keyboard input easier.
com.geckojsc.Keys

Usage:

Keys.start(s:Stage):void must be called for the class to work. 's' must be a reference to the Flash stage object.

Keys.pressed(keyCode:uint):Boolean returns true if the key has just been pressed.

Keys.held(keyCode:uint):Boolean returns true if the key is held down.

Keys.released(keyCode:uint):Boolean returns true if the key has just been released.

The class is intended to be used in conjunction with ENTER_FRAME events - if you call it at the end of a frame, the 'pressed' and 'released' methods will not work.
You can use the flash.ui.Keyboard class for a few keyCode constants, and for the rest you can use this keyCode reference/tool.

Any suggestions for how I could improve the class?
OliAli 13 years ago
  Duh, guys, I'm gonna have flash, too xP
Hexicube 13 years ago
  tbh I allow maximum usability, for those capable, and it's only for those who repetitevely use awards in their games...
geckojsc 13 years ago
  Yep, or you could take that a step further and, if the coder enables it, you could cache the awards array every time it is updated so that the coder doesn't have to worry about calling extra functions.
One tip I learned from watching John Resig is that you should always try to avoid adding unnecessary functions (especially public ones) to your libraries, because it means there is more for you to maintain and more for the users to learn.
Hexicube 13 years ago
  well I never really considered that :P
just create a function that returns the 'award' array, and another to store one...easy enough, right?
geckojsc 13 years ago
  I had a look at the documentation, and it looks like a nice easy-to-use system. I think the next step would be to enable local storage of the awards. It would be annoying to play a game where all achievements are reset upon revisiting the page.
Hexicube 13 years ago
  any feedback at all?
jp 13 years ago
  AS2/AS3 classes to easily implement score submission to major game portals.
cunitescore
geckojsc 13 years ago
  They're both almost the same to set up. If you're having problems contact me with the details via pm or via Google Wave (geckojsc).
Hexicube 13 years ago
  lol...this is one reason I hate using anything extending base classes...even though it's the first one i've seen XP
Ahroo 13 years ago
  Gecko, can you tell if Flixel is easier to install than FlashPunk? FP doesn't work no matter how well I read the instructions... :/
Hexicube 13 years ago
  oh right lol :_
you checked my award manager?
[edit] if you have I would like feedback plz :D
geckojsc 13 years ago
  Actually, it was the BL debug console that crashed my game - I was logging too heavily.

I just found TweenLite, a faster alternative to Tweener.
Hexicube 13 years ago
  AwardManager.as
fully documented award manager system, not very advanced but cuts out some work if you plan on using it in multiple games...
[edit] also has a feature to make awards 'hidden' when creating them
hidden awards will return "Hidden Award" for the title, "?" for the worth, not be counted towards total award points, and show a 'hidden award' string for description...however once completed it acts like a normal award
[re-edit] 2 errors I made:
I said 'all 18 functions...' when there are 17
I said '(bad worth input in function 2)' when it should be function 1
Hexicube 13 years ago
  didn't that screw up levels on your game? :P
geckojsc 13 years ago
  Sure you can! This thread is mainly for AS3, but I don't mind exceptions.

A cryptography class is, um, a class that encrypts and decrypts strings. The collection has LZW, Base64, and many others.
Hexicube 13 years ago
  uh...I made a very simple award manager class for AS2...could I put that here?
also what is a cryptography class?
geckojsc 13 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.

[<<] [1] [2] [3]

Flash game development

First post of the topic

geckojsc 13 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