A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: some general question

  1. #1
    Junior Member
    Join Date
    Sep 2007
    Posts
    11

    some general question

    So this is for ANYONE to answer. I've noticed that a lot of people program their actionscript differently while reading tutorials. What is this about? Are what I am seeing the differences of actionscript 1.0 and 2.0 or are they different techniques? I also saw one person put the code for ball gravity inside the ball and I saw someone else put it in the main movie and said they were trying to make it more "object oriented"? If anyone and everyone could help clarify these things for me it would be great.

  2. #2
    [Horse Thief] gotoAndCrash's Avatar
    Join Date
    May 2007
    Location
    NW, USA
    Posts
    576
    I've heard that "Best Practices" says to keep all your code in one place. I would say that having code sprinkled all throughout an .fla is not the best way to do things. For example, I've gone back through some of my early work & thought "where the hell is this function being called?!" & "Where are these variables being set?!?"
    Now I (mostly) keep all my code in the first frame. If you've ever tried to buy a Flash template, you know what I'm talking about...
    1 Infinite Loop, Cupertino is a portal of Hell.

  3. #3
    Developing For Dunkets mneil's Avatar
    Join Date
    Mar 2007
    Location
    Lincoln City
    Posts
    2,156
    Some of what you see is the difference between older versions of flash and newer ones. There are a ton of tutorials out there written for flash 5. And, most of those tutorials will still work with versions up to flash 8; cs3 not so much. The difference between putting code on an object and putting code on a layer is user preference. Some things are easier to put on an object, others on a layer. But, like gotoAndCrash said, it's considered bad practice to put code on an object. Code on layers is more versatile because they can handle a larger scope than code on or even in an object. Plus, its much easier to find everything.
    http://code.mneilsworld.com/
    Text Effects | Bubbles | Dynamic Resize
    4 weeks , 20 papers ... thats 2 dollars .....Caassshhh!

  4. #4
    [Horse Thief] gotoAndCrash's Avatar
    Join Date
    May 2007
    Location
    NW, USA
    Posts
    576
    speaking of CS3, & ActionScript 3, you're no longer even able to put code on an object. Of course you can still put it in an object (on a frame), but it won't allow code on objects.
    What that says to me is "break the habit"
    1 Infinite Loop, Cupertino is a portal of Hell.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center