dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: addin code to an event

  1. #1
    Junior Member
    Join Date
    Nov 2000
    Posts
    15

    addin code to an event

    Hi! I was wandering about the way I could add functions to a predefined function. I mean... i have a movieClip that has the rollOver event defined... then from a different movieClip I want to "redefine" that rollOver event... but! without deleting the previous one.
    i remember I learn to do something like that in c++... but now I want to do it with out defining classes and subclasses.

    thanx a lot!

  2. #2
    Senior Member
    Join Date
    Jun 2001
    Posts
    199
    I'm not sure what you mean.

    rollOver events can't be placed on a MC, only on a button...so are they buttons that affect a MC in some way?

  3. #3
    Senior Front End Developper
    Join Date
    Dec 2000
    Location
    Montréal
    Posts
    568
    In flash MX,

    you can assign a function to an event

    example

    my_mc.onEnterFrame = moveBall;

    and then later you can reassign another function to the event

    my_mc.onEnterFrame = stopBall;

    or just disable the event

    my_mc.onEnterFrame = null;

  4. #4
    Junior Member
    Join Date
    Nov 2000
    Posts
    15

    addin code to an event

    well excuse me if the onRollover sample was not the best... i just was tring to focus on the real problem...

    I think i dont explain my self quite good... what I need is to add functionallity I.E:
    i have in the librar a movieclip with this AS on the first frame
    movie1.onEnterFrame = function(){
    action1;
    action2;
    action3;
    }

    then in an instance of this MC, i want to define other actionsI.E:
    instanceofmovie1.onEnterFrame = function(){
    action4;
    action5;
    action6;
    }
    !but without deleting the actions1,2,3... just adding the actions4,5,6

    thanx!!!!

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