Actionscript 3 :: Class-less Programming Close To OOP In Spirit?
Oct 20, 2011
So I'm a flash game developer trying to make the transition from AS2 to AS3+OOP, only 3 years or so after everybody else did. There's a plethora of free, very helpful material to go through and I've been spending 2-3 days wrapping my head around some of it, but by now I feel like I just want to start and try it out and learn the harder stuff as I go (just like I did with AS2).
I get the benefits of (most aspects of) OOP and I was once forced to learn to do a couple of games in Processing which had me write a few classes and I really liked the whole inheritance thing, which is the biggest reason I'm keen to move on, I think.
I just wanted to ask about game structure - is my current way of AS2 programming (see the example below, with some pseudo code) close to the way you'd organize things in OOP, or are there some big flaws in my game logic/structure that I can't see? The way I understand I would have to do differently in AS3/OOP is to have a class for moving stuff such as the player, hero, missiles etc, then have an enemy class that extends that class, then have classes for each enemy that extends the enemy class, unlike now where each "class" is instead an object and a function called from the main game loop, and sub-classes are instead "if"-clauses in each function. But except for that, is my programming style on the right track or do I need to re-think the logic behind my code for it to work effectively in an AS3/OOP setting?
[Code]...
View 1 Replies
Similar Posts:
Jan 18, 2012
I need to create a user interaction simulating the use of a spirit level showing that a rectangular object on the stage is level. It doesn't have to actually work like spirit level, basically just has to give the impression that it has worked like one.
Maybe make the bubble of the spirit level should move (become animated) when being dragged to the object, then settle (animation come to a stop) when dropped in place on top of the rectangular object? Although I am unsure of the code to go about this?
View 4 Replies
May 25, 2009
I have implimented a video handler class to part of my project. What it is intended to do is remove the playing video using the netStream method and create a new instance with a new video file.I can remove it using a standard removeChild function. However the pain occcurs when I can still hear the audio palying.I guess my issue is that this is handled in a class and every time I create a new video it creates a new instance of the class.My question is then how do I call netStram.close() from another class before creating a new video instance.[code]
View 9 Replies
Jul 27, 2009
i want to close browser by clicking on close button embedded swf. I have tried fscommand("quit"), but which is not working on browser.
View 9 Replies
Mar 23, 2007
*let say i have a mc called A. it can call a MC with an instance name called window_btn.window can be drag and double click.i want to put a close button in the window MC to close the window.
how to call the close button in the MC?
View 14 Replies
Apr 19, 2010
e4x programming extension is native to Actionscript and makes sense to use it over Xpath or any other DOM interfaces. I would like to know from flex community if they had any bad experiences like performance, etc, or any other gotchas.
View 1 Replies
May 21, 2010
I haven't programmed in a while, and have kind of lost interest, but I want to get back, and I've enjoyed C# the most, a lot more than objective-c and visual basic. So I want to make some games that me and my friends will be able to play next school year. So basically something you can play on the web.
What programming languages deploy to the web?If c# is possible, and a mac with safari/firefox would be able to use it (I can't install plugins, and I don't want to get in trouble for making myself admin again)Flash, Java, etc. If java does, I'd like that most since it's most like c#. Then what libraries/engines would I use? I want to do 2d. And then what IDE would I use?
View 6 Replies
Apr 20, 2011
is there any decent tutorial for flash programming on iphone?
View 2 Replies
Sep 13, 2011
what i mean is, is there a way in AS3, or in programming in general(php, js etc) to make an event fire/activate "WHEN" something does something, as oppose to an if/else if / else statements ? for example, say i want to make an event fire /activate ONLY when a frame label is hit, and thereafter , do something else etc, essentially making it do things one by one down the line according to WHEN certain objectives are met.is there a "when" type of statement etc that will do this as oppose to if/else if etc???
for example, using the above example, instead of me doing something like this:
[Code]...
View 2 Replies
Jan 11, 2011
I don't seem to find any decent AS3 book for learning Object Oriented Design.
I checked several ones but most assume that you are an intermediate or advanced AS3 developer.One like AS3 Design & Patterns is good but starts simple and get really complicated quickly. Another 2 are Object Oriented AS3 and Advanced AS3 with design patterns is TOO ADVANCED. Now we have OOP books but not for the little guy with limited programming experience like me. What are my alternatives? A friend of mine told me get Head First Java and learn from there it explain Java but especially OOP for beginners. What do you guys think I should do? I feel it is a shame that I need to go to Java to learn OOP because AS3 books are not for beginners.
View 9 Replies
Apr 19, 2011
Can u recommend me a good book/e-book/tutorial to network programming in as 3.0 ? I'd like to create a multiplayer game.
View 0 Replies
Dec 6, 2009
How can you create a car driving game or a man running. I would like some tutorials so I could get use to flash mx.
View 1 Replies
Jan 21, 2010
So I am trying to get better at putting all my code within one action layer and there is a bit of button code that seems to be confusing me.
Whenever I program a button I use the following code:
PHP Code:
on (press){
} on (release, releaseOutside ) {
}
Now I know programming the on(press) command is done like this:
PHP Code:
btnName.onPress = function() {
}
However I am having a hard time with the on (release, releaseOutside ) code. The only way I have been able to do it is like this:
PHP Code:
btnName.onRelease = function() {
} btnName.onReleaseOutside= function() {
}
My question is, is there any way to combine the two onRelease commands?
View 2 Replies
Jul 2, 2011
Let me sum up the game the best I can real quick and then get to the problem. I cannot upload any code because I am under contract. I also know the code is working 100% correct. The game I am working on will have "X" number of large images. The "X" images will then be broken down into smaller images. I have around 3,000 images, all in the Flash Library, classes are named correctly, the files are named and sized correctly, etc. The game works perfectly on images 1-66. When I get to image number 67, the game SWF starts flickering from scene 1 to scene 2 and then back to scene 1 for a non-stop loop. No matter what image I use for #67, the swf flickers. My FLA is around 300MB and my SWF is 102MB.
So, does anyone have any ideas on why adding a 67th image would make the SWF freak out? Could it be some type of file size issue, graphics card issue, virus, etc? I've tried it on multiple computers both PC and MAC.
View 3 Replies
Apr 22, 2009
I'm looking at purchasing a couple of new AS3.0 books, I would say my skill level is basic to intermidiate, and I'd like to push my skills to at least near or at pro levels, what would you recommend?
View 5 Replies
Jun 22, 2009
I am new to Flash and AS-3.0. I am using Flash-CS3 as IDE and AS3 for programming/coding.I have created a ScrollPane component using the following sample AS3 code, which is a sample user-defined function written in ActionScript 3.0:
Code:var sp:ScrollPane = new ScrollPane();
var myClip:MovieClip;
var boxXLoc:int = 0;
var boxYLoc:int = 0;
var boxWidth:int = 140;
[Code]...
View 1 Replies
Jun 22, 2010
From what I understand, ActionScript (.as files) and Action Panel (F9 embedded in Flash) are completely different. If so, which one is better used for game programming and which one is more powerful? Can ActionScript do everything that the Actions Panel can do?
View 1 Replies
May 24, 2010
If u have any tutorials, books or links related to this type of code, please forward me for this or my mail id - swamy.webdesigner at gmail.
View 1 Replies
Oct 10, 2009
I just read a good tutorial at [URL] about creating simple apps with AIR/FLEX. What are some similar pages and/or good books that I can read to move from "beginner" to "novice"?
View 2 Replies
Oct 25, 2009
Any pointers where i could start learning flash programming. Also i would be really grateful if you could point me to place where i could get free templates for the programming
View 2 Replies
Mar 11, 2010
I've got in over my head trying to learn programming, but love it.How would you teach a designer to migrate from design to object oriented programming?
My interest is AS3 in Flash IDE, but any advice is welcome. Looking for a full explanation.
View 5 Replies
May 15, 2011
how to programming for Apple GameCenter by Flash ?
View 1 Replies
Sep 21, 2009
I have been learning about classes and oop programming with AS2. I think I have a very good idea of how it all works, but I'm lacking in one final area before I can truly say I'm coding in OOP.Currently, I use a contentmanager class to route all button commands through. This class handles the removal and preperation of the stage for content change, and then seperate classes handle the actual loading and placement of the new content.So in a way, its not really OOP, just very well organized code.
The next step is Event Management in AS2. I know it can be done, I read through a few tutorials, but get confused by it all.What I'm looking for now is two things.. a very good Event Management tutorial or article if anyone knows of any..as well as a sample site that can be downloaded or viewed which has been written using OOP. I want this sample site, to re-evaluate how my current way of programming holds up compared to more proffessional examples...
(Perhaps even we can turn this into a hot thread with examples of code and structures to help other developers trying to gain a grip on OOP..?)
View 3 Replies
Jul 8, 2005
I found this amazing site on [URL]
They use in the interface mouse scroll also, how can I make it in AS?
View 5 Replies
Jan 20, 2009
I have created a function which spawns a enemy out of the library random upon any of the four corners of the stage. But know I want to add individual AI to each one: This is the random spawn:
[Code]...
How would I go about such a task. Btw if you have trouble understanding the mechanics of my messy code please say and I'll do my best to explain it.
View 6 Replies
Jun 20, 2010
Was wondering if anyone know of a chat dedicated for flash programming.
View 5 Replies
Mar 9, 2009
I'm a programmer familiar with object oriented programming, with experience in C++, C# and the MS Visual Studio development environment.
I've been tasked to create a web based game using Flash CS4 and ActionScript3. I am new to Flash, ActionScript and game programming. I have never used previous versions of Flash or ActionScript.
The game will be a single player role playing game. The player will have the ability to create an avatar. The player will move the avatar from screen to screen based on button clicks or drag and drop onto objects in the current screen. Players must register, and player information will be stored in a database backend. Additonal data will be saved to the backend database during game play.The saved data will be based on player actions in various screens, and in some cases data entered in a form on a screen.
For a first pass a stick figure avatar and screens containing simple buttons and simple objects to drag the avatar to will be sufficient. I would like to store data in a database tracking date/time information, e.g. date/time each screen is entered/exited.
View 3 Replies
Jun 25, 2009
how to develop a touch screen application using flash action script. It is a kiosk type application.
View 4 Replies
Oct 15, 2009
Poony Script is a new programming language for Web, working with proxies between Flash Player and ActionScript 3, and a powerful performance and high flexibility of development, in addition to being free and unrestricted.URL...
View 3 Replies
Jan 6, 2010
am working on developing and programming for games, having 2+ years experience. Now I want to learn more about Flash Lite and 3D Graohics Programming. me some of the best sites I can check and especially some offline resources/trainings
View 1 Replies