Solved

Using Flash Depth Manager Across Multiple Scenes

Posted on 2008-10-22
8
928 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Flash Player White Screen Facebook 5 799
Array is not working ( AS2 ) 4 170
Removing Flash from Website 6 78
flash professional 3 44
This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
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 motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

710 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