
In a recent post I voiced my admiration for artists, designers and animators but noted that they seem to have been left out in the cold with ActionScript 3.0. I added a little helper statement not in the ActionScript 3.0 documentation—MovieClip.addFrameScript(). The idea was to encourage artists not to be too hasty in giving up on coding altogether.
Quite frankly, I was surprised by the number of comments we received on that post. I didn’t think artists bothered with our kind of discussions, and was more than a little gratified to find that some of our readers identified with the issues discussed. So I started thinking about a series of posts for helping artists.
I didn’t want to do a “dumbed down” ActionScript 3.0 for artists; so I opted for an approach that would cover the same principles that we’ve discussed throughout the life of this blog. However, I would move more deliberately and touch more bases—especially the basics of OOP. Further, I decided to use video and take advantage of the new Quicktime Player that comes with Screen Sharing. So, I created a simple class to start things off, and put it in an .f4v file (H.264 format) and you can download it by clicking the download button:

You will need an Adobe Media Player that is free to download. I did not include any .fla files because I’d have to put in at least two because some have CS3 and others CS4; so you’ll have to use your own .fla files. Each video is short and will play full screen using the Adobe Media Player. The only thing I need is feedback to let me know whether this kind of thing is helpful or not. I will be focusing on graphics and loading graphics, but I welcome ideas from one and all.

The OOP for Artists: The Empowerment of ActionScript 3.0 by William B. Sanders, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.
Related posts:

Bill Sanders
This is an important issue, as3 scares lots of people. I’ve been studying it for a while now and the gap between copy and pasting code, and actually creating things yourself is pretty big
Hi Bill,
I also downloaded the archive ( out of curiosity ) and I’d like provide some feedback ( although I’m not a designer but I started as a freelancer where I was “forced” to handle both design and programming – I think that the stuff I “designed” wasn’t that bad and I also like to believe that I have “some designer blood in me”, so take my feedback as if it came from a designer-developer hybrid ).
First of all: Great initiative and idea! ( I think I already said this before but just to make sure :) )
Secondly: It’s a good thing that you didn’t really “dumb down” things too much but I think that when you did go into more detailed explanations, you were missing out on a few things that in my opinion would have been important for a designer to know and those additional explanations wouldn’t have required more than 1 phrase, a few + seconds ( I have many designer friends and I think I have at least a small understanding about their way of thinking and problems when it comes to programming ). For example: when you were explaining what 0xCC0000 is… Instead of trying to explain what that Hex value is ( which I think that even the most junior designer is already familiar with ) you could have explained in a short phrase “why did we choose to use ‘unsigned integer’ ( uint ) and not Number, or int” ( I’m not saying to get into a lot of detail here because as you said, the videos are intended to be short but I’m quite sure that when saying ‘unsigned integer’, no or a really, really few designers actually understood/knew what those are… I hope you understand my point ). Also, when you shortly described what classes are… for a programmer “think of a class as an object” is totally cool, but the designer would go “what?! what object?”. “Dumb down” seems a bit harsh but I do believe that sometimes it’s better to try to “dumb down” certain things than raising even more and more questions. I could continue with the list ( I’m not really sure if designers can make the difference between the Sprite or the MovieClip class so explaining what “Sprite” is and why are we “extending Sprite” wouldn’t have hurt either ), but I don’t want to seem picky ( it’s really not in my intention ).
All that I’m trying to say is that I’m personally not really feeling that this video is for “artists” but more for “newbie programmers” that already have a slight programming knowledge. I might be wrong, but in my opinion artists need to first really understand basic things before they can jump into classes ( obviously, no one can expect you or anyone to sit down and create “ActionScript 3.0 step-by-step video tutorials”, but in the same manner, we ( programmers ) can’t really expect that designers will sit down and fill in different gaps on their own, which many would expect to “be filled automatically” after watching a video that “was created with the designer in mind” ).
Thirdly: Holly Crap! That “Eeeeek” sound scared the s**t out of me! I almost fell out of my chair! Either your microphone was toned down or you were speaking to quietly but I had to turn the volume up quite significantly to clearly understand what you are saying in the video, and when I was assuming that you’ll now say some “closing words” ( since the video was almost over ), from nowhere, came that extremely loud Eeeeek sound which honestly almost gave me a heart attack! :D
I know that this is your first attempt with such a video, and I really hope I didn’t seem picky ( or at least too picky ) because I really respect the idea and the effort you have put into this video, just that I believe that if you really want to help designers understand programming then before jumping into classes, methods and who knows what, a few more “introductory videos” wouldn’t hurt ( basic stuff and short explanations like: “what’s a Sprite… Why to use a Sprite instead of a MovieClip in certain situations. What’s a “uint”, why not use a Number when dealing with colors? Why haven’t “I” ( I mean you ) used any access-modifiers when declaring the variables in the video… what are “access-modifiers”? and so on… ).
With kindest regards,
Barni
One more thing: I might have understood the intention of these videos wrongly. I know that you are trying to “cover the same principles that we’ve discussed throughout the life of this blog” but if you really want to “get to the designers” then I’m afraid that it won’t really be easy to follow the same principles that were discussed throughout the life of this blog.
Now, you could also say “ok, I’m not really targeting ALL the designers but only the few that already have some programming experience and are trying to make a switch from AS 2.0 to AS 3.0″, which is totally cool if that’s what you are aiming for. But if that’s not what you had in mind ( and I believe that it’s not ) then you might need to “make some sacrifices” and make some really introductory videos to AS 3.0 so that designer ( with some or almost no programming experience ) and somehow follow the video.
PS: An additional info to the video: when drawing stuff by code ( and not only ), it’s usually faster/easier/cleaner to use the “with” statement ( http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/statements.html#with ). Having to repeat mySprite.graphics. each time we want to draw a line or fill something or who knows what can get tiring quite fast and it is also more open to “typo issues” ( except if the person writing the code is using an IDE with code hinting, like Flex Builder ).
Cheers,
Barni
Hi Michel,
First off, let me say how much I admire your site. (Love the lion!)
Your point about the gap between cut and paste and doing it on your own is pretty big is an important one. That’s why I began with a whole but simple class. I’m hoping to start with a larger concept and then filling in the parts as I go along. Then it doesn’t become a sequential process.
Since it looks like you’ve made some videos on CS3 any tips are appreciated.
Thanks,
Bill
Hi Barni,
I was hoping more experienced developers/designers would take a peek, and I appreciate your comments. First of all, I wish I could say that this was my first time using video and screen sharing but far from it—I did a series on Flash Media Server 2 some years ago. So my excuses have to be more creative!!
All of your points are good ones, and originally I did have an explanation about hexadecimal, unsigned integers, data types and all the rest. The problems turned out to be between Adobe Premier CS4 and using .mov files and converting them to .f4v files. Likewise, I was unable to load .mov files into Final Cut Express, and I didn’t want to load them into iMovie HD because the output format is never the quality I want for .mov files that will be converted into .f4v. So I ended up trying to do everything in QuickTime Player. The only editing tool it has is Trim which allows me to trim the beginning and the end of the file. (However, I had great success with Apple’s Soundtrack app, as you found out. They’ve got about 50 different scream special effects.)
If anyone has any suggestions about the Adobe Premier CS4 settings and outputting to Adobe Media Encoder CS4 I’d like to hear them. It might be a matter of the newness of the QT format that I got when I installed Snow Leopard. More likely it’s the way that Premier CS4 handles files. (I may try it on my old Win XP with Premier CS3.)
As for the approach, where to start and how much to include is always tricky. First, I am tackling it as though I were talking with a novice developer instead of a novice designer. When I read materials on graphic art, I read materials developed by and for graphic artists; and I’ve read a lot. (I just have no artistic skill and try to get by on my criminal forgery talents.)
Second, I’m trying to escape the sequential approach to learning programming. That requires that designers (or new developers) first encounter blocks that only make partial sense. People tend to learn as a prospective-retrospective process—especially artists. That means that a general overview and outline precede the details. As a person comes to understand something, they get part of it and assume (prospectively) that a fuller understanding comes later. Then, retrospectively, as the context builds, a better sense comes to the whole process. In fact, the approach is an object oriented approach in the sense that I’m trying to examine blocks of objects with chunks that communicate with one another rather than a sequence of of steps.
Anywhooo…it hasn’t been helped by the cranky relationship between the new QT and my Premier or other video editing tools (As noted, Final Cut Express won’t even load the .mov files.) I’ll play more with the Premier settings and hope for the best. QT raw works great with AME CS4–it’s just that I cannot seem to get it to work with AME after it’s been diddled with by Premier.
To top that off, while I live in a fairly rural area, it seems that as soon as I start recording, all sorts of noise invade my non-studio. Airplanes are the biggest noise makers, but as soon as I hit record, it seems that Hell’s Angels MC invades my otherwise bucolic neighborhood. (It’s a mile to the end of my block…to give you some idea.) So I really need a decent way to edit this stuff!
Any ideas on Premier CS4, Adobe Media Encoder and MOV files that are welcomed!
Thanks once again for your insights,
Bill
Woah! :) Well, I sadly can’t be of much help when it comes to video, especially not when it comes to Premier ( nor QT really because I’m not a Mac user ), but if you do find some answers then don’t forget to share the info. :)
I’m also planning on doing some video tutorials ( I’m still not sure on what exactly but definitely AS, Flex and/or AIR related – maybe even DP but I need to gather more courage for that first ) as soon I get my new domain up and running ( “a fresh and new start” ). So, having such video settings related information at hand will surely be of great help and a real time saver.
I’m not sure if a .f4v player plug-in exists out there for Wordpress but I think it would be nice if people could watch your future videos directly on the blog ( go full screen and maybe have an additional link to download the video if they really want to ) than having to download the files and install a standalone player to watch the videos ( maybe it’s just me, because I’m not a huge fan of the Adobe .flv player, I find it way too busy and sometimes quiet annoying ).
Anyway… keep it up! ;)
With kind regards,
Barni
Thanks again Barni,
If someone is kind enough to suggest some settings for exporting edited mov files through Adobe Premier CS4, I’d definitely list it here. I’ll experiment with inserting .f4v and .flv files directly into WP–I hadn’t even thought of that.
Hope to hear more from you often.
Take care,
Bill
Hi Bill,
I watched your video and downloaded the code and it took me back to when I was first trying to understand programming concepts. I think the first book I worked through was on Flash MX and I bought it not because I really thought I could learn programming, but because it was marked down (the disc in the back was broken). I remember I got a replacement disc for free and went on ahead with something like the prospective-retrospective learning process you describe, but I would have called it “fits and starts.”
I don’t remember the specific line or lines of code that finally made ActionScript “click,” for me, but I remember it was code in conjunction with objects – movie clips. When I could write even a single line of code that made a little red ball move from one side of the stage to the other or jump up and down or become transparent, that’s when it started to make sense, or maybe that’s when it all started to seem like it was worth the effort.
I applaud what you are doing. You’re taking time and effort to make a starting point for people who want to learn about a difficult topic – people who perhaps don’t even think they can learn about programming. If I have one word of advice, it’s to keep going the way you have started and relate your code examples to images (sprites, movie clips) and then show people how to make that little image *do something cool.*
Keep up the good work.
Barbara
Hi Barbara,
I’m very happy to hear that some find some use in this approach. Anyway, if given a choice I would have wanted to start with OOP myself, but back then (when Fortran II was hot and new!) the only kind they had was sequential. So I’m betting that any designers who wander over here might want the same thing.
Most of the things that we’ll continue to do on this blog will be the focus on design patterns, but as long as we’re going to have something for artists learning design patterns, we might as well do it right.
My biggest problem has been working with Premier CS4 on my Mac. My Premier CS3 sitting on a Win XP handles everything fine; so I’m not sure what’s going on.
Your feedback is always welcomed.
Kindest regards,
Bill
Hello,
I like your videos, they are well done. It is very at the begenning.
If you are thinking about doing more tutorial for artists and beginners I think that what is missing a lot in book or on the net for many beginners is an explanation of how to structure the code in flash and how to deal with display list and event model.
What could be really good is sort of “little design paterns”, may be less flexible than real design pattern but with which we can have an overview of how to correctly structuring flash file.
There seems a big gap between books that explain the vocabulary of actionscript and basics of OOP, and those dealing with design patterns. Design patterns are very good but it really lacks smallest design to abord flash with a good structure.
You who are very gifted in design and minimalist examples, please show us little good structures to start with flash! Between basics of OOP and Design Pattern.
Very enjoy your work of an programmer artist !
Patrick
Hi Patrick,
I like your ideas, and I’ll see if I can incorporate them in future videos. The problems I’m having right now are all technical editing problems. However, I’m working through them. I think that my best bet for now is to use two different applications for screen sharing and audio recording.
I’m also going to have to work through the balance between advanced materials for this blog and OOP for Artists. In the past, our advanced readers have been very generous with their help for ActionScript 3.0 beginners, but we have a good deal of materials that are of an advanced nature and we need to consider.
By the way, Video #2 is now available at:
http://nemo.mwd.hartford.edu/~wsanders/oopart/
As always, it’s great to hear from our readers.
Kindest regards,
Bill
Hi Bill,
You certainly know, but just in case, here software that can help :
http://www.debugmode.com/wink/
http://camstudio.org/
Patrick
Hi Patrick,
Thank you for that! I found a Mac version of Camtasia, and I downloaded it and tried it. It works great and I can edit it. I was also able to convert it to an F4V file–which I was unable to do with an edited MOV file from the new QT Screen Sharing.
Never be shy about suggestions! This one may have solved the problems I was having.
Kindest regards and thanks again,
Bill
Hi Bill,
It’s good it had helped resolving your problem !
Didn’t know that you where on Mac, happy that you found an other soft for Mac
Patrick
Hi Bill,
I heartily agree with Patrick in his request for more information on how to deal with the “structure of the code in Flash and how to deal with the display list and event model.” I’m not sure we are talking about exactly the same thing, but I think so. I call the problem “you can’t get there from here,” compounded by the dilemma of whether you should even want to get there from here.
For example, my first dilemma when I started my entry for the Golden Lunch Bucket Contest #4 – Pattern Warrior was this. Each type of soldier had his own subclass of the interface Warrior and the idea was to make an interface for Movement with a subclass for the different types of movement that each kind of soldier would have. I was able to do this part fairly easily (by following the pattern!) but then when I got my movement subclasses made, I could only make them put out a trace statement. I couldn’t figure out how to reach the warrior subclasses from the movement subclasses!
The books on ActionScript game design I had been studying mostly started with MovieClips already on the stage with instance names, which made them fairly easy to access from different classes. I tried FlashKit and other forums and did the best Google search I could think of and I did find other references to the same problem, mostly with answers I couldn’t understand. So finally, by going back and looking at the Vertical Shooter example in your book, I figured out that if I could send in the stage as a parameter, I could also send in a warrior movieClip as a parameter, so that’s what I did, and it worked. But I am not at all sure that was the correct OOP way to do things. Should I have used getters and setters?
I discovered that once I had made parametized Movement subclasses I could no longer group them together and instantiate them as a group from a Warrior Leader subclass the way you did the Fire subclasses, so I was stuck for a way to have my soldiers move as a group.
Basically the problem, if you’re self-taught from books the way I am, is there’s lots of good books that do a very good job of covering basically the procedural nuts and bolts of Flash and ActionScript with an icing of OOP. Then there are a few good books on pattern design (yours for example). But there’s a big gap in between, and I find myself floundering around in that gap right now with questions like the one I described above.
I’m only up to chapter 5 if your book. If I study diligently to the end, will I be able to answer questions like this well? Thanks.
Barbara
Barbara,
Mais, bien sûr–once complete you’ll know everything. (Of course you’ll have to join Alcohol Anonymous….) By totally abandoning code on the timeline, it becomes possible to put all of the code into an ActionScript 3.0 Design Pattern. It clears the stage initially, and so all of the focal points that you and Patrick have are key ones. Probably the best way to go about that is to take the specifics of what you and Patrick talk about and review how to do them.
Let me know what would be a specific example you’d like to see to start with–not the dp, but just the actions.
Kindest regards,
Bill
Hi Bill,
I’m looking forward to knowing everything — I think. Hope it’s OK to use an example from the Warrior problem since the contest is still open, but that’s what’s fresh in my mind. You can wait a few days to answer if you want. Actually, I couldn’t quite wrap my brain around the warriors so I made a simplified version using rabbits. I had a pink and a blue rabbit in the library of my FLA. Then I made RabbitTemplate.as:
As you can see, I got the pnkR:Sprite into MovePinkRabbit() by passing it in as a parameter which worked. But now if I wanted to make a RabbitLeader subclass that would move both pnkRabbit and bluRabbit at the same time as itself (like you did with the Lieutenant subclass playing all the firing sounds of the other subclasses at once) I’m stuck because of that parameter. I can’t, for example put these statements in the RabbitLeader subclass:
moveTheRabbit = new MovePinkRabbit();
moveTheRabbit.moveRabbit(pnkR);
moveTheRabbit = new MoveBlueRabbit();
moveTheRabbit.moveRabbit(bluR);
because the parameters get in the way. I don’t want the RabbitLeader class to make more rabbits. I just want him to be able to move the other rabbits when he moves.
It worked for you with the Lieutenant subclass because your fire.fireWeapon() command didn’t have any parameters:
So how could I call a method in a subclass that needed a parameter when I didn’t want to pass in a parameter? Hope this made sense. It seems to be the kind of syntax vs structuring problem I keep running into. Patrick, got any examples for our fearless leader?
Barbara
Barbara,
You have gun-toting rabbits? Pink and blue gun-toting rabbit? I’ve got to wait until after the 20th (Sept. 21+) to respond, but it sure sounds like fun!
Cheers,
Bill
No, the rabbits don’t have guns, the warriors have guns… Never mind, I’ll wait. Thanks
Hi,
I don’t have immidiatly very concrete example, but here some think that may could be well to better get into as3, flash and opp.
- in lot of case artist and beginners would certainly want to try to make somethink like a sort of “film”, “comics”, “aventure game”… where scene take place one after the others and where things that the users do will influences the rest of the story.
In a sequenciale style this is not hard to do that, all scene are divided and the memory of what did the user could be put in global variable.
One “design” that may could be interessant is to see how to correctly make in an opp way (if it make sence to use oop for that :) ). And certainly look at loading swf problems.
A second “design” that may could be interessant is a frontal approach to the evolution of what is happening on the screen, in that I meen that unlike of the “film” style where sequence are going one after other it seem that there is a other system wher the content of the screen change gradually, some things desapeers, other reapear… What could be an good oop design of that ?
An other thing that come to me, more directly about flash, is a structure that seem to me to be the firt that would use most of beginners (after having learning the basic of event model and display list) :
- Main contain for example 2 movieclip : a little questions/anwser game and an toon who grimp gradually scale.
- In the game movieclip there 10 text field and a button to validate anwsers.
- The movieclip game is connected to Game.as via his class name in the properties in the librairy.
- Game.as listen to the button and when click come he check if the anwser are corrects, if they are Game.as dispatch an event “win”.
- In Toon.as there is only a function to make the toon grimping.
- Main.as listen to the game movieclip “win” event and if it come do mc_toon.grimp()
It is a simply example, in other case we can have the same structure with a bigest display list and more complicated movieclip and class, but with always the same principle of parent who takes care of communication between children (may be like in real life).
Is it a correct way of oop ?
A last thing that a see that could help beginners is an overview of what we don’t have to do if we don’t want to make sequancial programming into oop programming ?
Hope that all of that could be understanebled with my english.
It is just little think, don’t no if it make sence.
Good night, I’m going to sleep…
Patrick
Hi Patrick,
Your comments on making something like a “film,” “comics,” “adventure game” … where scenes take place one after the other certainly hit a chord with me. That is exactly the kind of project I am planning. My idea is to use mostly still images that I create to make something like a graphic novel that you click through with additional interactive experiences along the way. At first I was thinking of doing what you suggest about having what the user does influence the rest of the story (branching plots, multiple endings, etc) but then I read a book, “The Seven Basic Plots,” by Christopher Booker. I don’t agree with all of his conclusions, but his observations about story plots down through the ages seem right on to me. He made me think about something he calls the story archetype, a linear plot or set of stages the story moves through from it’s beginning through development to its climax and resolution. This linear form is what makes stories so satisfying to us, so I decided not to mess with the archetype.
But back to OOP. From what I know right now about OOP and pattern design (not much), it would seem the best way to do this would be not to use a pattern at all, but simply to progress through my plot something like this:
Zoom in on opening scene: a man walking through a woods. Somehow here, I have to let the user/viewer/audience know they have to click something. If they click on his head, they get another image or text or sounds that tell his thoughts. If they click on the “thought,” they could be transitioned to the home scene of what he is thinking about (for example, a woman who is preparing a picnic to have with the man). Click on the woman’s head and you get her thoughts (the man). Click on that and you’re back to the man’s home scene of walking in the woods. Now the plot can advance. Something happens that is generated by the program. For example, I am planning a cataclysmic sort of thing that catapults the man to another dimension. (Yes, he misses the picnic).
So I need program that requires the user to initiate a certain sequence of events that have to be completed and then the program generates an event that moves the plot forward. Then the user/viewer is presented with a new scene and new things to click. So the program has to be able to handle knowing when certain things have been accomplished. It seems the best way to handle this might be to have event dispatches move the code from one scene to another in a simple linear fashion. Would it be possible to have a client or “table of contents” class that takes care of ticking off the scenes as they happen? Am I skating dangerously close to a Singleton concept here?
Besides the “table of contents,” I would like to make a set of generic classes that I could use to handle recurring tasks, for example, a dialog class the user would click through. See example on my site. You start by clicking on the “A” circle, then “B,” then back to “A” etc. I can change the dialog via XML; see circle “C” and circle “D”. http://bitsong.com/forPosting/dialogTest/dialogDemo.html
I will also need a way to present narrative scenes which could be just some text to read, or the text could be read aloud by the program (text-to-speech). The action scenes would probably be part interactive and part program-generated in response to user input.
I am planning a long story with hundreds of dialogs, narratives, action scenes etc. Obviously I need some overall plan to handle organizing this or my story code could degenerate into a “spaghetti western.” (That’s a joke.) Bill and Chandima, if you’ve been following along, any ideas. I’ve been peeking ahead in your book and it seems that maybe State or Strategy patterns might be right for my project. Am I on the right track? Thanks.
Barbara
It’s cool to help them, however It puts a machine gun in monkey’s hand …
When you try to teach something like that to designers , certainly will there lots of codes with bad pratices and will be hard to do some software actualization after….
Hi Barbara,
I’m not sure which design pattern would work the best. Going to the key question of “What varies?” it seems that the instantiated object varies–a class/subclass. So that would be the Factory Method. You mention the Strategy pattern where algorithms vary but is that the main variation? It may well be with hundreds of dialogs, narraives, etc. Also, the Abstract Factory, while a little harrier, would also be a good candidate. Off the top of my head, though, I think the Factory Method may be your best bet.
Hi Segundo,
I’ve received a lot of help from artists, and I’ve got my artwork to the point of “not awful.” (If minimalist can be considered not awful). Besides, the artists who come to this site seem to be in the same boat as new developers and a very different calibre than the run of the mill artists. So if I can be a monkey with a machine gun (plus a hand grenade and bazooka) in art, I guess it’s okay for artists to be given the same right in development.
Take care…those monkeys may come after you,
Bill
Hi Bill.. rs.. don’t get me wrong, when I said about software actualization I mean when the designers or flash producers try to do something to help the developers ( working in the same project.. same job ), however this kind of stuff could not be too good to the job.. got it?
So if a designer or producer are working alone in their jobs is cool that they could do their stuffs using that kind of a AS help.
In my agency It’s always hapening.. And after the developers have to erase something to do the right way..
Segundo
Hi Bill
Sorry you said Factory because I have already read that part of your book, now I don’t have to finish it! (just kidding). Thanks.
And this monkey thanks you for your support of artists too. Maybe the question is could a thousand monkeys typing away on a thousand machine guns eventually produce good Oop?
Barbara
Hi again Segundo,
I see your point. What I had in mind are cases where artists are working alone. However, in a situation where each has a role, it’s best to let each do what he does best.
I can’t help but think, though, that the more each understands the other, the better they can work together.
Thanks for clarifying that!
Kindest regards,
Bill
So Segundo,
You are basically saying that each professional has a role, artists to art and developers to code, and that they shouldn’t step on each other’s toes in a professional working situation. Yes, I agree.
But as Bill assumed, I am going it along, so the only artwork that will suffer (or benefit) from my code is my own.
Barbara
Hi,
I will repeat, but certainly the most important thing for artists in interest of learning programming is to feel the mechanism of programs and how this can have a lot of influence in the way there art will become, + of cource the pleasure of doing that. I don’t think that an artist that don’t know anything about poo will do the same thing than an other who knows. No matter I think if they do it absolutly well.
Bill, It would help me a lot if you could give me just a little opinion about the example of structure of the question/answer game I did write about, could you ?
Barbara your project look fine !
Patrick
Hi Patrick,
I haven’t sent an answer because I wasn’t sure exactly what would be the best approach. Games are the most difficult because you have so much happening. Because games often rely on state, the first idea that comes to mind is a State Design Pattern. However, I’m also thinking that an MVC design may be able to handle the different parts better.
I’m starting a series on the MVC, and you might find it helpful. Also, see Chandima’s posts on PureMVC.
Bill
Hi Bill,
Thank you for quick answer, sorry if I’ve pressed you. In fact I was not for the moment exactly looking for a Design Pattern, even if your sugestion will certainly help me later, for now I’m just wondering if my approach of giving “parent” in the display list the role of making communication between there “children”,is not completly bad in term of correct OOP ? Sorry it’s a little bit hard for me to explain all what I would like in english.
Patrick
Hi Barbara,
I hope you understand my point, and I’m sure you will stay more interested in AS day by day you work with it. Even because I was A.D in 1999 when I began learn about Flash and AS and I was really interested and I changed my profession, … I became a developer.
So, Maybe I wasn’t a good A.D … I don’t know for sure.. It was a longo long time ago.
regards
Segundo
Hi,
May be to better illustrate my example, it could work like computers does (don’t know how exactly how work computers :) ) :
The mother card is tacking the role of the communication between the majors éléments of the machine (video card, cd player, hard disk…). She listen to the cd player and when he display an event information (”I’m open”, “I’m close”, “Here come somme data from the cd…”) she activacte some functions of others majors éléments and give them informations from other éléments, for example “videoCard.treat(dataFromCD)”.
I imagine that each majors éléments have themself there “mother card” witch take the same role for them smollest components, the “mother card” of the cd player when she recieve the order of from the mother card of the computer will do “disk.turn()”… etc.
It is for me the more basic aproach of use of the displaylist and event model but I’m not shure it’s a good use.
An other aproach that I see is to make an element to be able to stock a reference to an other element, than the “mother card” or “parent” in term of as3 will have only the role to connect the two elements. For example in my little question/answer game the parent of the game and the toon will only do “mc_game.asignToon(mc_toon)” an than after that mc_game will not need of here parent to communicate with the toon as he directly know him.
Patrick
…and just a little precision, the “mother card” of cd player listen the “open button” and do door.open(), it is not the mother card of the computer that listen the “open button”, may be the “mother card” of the cd player will dispatch an event “door is open” that the mother card of the computer listen to.
I read about the “hollywood principe” and I don’t know if the example I write is using this principle or if “hollywood principle” is exacltly the inverse, in case I don’t know how to use display list and event model by using “hollywood priciple” ?
Patrick