00:00
00:00
Newgrounds Background Image Theme

apollonx just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

The Flash 'Reg' Lounge

3,046,675 Views | 60,186 Replies
New Topic Respond to this Topic

Response to The Flash 'Reg' Lounge 2013-04-17 11:27:17


At 4/17/13 10:58 AM, egg82 wrote: There's got to be a reason for it, so why in the world should you limit yourself to five class members at once?

Beside that a 5 members maximum seems like a arbitrary number, having small classes is viewed as a good thing. To quote the book Clean Code (which is by the way a interesting read for anyone who wants to write better code) : "The fewer methods a class has, the better. The fewer variables a function knows about, the better. The fewer instance variables a class has, the better.".

It describes what ideal code should look like. To name a few guidelines:
Maximum 400 lines per class (200 lines is ideal)
No more than 3 arguments on a method (the fewer the better)
"The first rule of functions is that they should be small. The second rule of functions is that
they should be smaller than that." (I think it comes down to about 5 lines)

The book covers on almost everything related to writing code, from variable names to class organization.
At first I thought these strict constraints would bog everything down, but I'm starting to see why they came up with these rules.

Response to The Flash 'Reg' Lounge 2013-04-17 11:51:06


At 4/17/13 11:27 AM, Sandremss128 wrote: The book covers on almost everything related to writing code, from variable names to class organization.
At first I thought these strict constraints would bog everything down, but I'm starting to see why they came up with these rules.

well, that's interesting, but why are these rules here? To me, it seems like i'd need to create more classes just to cover what I couldn't in previous classes, and that seems like it'd get really messy (having three or four classes covering what should be in one class? Seems AS1-like to me)


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2013-04-17 12:12:57


At 4/17/13 11:51 AM, egg82 wrote:
well, that's interesting, but why are these rules here? To me, it seems like i'd need to create more classes just to cover what I couldn't in previous classes, and that seems like it'd get really messy (having three or four classes covering what should be in one class? Seems AS1-like to me)

My thought exactly at first. Why break up a perfectly working 1000 lines class into 3-4 other ones? The book does come up with some statistics on big libraries that are written and use that to state the classes should be small to ensure a successful project; but the biggest argument it has is that it works best in the experience of the author:

"IâEUTMve written several nasty 3,000-line abominations. IâEUTMve written scads of functions in the 100 to 300 line range. And IâEUTMve written functions that were 20 to 30 lines long. What this experience has taught me, through long trial and error, is that functions should be very small."

Classes should have one responsibility, and do that and only that. If you're taking a high number of lines to accomplish that, then you're doing something wrong or you're implementing more than just one responsibility. And eventually you end up with a 'God class', in the worst case. I think for both debugging and management it's important that you work with smaller classes.

In the end we can all agree that elegance is important with code, to me a 200 line class would almost always be more elegant than a 1000 line one. I think it's the same as way back when I thought every variable could just as well be public, it takes some more time and understanding to really comprehend it.

Response to The Flash 'Reg' Lounge 2013-04-17 12:33:09


I got destroyed...though a lot of the warnings were for my embeds, and some of my classes would be a lot smaller without them. That 2-400 line limit would be my biggest challenge by far, though I kinda want to see the line count without all the spacing I add in. I can see where a lot of that junk could be put into another class, though.

Response to The Flash 'Reg' Lounge 2013-04-21 00:39:38


Hey guys!! Just spent this weekend creating slideshow creator check it out!!

I used this library called as3swf It worked pretty well at changing byteArray of a swf.

This tool will allow you to create slideshow with just selecting the images you want in your slideshow and save the .swf locally on your computer. It is best to use images of similar size. It makes the .swf the same size of the smallest image, then centers the bigger images into the viewing space.


BBS Signature

Response to The Flash 'Reg' Lounge 2013-04-21 00:42:20


At 4/21/13 12:39 AM, swishcheese wrote: Hey guys!! Just spent this weekend creating slideshow creator check it out!!

I used this library called as3swf It worked pretty well at changing byteArray of a swf.

This tool will allow you to create slideshow with just selecting the images you want in your slideshow and save the .swf locally on your computer. It is best to use images of similar size. It makes the .swf the same size of the smallest image, then centers the bigger images into the viewing space.

lol. spoke to soon! I was too excited. I guess saving files through FileReference on newgrounds is security rescricted?


BBS Signature

Response to The Flash 'Reg' Lounge 2013-04-21 00:53:47


Sorry for triple post. (I feel stupid, wish there was edit)

I fixed my error. flash has security where user must interact by click in order to save using fileReference.

Here is update link

I delete other dump. That link wont work. Goodnight. I am tired.


BBS Signature

Response to The Flash 'Reg' Lounge 2013-04-22 05:17:55


I downloaded the MochiMedia API today. Easily some of the worst code I've ever seen, it's almost like they want it to be impossible to read so I can't exploit it. Anyone use Mochi recently?

Response to The Flash 'Reg' Lounge 2013-04-22 09:40:28


Trying to make proper HTML5 stuff. Grrr, CSS and <div> sure are frustrating. So tempting to go back to tables without margins...

Response to The Flash 'Reg' Lounge 2013-04-22 10:16:34


At 4/22/13 09:40 AM, FlyingColours wrote: Trying to make proper HTML5 stuff. Grrr, CSS and <div> sure are frustrating. So tempting to go back to tables without margins...

please dont ever say tables again.


None

BBS Signature

Response to The Flash 'Reg' Lounge 2013-04-22 10:59:25


At 4/22/13 09:40 AM, FlyingColours wrote: Trying to make proper HTML5 stuff. Grrr, CSS and <div> sure are frustrating. So tempting to go back to tables without margins...

apparently, you're not supposed to ever need to use div tags with HTML5 again. Don't ask me how that's supposed to work, I haven't touched it yet.


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2013-04-22 11:00:04


At 4/22/13 10:16 AM, Luis wrote:
At 4/22/13 09:40 AM, FlyingColours wrote: Trying to make proper HTML5 stuff. Grrr, CSS and <div> sure are frustrating. So tempting to go back to tables without margins...
please dont ever say tables again.

this.
the day tables make a come back, is the day i say goodbye to this world.

Response to The Flash 'Reg' Lounge 2013-04-22 11:43:02


At 4/22/13 10:59 AM, egg82 wrote: apparently, you're not supposed to ever need to use div tags with HTML5 again. Don't ask me how that's supposed to work, I haven't touched it yet.

From what I understand, those new tags are purely semantic and won't really change how the page looks like, kinda like strong instead of b for bold. For generic stuff, divs are still usable.

I've had a bit of fun playing with inline SVG though. :P

BTW, is there an SVG NG logo I could embed in?

Response to The Flash 'Reg' Lounge 2013-04-22 16:50:34


Speaking of HTML5

http://artpolikarpov.github.io/garmoshka/

hint, resize your browser

Response to The Flash 'Reg' Lounge 2013-04-22 18:45:33


At 4/22/13 04:50 PM, 4urentertainment wrote: Speaking of HTML5

http://artpolikarpov.github.io/garmoshka/

hint, resize your browser

Thanks, now I want to buy an accordion.

Response to The Flash 'Reg' Lounge 2013-04-22 19:14:22


Is there a reason why all the html5 games are 4kb in size, or is that just a bug? Also, when I hit space (in this game and in Chrome anyway), the page scrolls down like the game never gets focus.

Response to The Flash 'Reg' Lounge 2013-04-23 05:19:10


At 4/22/13 04:50 PM, 4urentertainment wrote: Speaking of HTML5

http://artpolikarpov.github.io/garmoshka/

Nice! I can't seem to make any music with it, though. Am I doing it wrong?

At 4/22/13 07:14 PM, MSGhero wrote: Is there a reason why all the html5 games are 4kb in size, or is that just a bug? Also, when I hit space (in this game and in Chrome anyway), the page scrolls down like the game never gets focus.

I couldn't even get past the 'press anything to continue' screen, and Firefox didn't work, either. :(

Response to The Flash 'Reg' Lounge 2013-04-23 05:27:22


At 4/22/13 07:14 PM, MSGhero wrote: Is there a reason why all the html5 games are 4kb in size, or is that just a bug? Also, when I hit space (in this game and in Chrome anyway), the page scrolls down like the game never gets focus.

probably because its just detecting the .html page, rather than the assets. As its not just one big, itll probably get fixed sometime or another.

Response to The Flash 'Reg' Lounge 2013-04-23 14:24:05


Anyone ever heard of Turntable? It's a Javascript app that lets you access Spotify songs. It used to be a flash app, and it had access to Spotify then too, is there an easy way I can do this in a flash game or do you think Turntable just paid a boat load of money to get their music?

Response to The Flash 'Reg' Lounge 2013-04-23 14:54:41


At 4/23/13 02:24 PM, GeoKureli wrote: Anyone ever heard of Turntable? It's a Javascript app that lets you access Spotify songs. It used to be a flash app, and it had access to Spotify then too, is there an easy way I can do this in a flash game or do you think Turntable just paid a boat load of money to get their music?

if you're talking about multiple people listening to the same song at the same time, then yes it's very possible, but only when there's a server (AIR-only, and not on mobile. Clients can be the regular FP, though)

If you're talking about accessing music from a site, then that'd require permissions or an API of some sort.

Getting music from local sources or even a direct link to an online MP3 is also very possible, even in the regular FP.


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2013-04-23 15:04:22


At 4/23/13 02:54 PM, egg82 wrote:
At 4/23/13 02:24 PM, GeoKureli wrote: Anyone ever heard of Turntable? It's a Javascript app that lets you access Spotify songs. It used to be a flash app, and it had access to Spotify then too, is there an easy way I can do this in a flash game or do you think Turntable just paid a boat load of money to get their music?
if you're talking about multiple people listening to the same song at the same time, then yes it's very possible, but only when there's a server (AIR-only, and not on mobile. Clients can be the regular FP, though)

If you're talking about accessing music from a site, then that'd require permissions or an API of some sort.

Getting music from local sources or even a direct link to an online MP3 is also very possible, even in the regular FP.

I'm more interested in Spotify specifically. Turntable had me log in with my facebook account, which is what my Spotify account is tied to. I would love to have a flash game that connects to Spotify like this, seeing as how I'm trying to learn signal processing.

http://developer.spotify.com/technologies/apps/guidelines/in tegration/
This says flash content is not supported. but turntable had access to Spotify songs when it was in flash. Maybe they have a server that fetches and streams the music? any ideas?

Response to The Flash 'Reg' Lounge 2013-04-23 15:41:59


At 4/23/13 03:04 PM, GeoKureli wrote: I'm more interested in Spotify specifically. Turntable had me log in with my facebook account, which is what my Spotify account is tied to. I would love to have a flash game that connects to Spotify like this, seeing as how I'm trying to learn signal processing.

http://developer.spotify.com/technologies/apps/guidelines/in tegration/
This says flash content is not supported. but turntable had access to Spotify songs when it was in flash. Maybe they have a server that fetches and streams the music? any ideas?

I have no idea what spotify is, so i'll give you what I know:
It's highly unlikely (neigh impossible) you'll be able to access music on a secure server with Flash without two things:
1. Direct access to the MP3 or a server that feeds you ByteArray sound objects through Sockets
2. An XML file on the server allowing you access to the server

You can stream the MP3 from the application to other people using AIR's ServerSocket class and AS3's Client class to stream ByteArray'd sound bits (which, conveniently enough, is also a good way to do a VOIP-ish chat system)

You can always stream direct MP3 files to the application without getting permission from the server first.

You may load and stream MP3 files to the application from the computer in multiple different ways, with or without the permission of the user and/or user interaction (again, via AIR)


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2013-04-23 16:31:25


At 4/23/13 03:04 PM, GeoKureli wrote: I'm more interested in Spotify specifically. Turntable had me log in with my facebook account, which is what my Spotify account is tied to. I would love to have a flash game that connects to Spotify like this, seeing as how I'm trying to learn signal processing.

http://developer.spotify.com/technologies/apps/guidelines/in tegration/
This says flash content is not supported. but turntable had access to Spotify songs when it was in flash. Maybe they have a server that fetches and streams the music? any ideas?

I suspect the app you're talking about uses a proxy to grab the data. You could probably decompile / sniff the network traffic going in and out to figure out how they're doing it


- Matt, Rustyarcade.com

Response to The Flash 'Reg' Lounge 2013-04-23 16:33:45


At 4/23/13 03:23 PM, PSvils wrote:
At 4/23/13 03:04 PM, GeoKureli wrote: seeing as how I'm trying to learn signal processing.
Why are you trying to learn signal processing by using an API to stream audio? You don't deal with any signal through that, at least not with Flash's default API for it.

You're right, this isn't crucial to learning anything about signal processing, what I meant was I want to make a music game that create a level for any song on Spotify. So i want to learn signal processing and streaming songs from Spotify

I had to do a research paper on audio fractals once, and if you want to get up and running reeeaaal quick with simple audio signal processing, check out:
http://www.softsynth.com/jsyn/

Thanks, I'll check out the example applets

Response to The Flash 'Reg' Lounge 2013-04-23 17:07:27


At 4/23/13 04:31 PM, Rustygames wrote: I suspect the app you're talking about uses a proxy to grab the data. You could probably decompile / sniff the network traffic going in and out to figure out how they're doing it

Are you saying I would need some server side script to communicate with Spotify? Truth be told I'm an idiot when it comes to networking, but it's on my to-do list. A proxy server sounds costly if it's going to handle streaming music.

Response to The Flash 'Reg' Lounge 2013-04-24 09:34:04


I was having a healthy back and forth with Adam Phillips and his fb fans about Unity's announcement of it sunsetting Flash support today, was curious what you guys thought of it?

Original article


None

BBS Signature

Response to The Flash 'Reg' Lounge 2013-04-24 13:55:16


At 4/24/13 09:34 AM, Luis wrote: I was having a healthy back and forth with Adam Phillips and his fb fans about Unity's announcement of it sunsetting Flash support today, was curious what you guys thought of it?

Original article

I disagree with a lot of points the article makes, Flash has done a great job adapting. but as I've said before, the swf file is going to die soon, flash will not. Considering you can port to mobile air apps, and now you can cross compile to javascript My years of action script work will not be in vain.

Plus, Unity really seems to suck across the board. It seems people really like the multiplatform capabilities, but it doesn't belong on most platforms because it handles 2D like crap. all of the 3D unity browser games I've seen are complete shit. I know it has a lot of cool debugging features but unless I'm making a console game I'm staying far away from unity.

Response to The Flash 'Reg' Lounge 2013-04-25 17:22:23


At 4/24/13 01:55 PM, GeoKureli wrote: Plus, Unity really seems to suck across the board.

Here's the deal: unity lowers the entry bar for making games. Its easy to learn how to make games in unity, and its easy to make games in unity, as a beginner. So 99% of the shit people make with it... will be shitty.

Here's a few examples of some awesome games people are working on in unity

FRACT:OSC (synthesizer-themed adventure game by a friend, been in development for a few years)
http://www.youtube.com/watch?feature=player_embedded&v=GCg8J 2NrSrE#!

Kerbal Space Program (is made in unity, is a pretty damn crazy awesome simulation game even though its still really early in development) https://kerbalspaceprogram.com/

Distance (made by some friends from college, tron themed stunt racing game)
http://www.youtube.com/watch?v=gCDJHfhBfIg

Legend of Dungeon (co-op rougelike thing)
http://www.youtube.com/watch?feature=player_embedded&v=ExLiQ becdT8

I'm working on my own thing in unity too (http://bombernauts.com/play), and I have my opinions on it (there is a lot about it that sucks, whenever I try to venture out of the box it built for me), but if you are the type of person who doesn't run into walls with flash, then you absolutely wont run into walls with unity (unless you want vector-based 2D art, which is something flash still excels at), most of my issues with it have been issues with features flash would only dream of (custom shaders, various issues with the built in shadows only being multi-pass, an issue with 3D textures).

oh, asked some friends to list unity games, here's some more:

kentucky route zero (won some IGF awards this year, not my kind of game though)
http://www.youtube.com/watch?feature=player_embedded&v=gGQOa z1xFOo

lovers in a dangerous spacetime (igf nomination this year, never played it)
http://www.youtube.com/watch?feature=player_embedded&v=NwfRY GVADL0

gone home (also never played it)
http://www.youtube.com/watch?feature=player_embedded&v=sqSbY sUalMQ#!

year walk (another IGF nomination)
http://www.youtube.com/watch?feature=player_embedded&v=LVz_M hMsAvs

Response to The Flash 'Reg' Lounge 2013-04-25 17:30:23


more death tolls for flash:

a huge amount of people making flash games right now are using flashdevelop or haxe (or other tools), and skipping adobe's tools entirely. Adobe doesn't make money on flash as a platform (they tried to, and it was such a failure that they recently retracted those fees), they make money on flash the authoring tool. Now, they COULD spend time working on the authoring tool to make it better than the free alternatives, but they are adobe, and they will never do that.

The only reason adobe flash has lasted so long is cause they had a monopoly on it, and that isn't the case any more.

Response to The Flash 'Reg' Lounge 2013-04-25 17:38:38


At 4/25/13 02:43 PM, PSvils wrote: < / selfpromo >

Yeah, I would play that for days, what platform is that for again?