Losing actions when accessing swf through loadMovie in Flash MX

Hi! I am using Flash MX to build a website. I am completely trying to learn as I go, so sorry if I don't use the correct terminology!
I have built it so that the main page only has main navigation on it, and then there are 3 blank movie clips in which I do loadMovie, and separate swf files then load for the main content, second and third levels of navigation. I hope this wasn't a stupid move, but I was hoping it would save time if I need to change content down the road.

So, my problem: on my second and third levels of navigation, I have built horizontal menus that have arrows on either side and when you rollover the arrows the menu moves left or right. So it works perfectly when I do Publish Preview when I only have the file open for the navigation, but when I Publish Preview the main page, the arrows do nothing. Is there something I am doing totally wrong, or is this not even possible to do?

I am sure you need to look at some code or files or something, but I will wait until you ask for them because I am not sure which parts are vital, or how to upload files, so just give me direction on what you need. Thank you SO much for your help, and I hope I explained this in a halfway decent manner!!
Thanks!
plundquistAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ZefferCommented:
in the second and third movies in the first frame of each put..
this._lockroot = true;

When they are loaded into the main movie they are losing their reference to their _root as the main movie is _root.

Z
0
ieciepCommented:
Try _parent instead of _root. By writing _parent a one level up i.e. parent level is referred.

For example:
----------------
Lets consider a scenario:

(mc = movie clip)

Here's a scene Hierarchy:
                        _root
                          |______mc1
                          |              |_________mc1Inside
                          |______mc2
                          |              |_________mc2Inside
                          |______mc3
                          |              |_________mc2Inside

Variables on _root: (Actionscript)
----------------------------------------
checkMovie1=1;
checkMovie2=0;
checkMovie3=0;

If we are in mc1 level:
--------------------------
from mc1 you can access these root variables by just writing:

_root.checkMovie1=0;

but you can also access it through _parent like:

_parent.checkMovie1=0;

If we are in mc1.mc1Inside level:
---------------------------------------
from mc1.mc1Inside you can access these root variables by just writing:

_root.checkMovie1=0;

now here's a tricky part if you are using _parent, you have to call parent's parent for the checkMovie1 etc variables declared at the _root level i.e.

_parent._parent.checkMovie1=0;

Similarly, you can use these _root vairables from mc2, mc2.mc2Inside and mc3, mc3.mc3Inside levels.

If you want me to look at the code send it on:

faizanul_haq@hotmail.com
0
plundquistAuthor Commented:
Thanks so much for your quick responses! So maybe it is because it is really early for me, or (more likely) maybe it is because I am clueless, but even though these solutions seem easy enough, I am not having any luck. I think I see what parts you are focusing on, so I will post my code for those areas and maybe you can see it where I am going wrong.

This is what I have in the button in the main movie (first level) that makes the navigation (second level) pop-up in movie clip:

on (release) {
      _root.nav_level2.loadMovie("Tester.swf");
}

                                      (ieciep, when I tried your solution, I put
                                            on (release) {
                            _parent.nav_level2.loadMovie("Tester.swf");
                                              }
                                            is that right, or am I completely off?)

Then, inside the actual level 2 navigation movie itself (the one that loads into level 1), I have on the stage a mc "control" in which there is a level called "up" with three frames, the first and third just stop(); , but the second frame of "up" has this in it:


x = getProperty("_root.text", _x);
if (x>1) {
gotoAndStop(1);
} else {
setProperty("_root.text", _x, x+6);
}




x = getProperty("_parent._parent.text", _x);
if (x>1) {
gotoAndStop(1);
} else {
setProperty("_parent._parent.text", _x, x+6);
}

0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

plundquistAuthor Commented:
DISREGUARD MY LAST POST because I accidently hit the submit button, and the post is totally incomplete, so I am redoing it and will post it in a minute. Sorry!
0
plundquistAuthor Commented:
(Sorry about the accidental post!) ANYWAY, Thanks so much for your quick responses! So maybe it is because it is really early for me, or (more likely) maybe it is because I am clueless, but even though these solutions seem easy enough, I am not having any luck. I think I see what parts you are focusing on, so I will post my code for those areas and maybe you can see it where I am going wrong.

This is what I have in the button in the main movie (first level) that makes the navigation (second level) pop-up in movie clip:

on (release) {
      _root.nav_level2.loadMovie("Tester.swf");
}

                                      (ieciep, when I tried your solution, I put
                                            on (release) {
                            _parent.nav_level2.loadMovie("Tester.swf");
                                              }
                                            is that right, or am I completely off?)

Then, inside the actual level 2 navigation movie itself (the one that loads into level 1), I have on the stage a mc "control" in which there is a layer called "up" with three frames, the first and third just stop(); , but the second frame of "up" has this in it:


x = getProperty("_root.text", _x);
if (x>1) {
gotoAndStop(1);
} else {
setProperty("_root.text", _x, x+6);
}

          (ieciep, again, this is how I tried it, but did I butcher it?)

                                  x = getProperty("_parent._parent.text", _x);
                                  if (x>1) {
                                  gotoAndStop(1);
                                   } else {
                                  setProperty("_parent._parent.text", _x, x+6);
                                   }

The second layer called "down" is very similar, obviously some different  values, and it does its business is frames 4-6.

Here is what I have on the buttons, still in the level 2 navigation movie:

on (rollOver) {
control.gotoAndPlay(5);
}

on (rollOut, dragOut) {
control.gotoAndStop(4);
}

So there is a bunch of code for you, oh, and Zeffer, I put your code in its own layer in the first frame of the level 2 navigation movie (tried separately from ieciep's solution, of course). Did I not do that correctly?
Thank you SO much for all of your brilliant assistance!!
0
ZefferCommented:
yes you did that right but depending on what code you have in the movie..it doesn't always work.
another way to do it is to have references to..this..when you're refering to the movie you are in..eg
on (rollOver) {
this.control.gotoAndPlay(5);
}

you have used ieciep's suggestion incorrectly..but I'll let him comment on that.

Z
0
plundquistAuthor Commented:
Thanks so much for the suggestion! I will try that and post how it works. Thanks!!
0
plundquistAuthor Commented:
So I tried that for the buttons, and it still isn't working, but I wonder if you also intended me to change the code to that style in other areas. Sorry you are having to hold my hand through this! I tried it in conjunction with your first suggestion, and also without use of the first suggestion. Are there other places I should change it besides the button code? Thanks so much for your help!
0
plundquistAuthor Commented:
I was wondering if any one had anything else for me to try, or if there is any more info that you need from me. Thanks so much!!
0
plundquistAuthor Commented:
Anyone?
0
ZefferCommented:
well ieiecp seems  to have abandoned ship..
do you want to put your .fla somewhere so I can download it and take a look..problems with paths
are difficult to figure out just from description.

Z
0
plundquistAuthor Commented:
Sure! Yes, I am sure it is frustrating trying to figure something like this out when you can't look at it! Where/how do I upload that? Thanks SO much!I I really appreciate all of your help!
0
ZefferCommented:
you can register at the following site..or if you don't want to ..you can still use the site annonymously.

http://www.snapdrive.net/?utm_source=freewebspace.net&utm_medium=textad
upload the .fla .. then get the link to it and post the link here

Z
0
plundquistAuthor Commented:
Okay, I have uploaded my files.
My main movie is at:
http://www.snapdrive.net/files/395633/shared.fla 

And the navigation that is giving me the trouble is in the movie at:
http://www.snapdrive.net/files/395633/Tester.fla

So the "Shared" movie is the main movie, in which the "Tester" movie opens. When you preview "Shared," click on the link "Find A Contractor" to see the navigation that is giving me trouble.

 I have included the files below, which aren't giving me any trouble, but they are the content that appear in the main movie for the links you will be testing, so just in case you need them for whatever reason.
http://www.snapdrive.net/files/395633/Homepage.fla http://www.snapdrive.net/files/395633/FindAContractor.fla http://www.snapdrive.net/files/395633/HomeBuilders.fla

So, again, I am just having trouble making the arrows work in the "Tester" movie when it is opened within the movie "Shared." "Tester" was working perfectly when previewed on its own, but now it isn't scrolling correctly either (instead of scrolling until you move your mouse off of it [or reaching the end of the menu], it only moves a little bit each time you mouse over), probably because I have been trying so many things that I screwed it up somewhere and can't figure out where. ANYWAY, I really appreciate all of your help with this!!!
0
ZefferCommented:
well wouldn't have got that in a month of Sundays just talking about it.
Have got it scrolling for you using a different approach..it was still giving problems (scrolling only to the left..not to the right).. fixed that by loading into a level using loadMovieNum..so it obviously didn't like being loaded into nav_level2..(I think that was screwing up the _x position for the clip and the right button couldn't read it accurately)
You will see the loadMovieNum in shared.fla.. and there are quite a few changes to control clip in Tester.fla

note..when using loadMovieNum...the stage should be the same size as the main clip..for registration purposes
any references from main movie to a movie loaded into a level use .._level..eg

_level99.control.gotoAndStop(1);

http://www.redpearl.co.nz/ee/project.zip

Z
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
plundquistAuthor Commented:
Just had time to check here really quickly, but can't wait to download it tomorrow. Thank you SOO much for all of your help! You are seriously a life saver, and your help is EXTREMELY appreciated! You rock!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.