[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Flash 8 assign rollOver rollOut and onRelease events to multiple mc's

Posted on 2007-10-18
8
Medium Priority
?
1,859 Views
Last Modified: 2008-01-09
Is there a shortcut to add rollOver functions to multiple mc's?
For example I have 12 mc's which each need a rollOver rollOut and onRelease event, is it possible to use a for loop to assign that to them?

Thanks in advance
0
Comment
Question by:unluckynelson
  • 4
  • 2
6 Comments
 
LVL 18

Accepted Solution

by:
Antonio Estrada earned 1500 total points
ID: 20109264
Yes, there is. Let's say that your MovieClips are names "myMovieClip1", "myMovieClip2" and so on until "myMovieClip12".

Here's the code:

for(var i=1;i<=12;i++) {
   tempMc = eval("myMovieClip"+i);
   tempMc.onRelease = function() {
      //do something here
   }
   tempMc.onRollOver = function() {
      //do something here too
   }
   tempMc.onRollOut = function() {
      //do something here too
   }
}

That way, you add it dynamically.

Good Luck

-V
0
 
LVL 1

Author Comment

by:unluckynelson
ID: 20111356
Aaargh!!!! That's absolutely brilliant, if only I had the solution 10 hours before I sat till 5 in the morning copying hundreds of lines of code and changing every line....

Thanks V!
0
 
LVL 18

Expert Comment

by:Antonio Estrada
ID: 20111547
No problem, glad to help :)

-V
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 18

Expert Comment

by:Antonio Estrada
ID: 20157327
¿?

That didn't work for you?
0
 
LVL 1

Author Comment

by:unluckynelson
ID: 20158601
Hey sorry I re-opened this question already you can follow it here...

http://www.experts-exchange.com/Software/Photos_Graphics/Web_Graphics/Macromedia_Flash/Q_22916787.html#discussion

apologies for accepting your answer before I tested it, seems like I simply needed a more in depth answer. But your answer does work, just not with my setup...

So I don't know if we can maybe add this thread to the above? Otherwise I'll re-appoint the points to you V

Thanks again...
0
 
LVL 18

Expert Comment

by:Antonio Estrada
ID: 20159761
Oh pay it no mind, the important thing is that you get the solution you needed, I believe that it can be merged with the other topic, you just need to ask a moderator ;)

-V
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question