Solved

Using Flash Depth Manager Across Multiple Scenes

Posted on 2008-10-22
8
923 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
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…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

757 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

21 Experts available now in Live!

Get 1:1 Help Now