I found another gap in my knowledge
here's the deal:
very short:
---------------------------------------------
Is there a way to check which background.swf is
loaded from whithin the controls.swf and then
jumps to the appropriate keyframe that tells
you which background is displayed???????
---------------------------------------------
more detailed:
---------------------------------------------
before i explain here's the site it's about: http://people.a2000.nl/mstaal
i use an empty loader.swf to load the stuff into levels.
there are 2 levels
1 containing the background (level 1)
and
1 containing the controls (level 2)
There are actually more but it's only confusing when i write them all down
now when using the displaycontrol you can switch backgrounds
and the selected backgroundicon in the displaymenu will have
a text effect telling you it is selected
(for this example select background 2 or 3).
Once you have moved your mousepointer away from that control the menu closes again.
Now this is what's wrong:
open the displaymenu again and you will see that the wrong
keyframe is displayed telling you that background 1 is
loaded
Is there a way to check which background.swf is loaded from
whithin the controls.swf and then jumps to the appropriate
keyframe that tells you which background is displayed???????
Hope you guys understand what i mean because it's a bit hard to explain
resume:
3 backgrounds named:
backgrnd1.swf (this one is loaded into level 1 by an empty loader.swf that loads everything into place)
backgrnd2.swf (replacing the one in level 1)
backgrnd3.swf (replacong the one in level 1)
controls.swf (loaded into level 2)
---------------------------------------------
ON THE LOADED BACKGROUND:
-----------------------------
_level0.whichBkd = backgrnd2;
stop ();
-----------------------------
AND ON THE CONTROLS:
-------------------------------
tellTarget ("_level0") {
if (whichBkd = backgrnd2) {
gotoAndStop (2);
}
}
-------------------------------
this is probably not the way so please give me some info on this MGB
I've done exactly whatyou told me to but
Somehow i am missing something because i can't get it to work
even though i understand the scripting bit
Is it possible that i send you the fla's by email?
so you could have a closer look at it.
(Total of all the fla files is 611kb)
Hope to hear soon from you
and if you want to receive the fla's send me an empty e-mail to: m.staal@chello.nl
I'll reply that one with the files
Thanks in advance
P.s. don't think i am not trying because i also tried this:
in the preloader of the background:
if (_framesloaded == _totalframes) {
var whichBkd = bkgrnd3;
}
in the first keyframe of the controls:
if (_level1.whichBkd == bkgrnd1) {
gotoAndStop (2);
} else if (_level1.whichBkd == bkgrnd2) {
gotoAndStop (3);
} else if (_level1.whichBkd == bkgrnd3) {
gotoAndStop (4);
}
to set the var i had to change it
var whichBkd = bkgrnd3;
into
_level0.whichBkd = "3";
because somehow the var statement only worked when i used a single number instead of the full bkgrnd3
the var did get set but the controls didn't read it
Or it might be because i was overlooking something.
Nevertheless (if that's good english )
YOUR THE MAN !!!!!!!!
IT IS WORKING NOW
This could be a timing problem where the variable is not set for a few seconds even though the swf is cached. You should also set the whichBkd variable to "" with;
Perhaps it is not necessary to use levels. You could use a movie clip for all your backgrounds an use frames in the clip to set the variable. You could also have the nav mc on the root.
You also might try to figure a way to make the variable reset if the swf is reloaded after it is cached so the ifFrameIsLoaded sets the variable and it is also set if it is reloaded.
Finally it is working now
You where right about the timing thing AGAIN !!!
I changed the point of the variable being written from keyframe 1 of the preloader to the last keyframe of the beckground animation (the one containing the stop action)
And now it is working
Thanks for ALL the support and i hope to be of some help in the future
(although i don't think that will happen ))