Search the web
Sign In
New User? Sign Up
FLASHmacromedia · Moderated Flash discussion group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Applying the same basic action to multiple movieclips   Message List  
Reply | Forward Message #59708 of 59817 |
RE: [FLASHmacromedia] Re: Applying the same basic action to multiple movieclips


How are your 50 movieclips created? Have you put them on stage manually or have
you created them by a code like this:
myOR_mc = map.createEmptyMovieClip("OR"+i, map.getNextHighestDepth());

It is easier to create the child movieclips with code, especially when they
occur in big numbers. Create a loop around the createEmptyMovieClip with i from
0 to 50.
Within the loop use the

myOR_mc.id=i;
map["OR" + i].onrelease=function()
{
my_xml.load("OR" + this.id + ".xml"); //not this.i, my mistake
}
Doing it this way, you only have to write the onrelease function ones instead of
50 times

If you don't get it work, you can always send me the code. The I can take a look
at it.

Kind regards,
Karen



To: FLASHmacromedia@...: bushidodesigns@...: Tue, 16
Dec 2008 18:20:57 +0000Subject: [FLASHmacromedia] Re: Applying the same basic
action to multiple movieclips



Hi Karen,Unless I'm misunderstanding you, I would still have to write out an
action for each state that way like:map["OR" +
i].onRelease=function(){my_xml.load("OR"+this.i + ".xml");}What I'm trying to do
is write a single function for all 50.--- In FLASHmacromedia@yahoogroups.com,
karen berx <irowake_iruka@...> wrote:>> > add a variable to each of your
childmovieclips> map.WA.id=i;> > Then you can write your function ones as:>
map["WA" + i].onRelease=function()> {> my_xml.load("WA"+this.i + ".xml");> }





_________________________________________________________________
Send e-mail faster without improving your typing skills.
http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_speed_12200\
8


[Non-text portions of this message have been removed]




Tue Dec 16, 2008 9:05 pm

littleporpoise
Offline Offline
Send Email Send Email

Forward
Message #59708 of 59817 |
Expand Messages Author Sort by Date

I've got 50 child movieclips inside of another movieclip. When you click on one, it swaps out an xml file. The name of the child movieclips and the xml docs...
Dean Hamack
tactics2337
Offline Send Email
Dec 16, 2008
8:51 am

add a variable to each of your childmovieclips map.WA.id=i; Then you can write your function ones as: map["WA" + i].onRelease=function() { ...
karen berx
littleporpoise
Offline Send Email
Dec 16, 2008
2:11 pm

Hi Karen, Unless I'm misunderstanding you, I would still have to write out an action for each state that way like: map["OR" + i].onRelease=function() { ...
Dean Hamack
tactics2337
Offline Send Email
Dec 16, 2008
6:21 pm

A coworker of mine figured it out using something like this: // function to set color to active state var setActive:Function = function() { this.myColor = new...
Dean Hamack
tactics2337
Offline Send Email
Dec 16, 2008
10:30 pm

How are your 50 movieclips created? Have you put them on stage manually or have you created them by a code like this: myOR_mc =...
karen berx
littleporpoise
Offline Send Email
Dec 17, 2008
10:57 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help