A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: onRollOver

  1. #1
    poet and narcisist argonauta's Avatar
    Join Date
    Nov 2001
    Location
    Under the bed
    Posts
    2,080

    onRollOver

    i have a question. Can you excecute a rollover and a rollout action at the same time?
    my blog: blog.innocuo
    Sponsored by your mom.

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    On the same symbol?

  3. #3
    poet and narcisist argonauta's Avatar
    Join Date
    Nov 2001
    Location
    Under the bed
    Posts
    2,080
    don't worry i know it s a stupid question. I was just testing something.

    On the same button, you can't.

    Now if you had something like this

    code:

    button.onRollover=rolloveranimation
    button.onRollout=rolloutanimation

    function rolloveranimation(){
    trace("rollover")
    }
    function rolloutanimation(){
    trace("rollout")
    }



    then you could simulate both rollover and rollout events calling both functions. Although, one would execute first the other second, depending on which you called first.

    Now, lets say the rollover and rollout functions trigger some onEnterFrame event of another movieclip. Then only the second function called would work cause the onEnterFrame triggered in that function would overwrite the previous...or you could just mess up everything depending on your code.

    But anyway, if you see, why, even if there was a way, would you like to execute a rollover and rollout event at the same time (in the same button or movieclip), i dont see a good reason. Maybe do that on two different symbols.

    I was just seeing if somebody was going to answer my question, seeing the other one i posted was just ignored (either it was a bit technical, or dumber than this one).
    my blog: blog.innocuo
    Sponsored by your mom.

  4. #4
    poet and narcisist argonauta's Avatar
    Join Date
    Nov 2001
    Location
    Under the bed
    Posts
    2,080
    oh, but this is interesting though. say you got two movieclips in the same frame in the same timeline, each one executing some code everyframe. (so, you d think both actions were started and called at the same time). How does flash execute the code?

    Flash can't execute two things at the exact same time. So one of them must execute first.

    On my example (see flash attached) i have two movieclips with the following code:

    code:

    //var i was initialized before
    onClipEvent (enterFrame) {
    trace(this._name+" "+this._parent.i);
    this._parent.i++;
    }



    well, if they actually executed at the first time, the output should be:

    code:

    instance1 0
    instance2 0
    instance1 1
    instance2 1
    instance1 2
    instance2 2



    but the output is this:
    code:

    instance2 0
    instance1 1
    instance2 2
    instance1 3
    instance2 4
    instance1 5



    also, it is interesting that the movie that has a higher depth (the one that is on top of the other one, or in other words, the last one i copied n pasted) executed first.

    so, the answer i may be wrong, but my answer would be no, two events can not happen at the same time (in flash) cause flash has to process one thing to go to the next one. right?
    Attached Files Attached Files
    my blog: blog.innocuo
    Sponsored by your mom.

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