Link to home
Start Free TrialLog in
Avatar of CSHTech
CSHTechFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Change depth of a movieclip on mouse over in Flash CS4

Hi,

I've got a Flash CS4 file that has 13 photos enlarge using a tween animation when you rollover them. I've got that working perfectly, however I don't know how to dynamically change the depth of the photos as they enlarge as I can still see thumbnails on top of the enlarged photo.

I've done some research into this and found that I need to update the "setchildindex" and found some solutions in the experts exchange knowledgebase - the problem I have is I'm not a Flash developer and have no idea on how to implement the "setchildindex" or even adapt the code found in the solutions. I know how to use "stop();" and that's it!

Please if anyone can take a look at the .flv file attached to this post and see if they can do anything, I would really appreciate it, thanks very much.
Overcliff-Gallery.fla
Avatar of Inderjeetjaggi
Inderjeetjaggi
Flag of India image

Avatar of CSHTech

ASKER

I'm afraid it doesn't help, nothing on there that I need. I have no issue in finding solutions, its just the solutions I do find explain the setchildindex like were all developers, I need something step by step if possible.
CSHTech,

You can use this in your rollover function -

setChildIndex(event.target as MovieClip, numChildren);


AreDubya

CSHTech,

Whoops. Didn't see your above comment before I posted that. I will take a look at your fla when I have a minute.

AreDubya
Avatar of CSHTech

ASKER

1. Do I add this to a frame in the movieclip, like frame 1?

2. I copied and pasted it into a frame and I get an error 'Access to undefined property event'

Thanks for all the comments so far!
ASKER CERTIFIED SOLUTION
Avatar of AreDubya
AreDubya
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CSHTech

ASKER

AreDubya, Amazing thanks very much! I'll accept that as the solution! Really appreciate your help.

Without sounding ungrateful, there is one tiny little thing I wanted to ask, is there any way other than moving the mouse off the enlarged photo to begin minimizing it again?
Avatar of CSHTech

ASKER

I've got it, played with the code and can now click to minimise a photo! :D

Again, thanks AreDubya!!
Anything way want, just change the event listeners. I was thinking clicking may be a better way to go anyway....

kitchen_mc.addEventListener(MouseEvent.MOUSE_DOWN, goFront);

etc, etc.... So, I changed this version to use clicks, look at the eventListener code, and use any event you want.

Glad this helped!

AreDubya

Overcliff-Gallery.fla