A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [F8] ClipEvent Handlers question

  1. #1
    Eternal Newbie
    Join Date
    Apr 2006
    Location
    Bitter cold Hell of the crappy NW
    Posts
    392

    [F8] ClipEvent Handlers question

    I don't consider myself really good at anything. AS is one of those. I am not bad at it, having handwritten about 40,000 lines so far, but there is still so much that I don't truly understand.

    Currently I am trying to figure out what is the useful difference between

    Code:
    onClipEvent(enterFrame){
    and

    Code:
    onClipEvent(load){
    I mean, I know the obvious differences, but as far as coding goes I am lost. depending on the need/use of the AS, if I use one and it doesn't work I use the other, but I don't know "why".

    Can some one explain the "why"?

    ~MoN
    If I am wrong, please just correct me and move on.. there is no need for all that pointing and laughing! ~MoN

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    Code:
    onClipEvent(load){ 
    // runs once, when the clip is instanciated
    // useful for setting variables, functions etc..
    count = 0;
    function showIt(param){
    trace("Hello "+param);
    };
    }
    
    onClipEvent(enterFrame){
    // runs continuously at the FPS setting of the movie
    count++;
    showIt(count);
    }

  3. #3
    Eternal Newbie
    Join Date
    Apr 2006
    Location
    Bitter cold Hell of the crappy NW
    Posts
    392
    Thanks Modified. I now have a little better grasp on the why

    ~MoN
    If I am wrong, please just correct me and move on.. there is no need for all that pointing and laughing! ~MoN

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