[B][U]Torrunt's AS3 Developer Console[/U][/B] - [url]http://code.google.com/p/as3developerconsole/[/url]
An easy to install and use AS3 class that let's you access every public variable and function in your project while it's running through a console.
[URL="http://code.google.com/p/as3developerconsole/downloads/list"]DOWNLOAD developerconsole.as[/URL]
[B][U]Features:[/U][/B]
[LIST]
[*]Auto-complete/ Suggestions (use up/down keys to go through them)
[*]Used commands History (use up/down to go through them when the auto-complete box is NOT showing)
[*]Calculations when assigning or in parameters (+,-,/,*,%)
[*]Shorthand calculations (+=,-=,/=,etc)
[*]echo and error function with multiple colours! :D
[*]Ability to do multiple commands at once (e.g: function(); something += 2; function2();)
[*]Multiplying Commands! Put an x plus a number after a command to repeat it that many times (e.g: spawnEnemy();x5)
[/LIST]
Type '[B]help[/B]' in console to get some help.
[U][B][URL="http://code.google.com/p/as3developerconsole/wiki/UpdateNotes"]Update Notes[/URL][/B][/U]
[URL="http://code.google.com/p/as3developerconsole/wiki/Installinstructions"][U][B]Install Instructions[/B][/U][/URL]
(if you really need it)
[LIST]
[*]Save developerconsole.as to the same folder as your project (if you put it some where else: change the package name accordingly)
[*]Import the class at the top of your main class or on your first frame
[*]Make an object called 'console' or whatever you want.
[*]Make it equal a new developerconsole and pass in your main class or the stage if you don't use have one (e.g: console = new developerconsole(this);) and add it (addChild(console);).
[*]Then just call console.open() to bring it up and console.close() to close it. (use console.opened to see if it's open all not).
[/LIST]
[U][B]Screenshots[/B][/U]
[IMG_THUMB]http://filesmelt.com/dl/011.jpg[/IMG_THUMB][IMG_THUMB]http://filesmelt.com/dl/031.jpg[/IMG_THUMB][IMG_THUMB]http://filesmelt.com/dl/0512.jpg[/IMG_THUMB][IMG_THUMB]http://localhostr.com/files/a4a6a8/as3devconsole_multiplycmds.jpg[/IMG_THUMB]
[IMG]http://filesmelt.com/dl/shorthand.jpg[/IMG]
[IMG]http://filesmelt.com/dl/arrayliteral.jpg[/IMG]
I started working on this earlier this week and I've learnt a lot of new stuff while doing it (especially string related stuff).
What do you guys think?
Hmm, I could perhaps find this useful. Maybe not. The lack of a character cursor is pretty annoying and I'm finding it difficult to get the text box to work all that well. A feature I'd be interested in is the ability to create a variable in the console. I'll probably look through the class a bit later. Why do you need a parameter to initialize it?
[editline]01:20AM[/editline]
Ah I see, you need it because you are assuming the user is going to want to attach it to the stage. I'd like to see it be a bit more open there, as in be able to make it it's own window or maybe attach it to another sprite.
I'd make all of the functions that aren't public to be private. More documentation in the class would be good. Another suggestion is that if you have a certain color for your error messages to store that color in a variable. If you call a function it should echo it's return value. So for example if you have a function that checks if something is done you should be able to type it in the console and have it print it's return value.
Also the text randomly changes on me. Anyway, I think it could use a lot more work.
[QUOTE=Pepin;24632488]The lack of a character cursor is pretty annoying[/QUOTE]
I'll see what i can do.
[QUOTE=Pepin;24632488]and I'm finding it difficult to get the text box to work all that well. [/QUOTE]
How so? Do you have 'Disable Keyboard Shortcuts' ticked? having them enabled can cause problems with inputting text.
[QUOTE=Pepin;24632488]A feature I'd be interested in is the ability to create a variable in the console.[/QUOTE]
I'll look into it.
[QUOTE=Pepin;24632488]Ah I see, you need it because you are assuming the user is going to want to attach it to the stage. I'd like to see it be a bit more open there, as in be able to make it it's own window or maybe attach it to another sprite.[/QUOTE]
I'm not sure what you're own about there; you can attach it to anything. The parameter you pass in when you make it is like the starting point for it to see all the variables and functions in the project (which is normally your main class and if: not the stage).
[QUOTE=Pepin;24632488]I'd make all of the functions that aren't public to be private.[/QUOTE]
What?
[QUOTE=Pepin;24632488]More documentation in the class would be good.[/QUOTE]
Maybe, you don't even have to go into the class and read it to be able to use the console anyway but it might be nice for the people that want to know how i did it.
[QUOTE=Pepin;24632488]Another suggestion is that if you have a certain color for your error messages to store that color in a variable.[/QUOTE]
A lot of console that I've seen use a separate command for errors instead of 'echo' called 'error'. I'll probably do that instead and maybe have a 'warn' one as well.
[QUOTE=Pepin;24632488]If you call a function it should echo it's return value. So for example if you have a function that checks if something is done you should be able to type it in the console and have it print it's return value.[/QUOTE]
I was going to make the console do that but then i found a bug, got rid of what i did and forgot about it; i'll work on it.
[QUOTE=Pepin;24632488]Also the text randomly changes on me. Anyway, I think it could use a lot more work.[/QUOTE]
What do you mean?
Just updated my Developer console thanks to Pepin's Feedback:
[B][U]v1.01 - (6/09/2010)[/U][/B]
- Added slightly more Documentation
- Added error command (echos a message in red)
- Calling functions echos their return value (change 'returnFunctions' to turn it on or off)
- Fixed up some code (Feel kind of stupid when i saw what i did in the stringToFunc Function)
[URL="http://as3developerconsole.googlecode.com/files/developerconsole_v1.01.as"]Download v1.01[/URL]
I found out that the cursor doesn't show up in the textbox when you're testing the swf through the Flash IDE, to get it to show you have to click inside the swf once. Weird, i didn't some searching and I haven't found any good solutions.
I also looked into making new variables through the console, doesn't seem like there are any decent ways to do it in AS3.
[QUOTE=Torrunt;24634023]I'm not sure what you're own about there; you can attach it to anything. The parameter you pass in when you make it is like the starting point for it to see all the variables and functions in the project (which is normally your main class and if: not the stage).
What?
Maybe, you don't even have to go into the class and read it to be able to use the console anyway but it might be nice for the people that want to know how i did it.
A lot of console that I've seen use a separate command for errors instead of 'echo' called 'error'. I'll probably do that instead and maybe have a 'warn' one as well.
I was going to make the console do that but then i found a bug, got rid of what i did and forgot about it; i'll work on it.
What do you mean?[/QUOTE]
Yeah it makes more sense that you'd need the stage to access all the variables. It is a console so it will probably be set up to the stage values. I think my thoughts on it are going past what it needs to do.
You have a lot of functions that aren't declared public or private, I'd just declare them to be private just so they can't be called externally. It is more just a good practice than anything.
And the text font size has randomly changed on me a few times, don't know why.
Awesome bro. I could use this in my flashes sometime.
I'm pretty sure you should be able to make objects through some AS. I'll research it a little bit because I'd be pretty interesting in that because then it would be possible to have an online AS editor/parser, as in you could write your own AS through the console and have it do something, lets say make a square and add it to the stage. I can imagine this has been done before but I haven't seen it.
[QUOTE=Pepin;24646803]
You have a lot of functions that aren't declared public or private, I'd just declare them to be private just so they can't be called externally. It is more just a good practice than anything.[/QUOTE]
Oh, you mean in the class. I'll fix that up the next time i add something. Most of the ones that aren't set to public or private; i would probably set to public anyway so you can access them from the console if you want (not declaring if they're public or private just sets them to public).
[QUOTE=Pepin;24646803]And the text font size has randomly changed on me a few times, don't know why.[/QUOTE]
That's really weird, never had that problem. :S
[QUOTE=Pepin;24646962]I'm pretty sure you should be able to make objects through some AS. I'll research it a little bit because I'd be pretty interesting in that because then it would be possible to have an online AS editor/parser, as in you could write your own AS through the console and have it do something, lets say make a square and add it to the stage. I can imagine this has been done before but I haven't seen it.[/QUOTE]
You could just make a function that makes a square and call that from the console. If you wanted to do that 100% from the console; that seems a bit crazy as you'll have to write each bit of code to draw it (e.g: beginFill();,lineTo();,lineTO(); and so on).
Well the whole point of having classes is to internalize everything the user does not need. It also makes it pretty nice because if you are to look at the available methods in a class through a decent IDE you'll get a nice short list of methods instead of a long list of stuff that you won't know will be helpful to use or not.
I don't think my idea is too crazy. Maybe it can be something I'll work on. I can imagine it would be great for tutorials.
New update:
[B][U]v1.02 - (09/09/2010)[/U][/B]
[LIST]
[*]Fixed the 'returnFunctions' Boolean so it actually does something (whoops)
[*][B]Suggestions now continue to help you when writing parameters or parts of equations[/B]
[*]Made it so if you press the up key when going through the history or suggestions it moves the cursor back to the end of the text field.
[*]Cleaned up a bit (fixed some of the formatting, etc)
[/LIST]
[URL="http://as3developerconsole.googlecode.com/files/developerconsole_v1.02.as"]Download v1.02[/URL]
[img]http://filesmelt.com/dl/suggestions1.JPG[/img][img]http://filesmelt.com/dl/suggestions2.JPG[/img]
This makes me very happy, i love this so much- i don't even know what to say!
(this is not a pointless post, i just want to say how freaking AWESOME this is.)
Long time no update! It was annoying me how suggestions stopped helping after a ';' so i fixed that and decided to go a little further.
[B][U]v1.04 - (10/11/2010)[/U][/B]
[LIST]
[*]Added the ability to perform calculations without having to assign them to a value (eg: char.health / 2 echos 'char.health/2 is 50' or 2 + 2 echos '2+2 is 4')
[*]Suggestions now continue to help you after semicolons(;) and other places it should have
[*]You can now assign arrays with variables (eg: ary = [char.health,char.gun]) (use to turn them into strings)
[*]You can now access array items (eg: ary[1] = "blah" or func(ary[4]) etc)
[*]Moved things around and added slightly more documentation
[/LIST]
[URL="http://as3developerconsole.googlecode.com/files/developerconsole_v1.04.as"]Download v1.04[/URL]
Sorry, you need to Log In to post a reply to this thread.