Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,172
    Thanks
    19
    Thanked 65 Times in 64 Posts

    Flash movie clip classes.

    I'm working on a flash project where I have a bunch of different movie clips that should all have the same behavior but the movie clips themselves are different.

    I have 15 different movie clips with any 3 at a time being displayed. They should all have the same onclick event - (basically they change colour depending on which colour is selected)

    In the mockup I did I had to create a separate class for each movie clip that extends a common based class (that extends movie clip) - is that really how its supposed to be done? It wouldn't let me set the same class for each of them.

    Also, what is the best practice way of passing data between objects? I'm not happy with the way I'm currently doing it.

    Palettes (also a movie clip with a custom class) need to know which object is currently selected and objects need to know what the currently selected palette is.

  • #2
    New Coder djpaul1963's Avatar
    Join Date
    Apr 2012
    Location
    Athens GR
    Posts
    74
    Thanks
    0
    Thanked 8 Times in 8 Posts
    I would use the same event handler for all and do a switch according the currentTarget of the fired event.
    As for the data exchange, if a global variable is not enough for what you need to do, use messages to send whatever you want from a movieclip to another.


  •  

    Posting Permissions

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