Solved

Using Flash Depth Manager Across Multiple Scenes

Posted on 2008-10-22
8
924 Views
Last Modified: 2013-11-11
Hello All,

First time poster with a Flash/Actionscript question.

I have a Flash app which displays information as pop-ups on movie-clip mouse-overs.  It is a map with location dots - mouse over a dot, get info about that location - mouse out, the info disappears.

When I started this job and inherited this file, it was set up as buttons with empty Up frames, and the info graphic in the Over/Down frames.  The problem with this was the map dots had to be placed on a separate layer than the buttons so they would be hidden by the Over popup.  Otherwise, the popups appeared behind neighboring dots and couldn't be seen.  Also, as we added/removed locations, I was having to add a visible dot on one layer and an invisible button exactly over it on another layer.  

I resolved this by converting the buttons to movie clips with Rollover and Rollout actionscripts to pop up the info.  That allowed me to completely remove the layer of plain dots.  Each movie clip instance contains its own dot and simply changes frames within the clip to display the info.  Works great.  However, depending on which layer the clip was on, they were being hidden by neighboring movie clip dots.  

I got around this, I thought, by invoking the DepthManager class in the root timeline and using it to position the active clip to the top depth on mouseover and back to the bottom depth on mouseout.  But, because the file is set up in scenes allowing users to isolate regions (All, SouthCentral, MidWest, etc.) I still have one problem.  

If I mouseover a California dot in the All scene, I get its info.  Mouseout, it disappears.  Great.  Then change scenes to MidAtlantic, or Northeast, or anywhere besides West, and the California dot I moused over is still visible.  Each scene actually contains only the dots for its region, but something about the shuffling algorithm in the Depthmanager makes the dots from one scene visible in another once they have been invoked.  I need a way to clear the Depthmanager layers each time I move between scenes.  

I have searched high and low for info about this, but the Depthmanager doesn't seem to be thoroughly documented, and I am having a hard time finalizing this.

Am attaching the actionscript to invoke Depthmanager on the root timeline (on the root timeline within each scene - is identical, could this be problematic?) as a code snippet, along with a snippet from one of the movieclip instances.

I can provide the .FLA file zipped up if needed.  Just let me know how to post a link to it here.

Thanks in advance for any info.
---From Root---

import mx.managers.DepthManager;
 

mcFocus = function(n){

  this[n].setDepthTo(DepthManager.kTop);

}
 

mcUnFocus = function(n){

  this[n].setDepthTo(DepthManager.kBottom);

}
 

---From Movieclip---

on (rollOver) {

 	_root.mcFocus("MankatoCYclip");  // Bring clip instance to top via Depthmanager

	this.gotoAndStop("On");  // Go to internal frame with info displayed

}

on (rollOut) {

	this.gotoAndStop("Off");  // Go back to internal frame with info hidden

 	_root.mcUnFocus("MankatoCYclip");  // Send back to bottom via Depthmanager

}

on (release) {

	getURL("http://www.wherever.com","_blank");

}

Open in new window

0
Comment
Question by:InterMountainMgmt
  • 3
  • 3
8 Comments
 
LVL 39

Expert Comment

by:blue-genie
ID: 22787587
add a .txt extention to your fla and zip it - let's have a lookie look.
0
 

Author Comment

by:InterMountainMgmt
ID: 22788467
here's the source

IMM-FlashMap.zip
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 22873839
hey sorry i didn't get back.
i've downloaded the files now and had a fiddle, but no joy.
I've not worked with DepthManager myself, i use the good ol swapDepths.
I'm assuming (did some tests but can't 100% verify) - that because you've got instance with the same name, i.e. the files in All and then the other sections, there might be conflict.
would you be willing to change your file structure and take the items out of scenes?
i personally hate scenes and in my experience it often results in funny things happening.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:InterMountainMgmt
ID: 22877306
blue-genie,
I'm not particularly attached to the scenes-structure.  That's just how I inherited the file, and I haven't had time to restructure it.  I'm not even sure I would know the easiest way to do so.  
I'm assuming it would involve linking region visibilities to the region-selection buttons across the bottom.  Whatever it is, I need it to provide an easy way to add new properties - not a lot of customized AS buried within clips within other clips.  Cutable-pastable AS where I can change just an instance name is preferable for time reasons.
Any suggestions or code hints for implementing visibility/functionality of the regions via the buttons rather than scene-changes would be highly appreciated.
Thanks - IMM.
0
 
LVL 39

Accepted Solution

by:
blue-genie earned 500 total points
ID: 22883269
i would turn the whole thing(map) into a movieclip with a few frames.
1st frame have All stuff
and then just cut and paste the stuff from each scene into subsequent frames.
then NorthWest will goto frame 2 of that clip etc.
see how the Depth manager handles then.


0
 

Author Closing Comment

by:InterMountainMgmt
ID: 31508784
blue-genie, thanks for pointing me in the right direction.  I ended up placing my regional groups into regional movie-clips and putting them all in the first frame.  That allowed me to turn region visibility on/off involving the timeline.  I am still working on the DepthManager, but I have the worst of it worked out.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now