Go Back   CodingForums.com > :: Client side development > Flash & ActionScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-24-2012, 12:48 PM   PM User | #1
NancyJ
Senior Coder

 
NancyJ's Avatar
 
Join Date: Feb 2005
Location: Bradford, UK
Posts: 3,162
Thanks: 19
Thanked 65 Times in 64 Posts
NancyJ will become famous soon enough
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.
__________________
http://www.hazelryan.co.uk
NancyJ is offline   Reply With Quote
Old 06-25-2012, 01:16 AM   PM User | #2
djpaul1963
New Coder

 
djpaul1963's Avatar
 
Join Date: Apr 2012
Location: Athens GR
Posts: 65
Thanks: 0
Thanked 8 Times in 8 Posts
djpaul1963 is an unknown quantity at this point
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.
djpaul1963 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:38 AM.


Advertisement
Log in to turn off these ads.