SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Enthusiast jdriscol's Avatar
    Join Date
    Jul 2002
    Location
    Kalamazoo, MI
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Build a Snow Boarding Game with Flash

    This forum thread discusses the SitePoint article 'Build a Snow Boarding Game with Flash' by Matthew David.

    ..Good article but it doesn't take into account the coding conventions of flashMX. For instance it is suggested that you do not put you code directly into your MCs and Buttons but that all code be contained on layers within the MAIN timeline and target movie clips using dot syntax.

    mymovieclip.onEnterFrame = function() {
    // code
    }

    ..and for a game like this you could use a more OOP approach to your actionscript.

  2. #2
    SitePoint Wizard aaron.martone's Avatar
    Join Date
    Feb 2003
    Location
    Florida, USA
    Posts
    2,322
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I agree. Good read, but I don't see the danger in placing code on Buttons and MovieClips as opposed to placing them on Frames.

    I think if you know the values of both Object EventHandlers and Frame EventHandlers, you'll be all the more wiser to use them where it best befits the nature of your project.

  3. #3
    runat="server" Golgotha's Avatar
    Join Date
    Nov 2001
    Location
    Colorado
    Posts
    2,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Kalamazoo, MI
    wow! That's where I was born

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I agree. Good read, but I don't see the danger in placing code on Buttons and MovieClips as opposed to placing them on Frames.

    I think if you know the values of both Object EventHandlers and Frame EventHandlers, you'll be all the more wiser to use them where it best befits the nature of your project.
    Except for when your movie gets bigger and bigger, it can be a bear to find that small piece of as that needs tweaking among all the symbols on the screen.

    For me at least, I too prefer to leave most all my actionscript in frames and not attached directly to the object. Except for maybe a stray onClipEvent(data) handler on mc I will load jpgs or swfs into due to the annoying problems MX has with that.

  5. #5
    SitePoint Enthusiast jdriscol's Avatar
    Join Date
    Jul 2002
    Location
    Kalamazoo, MI
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ...hehe if I understand your post golgotha that wierd, because I was born in La Junta Colorado.

    The reason you should put your code on the main time is simple, centralization. You know where everything is. Maybe if you were just making a simple spash screen for your web site using the older codeing techniques would be fine and would be more compatable with older versions of the flash player, but If you were making somthing more complicated, like a game, you would find yourself searching though mc after mc looking for the right code while if its all on the main timeline (you can use seperate layers to keep it organized) it's much easier to find and edit. It's whats recommended by Macromedia and is almost necessary if you use a OOP approach.
    "Do you want it with, or without the moustache? .....Too bad."
    J. Driscoll

  6. #6
    Anonymous
    SitePoint Community Guest
    I really like the tutorial, but the .fla file doesnt work with flash 5 and lower.

  7. #7
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Probably was made in MX, so no it won't work in 5.

  8. #8
    Anonymous
    SitePoint Community Guest
    Who is the author of this thing? Cause I think it's JohannesP. (http://www.2-serious.de). He posted this in 2001 on flashkit.com.

  9. #9
    SitePoint Member
    Join Date
    Feb 2004
    Location
    England
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This was created by Matthew David; and as afore mentioned placing your code within a frame on the timeline or centralising it in an external .as file for compilation at export time is OOP best practise


Bookmarks

Posting Permissions

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