OOP And AS 3.0, Something That Confuses Me ALOT!

Hello everybody, there's something that's been on my mind for quiet a while now, and everytime I think about I get confused even more lol. Anyway, this might sound stupid to most of you but I donno, I just don't get it.
There are many flash developers out there who are building flash applications using OOP, some of them provide their scripts for download and that's good. The problem is that when I download those files, I have no idea how to incorporate them into my project. The files usually contain the fla, the swf, class files inside a package, and the document class. All of this looks nice but the confusing part is how to use it in my project! I have some questions and hopefully when they're answered I won't be confused anymore:
1. Suppose I downloaded two different applications, each has its own classes and its own document class. I customized them to my liking and everything and now it's time to use BOTH of them in my project. How am I supposed to use both document classes in one? Do I make my own document class, import the classes of both projects to it, then copy the codes of the document classes into mine? Or is there some other way of doing it?
2. Can I use OOP and timeline code in the same project? Like some big application could be used in the project using the OOP/Classes approach, while other simple stuff like navigation could be coded in the timeline. But usually isn't the document class a replacement for the main timeline of my flash file? Hmmm confused as you can see...
That's all I could think of for now... I would appreciate anyone that answers these questions for me because this confusion is really bothering me... Thanks in advance

Technical books by nature are disconnected in many ways from realities of every day tasks. It is especially true, in my view, in Flash/ActionScript. In many case authors treat Flash development the same way they would relate to an enterprise level application. Many authors come not from design but development background in other stronger languages (Java, C++, etc.) and computer science. This is, actually, great for it is about time Flash/ActionScript gets a status of a “serious” development tool.
Nevertheless, I see Flash development as a very special set of skills and, in some instances, as something that needs an artistic talent and imagination as prerequisite. In a lot of cases Java/C++, etc. developers, no matter how genius they are, just cannot hold entire picture together. Flash developer must be able to coordinate sometimes humongous amount of use cases and forks in order to implement the final vision. As a visual result oriented process, Flash development deviates toward immediate practical needs more than in the direction of satisfying abstract programming concepts and may legitimately go against conventional structure because structure is getting in the way.
One of the important aspects of products developed in Flash that is often overlooked is that they must be very lean. Even with advances in bandwidth application loading speed and financial implications are still tangible. I saw many awesome, smartly and correctly architected cool looking Flash applications that resulted in huge multi-MB blobs that run their appeal to the ground for a single reason of slow loading.
Another thing that often makes little sense is design patterns. Don’t take me wrong – I got very useful ideas how to structure my applications from design pattern concepts. But what really annoys me is when design patterns become the goal – not a tool. I see this propaganda for DP went as far as making novices in AS to attempt learning patterns and custom frameworks before getting a clear idea of how to add event listener to a button. This is totally detrimental to learning and creativity IMHO. I hope you will not fall into this pitfall. Just for the safety reasons, though, you just should learn how to say “Design patterns are invaluable” with a wide smile because odds are huge you will encounter a militant interviewer who will kill your chances because you were not fast enough to scream “MVC!” This is a trade off of dealing with unimaginative programming dictators who made career by repackaging someone else’s ideas and convincing CTOs that JSON and JQERY are the best inventions after beer.
I am available, though, to admit that this may be my combative ignorance talking and in a year I might post a Mao Zedong quotations book-like proclamation that design patterns are the only way to go. But today I rather sit in the center of Pyongyang in a silent protest against Kim Jong Il’s drinking habits rather than deal with proponents of DP.
So, don’t listen to anyone including me. Just keep in mind that some humans like to drink warm vodka.
There is another brainwash that penetrates virgin minds. People say that if you use timeline – it is not OOP. I think it is a total BS. When one writes code on timeline – he/she declares and instantiates variables and classes, uses functions, etc. – all these things ARE objects. So, why is not it OOP? Who said that only writing classes is OOP?
I am saying that even though I practically don’t use timeline coding any longer - not for political but for purely practical reasons. And yes, a newly awaken geek in me loves cleaning and refactoring my code. We all loose our purity at some point.
OOP is grand and it has proven its usefulness and dominance. But even then one encounters periodically very smartly substantiated cases against OOP in defense of procedural programming. Again, remember diluted ethanol at room temperature preferences.
In other words, as Kennedy said, it is not what I can do for encapsulation but what encapsulation can do for me.
My point is that unless one sincerely internalizes an OOP concept and see its usefulness – one cannot utilize it correctly anyway?
Again, to me encapsulation, for one, is extremely useful and I love to do things in as abstract manner as possible for a single reason – I am lazy and I love to reuse things. But I also want to be in control and I want to have a very clear idea how this staff that I reuse works.
There are applications whose code is worth incorporating into your projects and others that are worth emulating by writing your own code after just looking at what it does as a result for it is easier that repainting Sistine Chapel to the specs. More often than not, reverse engineering takes longer than writing code from scratch. With very few exceptions someone else’s code is not sufficient at best. Let alone that the code is applied to a limited number of use cases where your vision is not represented.
For instance, TeewnLite/TweenMax is a very useful package. It is tightly focused and accomplishes common and often used functionality. The best thing is that you don’t need to tweak it – it is totally cooked. It can be used in many different environments and applications. Another positive example is Papervision3D. These two things are strong and sufficient to stand on their own two feet.
But if you get an FLA with packages attached – you probably need to relate to it as a suggestion that may help you to come with architecture quicker and allow for pasting code snippets but, at the end of the day, your thing is almost always is different.
This brings us to your questions (finally).
Document class is sort of a needle that pulls all the thread into the tapestry. One of its purposes is to initialize the application and make sure that all these things that one wrote are in order. As such – it is most probably manifests application’s architecture in a very tight manner. “Tight” is a keyword for once doc class is taken out of context it renders useless.
For instance, you have three applications that you just love to the point of you dreaming about them at siesta. These programs are slide show, video player and Mona Lisa rotating in 3D space in an insane coupling with Saddam Hussein’s photo taken while he was wistfully defecating in the hot winds of Babylon oasis.
Now you decide that your video player should have slide show’s thumbnail navigation and transitions like relationships between the beauty and the dictator. Combining document classes most probably will not accomplish anything and you will have to dig deep into the code in order to fuse these three breathtaking features. Also, even if there was a way to fuse these three doc classes – because they use their own packages the size of your application will be three times bigger than it is supposed to be for all of them import their own mucus and litter memory with the staff you don’t use.
Q2.
I hope that it is clearer now that if you use Flash IDE and its compiler – you are better off with a document class. Otherwise, you will need to find another way to start. In case of other compilers you have another way to initialize.
Q3.
If you      use a movie clip only once and code for this mc pertain to this mc only – there is no practical difference between a timeline code inside this mc or      writing a class and attach it to mc. But, more often than not, you will discover that several symbols in your library share a lot of      functionality. So, if you create a class that combines these commonalities and then extend it – you will end up with a slimmer code as well as with a      smaller swf. I like writing classes also because all my code is in one place – not in two - timeline and .as files.
You ARE using OOP approach if one believes anything I say. I suggest you delegate as little as possible to doc class. And yes, you can view doc class as a rightful representative of timeline.
You know what I mean?
Now I have to find this sauce pan my cleaning lady puts into different locations every time she tidies the kitchen (I feel like a bloodhound in training) and, hopefully, eat the necessity of which (despite the offensive nature of metabolism) has transpired from all this low glucose level / manic phase delirium I typed. And NO, I don’t like warm vodka.

Similar Messages

  • HT4528 im trying to download an app on my new ios 7 update and it popped up something that said i need to accept to the following to procede download so i clicked on that and it popped up the page and when i tried to click send me an email to accept it it

    i tried to download an app on my ne ios 7 and something popped up that said i needed to accept to the following so i clicked on that and the page popped up and when i tried to click on the button that said send email to accept it wouldnt let me click on the button and now i cant download any apps on my phone

    There must be a problem with the app store right now as a number of people seem to be having this problem right now.  Try purchasing it using iTunes on your computer, accept the terms and conditions there, then either sync it to your phone or download it on your phone as a past purchase (http://support.apple.com/kb/HT2519).

  • Vlans and KVM; Is there something that I am missing?

    So I have been playing around with Vlans with KVM and I came across an issue thats boggling my mind.  The solution is probably so simple that its stupid.  But none the less I am hoping someone can set me straight.
    #First I created a bridge
    brctl addbr br99
    #Then I attached two virtual machines to this bridge.  Basically I am using the virtio driver and attaching directly to br99 for each virtual machine.  If I set #up the eth0 device in each machine on the 10.11.0.0/24 network, they can easily ping each other.  No problems here.
    #Next I remove all IPs from the eth0 device in each virtual machine.  I then set up two vlan interfaces on each virtual machine; Vlan 10 and Vlan 20
    ip link add link eth0 name eth.10 type vlan id 10
    ip link add link eth0 name eth.20 type vlan id 20
    #I add IPs to each vlan interface
    (virtual machine 1): ip addr add 10.11.0.2/24 dev eth.10
    (virtual machine 1): ip addr add 10.11.0.3/24 dev eth.20
    (virtual machine 2): ip addr add 10.11.0.4/24 dev eth.10
    (virtual machine 2): ip addr add 10.11.0.5/24 dev eth.20
    #So the even numbered IP are Vlan 10 and the odds are vlan 20.  From both machines I can ping every address.  No problems.
    #Next I delete the eth.20 interface on Virtual Machine 2 (which is 10.11.0.5)
    ip link del dev eth.20
    #Which means that Virtual Machine 2 is now only a part of the vlan 10 network; Its no long a part of the vlan 20 network
    #From virtual machine 2 I can still ping 10.11.0.2 because that is in vlan 10 on virtual machine 1.  The even number IPs can ping each other.
    #But if i ping 10.11.0.3 (which is on virtual machine 1 vlan 20) from virtual machine 2 which is only on vlan 10, it STILL pings!
    #How is this possible?!
    #Forwarding on each virtual machine is set to off.
    #What am I missing?  I am under the impression that a ping from virtual machine 2 (which is ONLY on vlan 10) cannot ping 10.11.0.3 (on virtual #machine 1) because 10.11.0.3 is on vlan 20.
    #Can someone set me straight?

    Hey Guys,
    Thanks for you responses!  Although I still dont seem to be getting this to work correctly
    I did try:
    ping -I eth.20 10.11.0.2     (10.11.0.2 being on the vlan 10 network on the other virtual machine)
    But it still pings!
    If I do a tracepath from virtual machine 2 which is only on vlan 10 to the both IP addresses on the other virtual machine (both vlan 10 and 20), the tracepath output is the same for both; meaning the first hop in the tracepath is the 10.11.0.4 which is on vlan 10 on virtual machine 2.  And of course the next hop is whatever IP im pinging on the other virtual.
    Also there are no routers involved here.  Just two virtual machines connected to a bridge.  The bridge is connected to nothing.  Although the bridge does have an IP address of 10.11.0.1.  But if use just the vlan interfaces on each virtual machine, none of them can ping 10.11.0.1 because its not on any vlan, which is to be expected.
    Im stumped!

  • Oops, you are trying to do something that you are not allowed to do.

    I decided to try my hand at creating a theme. I filled out all of the forms, uploaded the images (that were the appropriate sizes), selected the colors, was happy with the preview and clicked 'Submit'. The following screen said, "Oops! You are trying to do something that you are not allowed to do." I clicked the back button and re-tried, then received the error message that the theme name was already taken. I re-named it, re-submitted and went back to the 'oops' screen. This cycle repeated no less than 20 times. I tried theme names that were so off the wall, there's no way that all of them were taken. I think that it was failing due to whatever error it was encountering.

    Hi!
    Could you please provide the link to where you are experiencing this issue? The issue you are having seems to be out of bound for this support forum.
    Thanks!

  • Help !!!!!!!!!! I upgrade my itunes to 10.5, But, my cpu start to reach 100%, and I cant connect to Itunes store! Morever , I did try something that ppl saying delete all program and reinstall again! It dont work to me!

    Help !!!!!!!!!! I upgrade my itunes to 10.5, But, my cpu start to reach 100%, and I cant connect to Itunes store! Morever , I did try something that ppl saying delete all program and reinstall again! It dont work to me! It drive me CRAZY!!!! HELP PLEASE HELP!!!!

    It took about an hour to upgrade my iphone. You're also left a couple of times with a blank screen on the iphone whilst it does things in the background which is a bit confusing. Suggest you wait - it starts doing things again (like reload your apps and then your photos etc) after you think it's finished. It's finished only when it says it is.....

  • My Ipad did work on my wireless at home and works on other wireless but no longer at home. My IPhone works at home and others can use the wireless Confused that it did work and now does not?

    My Ipad did work on my wireless at home and works on other wireless but no longer at home. My IPhone works at home and others can use the wireless> Confused that it did work and now does not?

    Look at iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    Additional things to try.
    Turn Off your iPad. Then turn Off the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    On your iPad go to Settings > General > Reset > Reset network settings and see if that enables you to connect.
     Cheers, Tom

  • I was sycing my ipod with my computer to get a new album and itunes prompted me saying that there was a previous account for the ipod or something and if I should carry on and deletle it or cancel the sync. I wanted the album so I clicked carry on an

    I was sycing my ipod with my computer to get a new album and itunes prompted me saying that there was a previous account for the ipod or something and if I should carry on and deletle it or cancel the sync. I wanted the album so I clicked carry on and delete the account. When I checked my ipod afterwards all almost all of my music was gone exept for what I had just downloaded. This was thosands of songs that I had carefully picked over the years and now they are all gone. Someone please help me!!!

    Get all that music back in itunes and sync again.

  • Hi, I have a Power Book G4 Tiger 10.4.11 and my problem concerns iTunes 9.2.1(5). I have changed my Apple ID and password recently. Since that, I am told when I try to buy something in iTunes Store that my "session has expired". Where does this come from?

    Hi, I have a Power Book G4 Tiger 10.4.11 and my problem concerns iTunes 9.2.1(5). I have changed my Apple ID and password recently. Since that, I am told, only when I try to buy something in iTunes Store, that my "session has expired". Where does this come from? What should I do to solve this problem ? I would greatly appreciate your help. Thank you in advance.

    Hi, I am khonthaï. I solved the problem thanks to JHdeVilliers's post on 4 Dec. 2011: I removed all cookies in Safari and it worked immediately !!!

  • I have an old file with an .A4P video from 1999. I don't own any Adobe products (and don't really want to buy any). I just want to be able to convert the file to something that I can actually view. Any help?

    I have an old file with an .A4P video from 1999. I don't own any Adobe products (and don't really want to buy any). I just want to be able to convert the file to something that I can actually view. Any help?
    I was a kid when I made a documentary for a school project. I've been trying to figure out how to retrieve the file. 4 years ago, I was able to get the files off the Iomega Zip drive (finally), but I now see the file is saved as a .A4P. There is also a file saved as a .PKG as well, but I don't know how to open this with my Windows 8 COmputer.

    .a4p is an Authorware v.4 (Windows) project.
    Interesting you have it as a .pkg...usually that's a published-on-a- Mac extension, if I recall.
    At any rate, can you put the file up on a Box, Dropbox, FTP, etc...and send me a URL?
    I should be able to published it so you can view the project (it would be an .exe).
    It can't be converted to anything though - not without manual effort.

  • HT4623 My iPad 2 is stuck on a black screen that has the iTunes symbol and a charger that I'm guessing means "plug into iTunes". I did so and then waited four hours to download something. And now it is saying that its going to update my iPad but it isn't

    I clicked the button in my setting thatz is saying "software update iOS 6.1.2. It turned off and now My iPad 2 is stuck on a black screen that has the iTunes symbol and a charger that I'm guessing means "plug into iTunes". I did so and then waited four hours to download something. And now it is saying that its going to update my iPad but it isn't working. I tried to "update" twice. I am VERY ANNOYED beczuse the last time i updated it, it just turned off and i didnt have ot plug it in or anything. WHY IS IT DOING THIS.....?????? My ipad will not turn on or anything. Help me FIX THIS!!!

    hi Kinney. last hour, i update my ipad 2, then im having the same problems as u. im also hoping people can solve this issue.

  • Use... I realized that i spent my 27 years for using (fixing) computers. Because the Mac was perfect. After iMac, i was really fine with my computer... But after something, that doesn't bother me, happened. The screen started to get cloudy and black... An

    Hi...
    My name is Turgay and have been using computer since 1982... 2 years ago, because of my friend's advice, i bought an iMac... It was the first Mac that i use... Till that, i was using normal PC's...
    I bought an 24" iMac on July 2009 and started to use... I realized that i spent my 27 years for using (fixing) computers. Because the Mac was perfect. After iMac, i was really fine with my computer... But after something, that doesn't bother me, happened. The screen started to get cloudy and black... And it increased. Because of this i took my iMac to your authorised distributor http://www.bilkom.com.tr...
    They changed my screen but in 2 months it happened 3 times and i wanted them to change my iMac with new one, under customer laws... In our country, the device must be changed with new one if the same problem occurs in 3 months. Because i know the customer satisfaction of Apple, i didn' worry about it but Bilkom refused my will... I spoke with them for 2 months but nothing happened, they just told me, it' not our problem.
    Because of this speech, i sued them on June 2011... Last week, i won the case but just for the return of invoince... It costs 3.200 Turkish Liras (1.800$) and there's no 24" iMac unused... Bilkom again refused to give me an iMac... I thought that Apple's customer satisfaction can't be like this... I didn't write anything to Apple till now but if i can't get an iMac, i must return to normal PC after 2 years... And i don't want that... I offered an iMac 27" with core i7... No matter Bilkom accepts or not, they don't care of me... I'm a customer, they should do... I've never seen such a like company. I hope the real Apple will help my problem and save me from Bilkom...
    Waiting for your reply... Thanks and regards...
    Turgay Kala
    General Manager

    Unfortunately, you are not communicating with Apple here - we are all other users volunteering our time to help with technical problems.
    Here is a list of Apple contacts; there is no email address  - you will need to write a letter to their corporate headquarters or call them:
    http://www.apple.com/contact/
    Although, it appears that your problem is with a third party store and that you have won in court - did you get your money back? 24" iMacs have not been made since 2009 or 2010. Now there are 21" and 27" iMacs.

  • Every time I click on something in GarageBand and error message pops up that says "Error code 25974 was returned by the Audio driver." How do I fix this problem?

    Every time I click on something in GarageBand and error message pops up that says "Error code 25974 was returned by the Audio driver." How do I fix this problem?

    Every time I click on something in GarageBand and error message pops up that says "Error code 25974 was returned by the Audio driver." How do I fix this problem?

  • Just updated I pad 2 and some of my apps are dim and say waiting Is that something that takes a long time or does it mean something didn't work

    Just updated my I pad 2 and some of my apps are dim and say waiting. Is this something that takes a long time or could something be wrong?

    That means they are in the queue to be updated.
    If everything is working it will depend on the speed of your wifi connection as to how long it takes.

  • TS1363 My father in law decided to clean up my computer and accidently wiped off something important(dont know what).He then took it away and said he would get it fixed.When he brought it back he said that everything was back on  but I needed to install i

    My father in law decided to clean up my computer and accidently wiped off something important(dont know what).He then took it away and said he would get it fixed.When he brought it back he said that everything was back on  but I needed to install itunes,Ive installed the latest version and the quicktime.
    It seemed to have worked ok and all of my songs are there but when you try to play them, they just dont play.
    Ive tried putting a cd in and that wont read or play.
    Ive gone on to the itunes store and tried playing a song there,when I click on the play button the blue circle activates but just continues in a clockwise rotation but doesn't play.
    I have a old ipod,my wife and I have iphone 5s and a ipad mini.
    I am affraid to plug them back into my computer until I sort the problem out.(they had been plugged in before this happened and worked fine.
    HELP PLEASE
    Scott Hodson

    Do you memeber the complete wording of the error message?
    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iPod fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar

  • I deleted my Iphoto and need to get it back! I bought this mac book off my sister and have none of the install disks. If there a download or something that I can get to reinstall it?

    I deleted my Iphoto and need to get it back! I bought this mac book off my sister and have none of the install disks. If there a download or something that I can get to reinstall it?

    Depending on the age of your machine and the version of iPhoto, you may be able to download it from the App Store - but you'll need her account details to do so.
    Other than that you'll need to purchase it on the App Store.

Maybe you are looking for

  • SQL Database replication between Primary and DR site

    Hi, We are setting up a DR Site, for our Production SAP system. At present the curren setup for Production SAP system are as follows. SAP ERP 2005 (SAP ECC 6.), ABAP+JAVA on Windows with MS SQL Server 2005. Data are stored on SAN and SAP installed on

  • Apple wireless keyboard, no battery logo always blinking

    Hello, I just got my battery changed for my apple wireless keyboard. Even if i replace the battery again, the issue start again. The not battery logo is always blinking every 5 seconds which is terribly disturbing. What could be the issue about it ?

  • Can I invoke applet from servlet

    Hello there, I was wondering whether I can call an applet in a servlet as follows: - out.println("<APPLET code=\"Main_Interface.class\" width=850 height=800></APPLET>"); I tried the above line but the applet could not be loaded (Main_Interface.class

  • SCCM 2012 Client - Manual Installation Error

    Hi, I am trying to install SCCM client manually on few of the machines that have Windows 7 OS. The installation is failing with the below error: Failed to get client version for sending messages to FSP. Error 0x8004100e BITS job creation failed with

  • Intrastat declaration for Italy 2010

    Hi, I'm writing to ask some information about legal change published by Italian tax authority for Intrastat declaration: how it's possible to include services in Intrastat? How to define "service items" to include it in Intrastat? I saw the published