Okay… I’m a desperate newb making a full flash site and I hope there’s someone who can help me!!! What is wrong here:
What I want to do is this:
In my main movie I have 2 variables: movietoplay and tag
I want an swf to be loaded into a movieclip(content) when myButton is pushed. This swf contains a variable, called tag1(var tag1 = “guitar”).
Then if its loaded, tag and tag1 should be compared, and if they’re the same, nothing should happen. But if they are not, another movie must be loaded elsewhere.
Basically, I’ve collected links that belong with the different pages that load into ‘content’ and those groups should be loaded into the ‘links’ movieclip. But sometimes, the links for 2 different pages are the same. So I want to check if the links of the page that will come are the same links of the previous page and if they are the same, no new links need to be loaded. But if they’re not the same, the new set of links should be loaded. (A set of links always ends with"_link.swf")
So for example, guitar_links.swf should be loaded into the ‘links’ movieclip, but it doesn’t work… WHY??
[AS]function moviemenu() {
_root.content.loadMovie(movietoplay);
if (_root.content.movietoplay.tag1 == _root.tag) {
} else {
_root.tag=_root.content.movietoplay.tag1;
_root.links.loadMovie(tag+"_link.swf")
}
}[/AS]
And I have a button with this script:
[AS]on (release) {
_root.movietoplay = “guitar_home.swf”;
moviemenu.call();
}[/AS]
I hope you more or less understand what I’m trying to do. And I know I ask a lot, but you would make me really happy by helping me, because I have al these ideas, but it’s so difficult to realise those ideas, and that is **** frustrating!! :*(
And who do I let it wait until it’s entirely loaded?
I’m going to try to divide this function in two, one that loads the movietoplay and one that loads the links. Would that work?
Well, so far I’ve got this…
Last time, I kinda translated everything to make it look more simple… But now ‘main.scroll.inhoud’ is the same as the previous ‘content’ and links has become ‘linkhouder.links’
The loadmovie works, but the collection of links doesnt load…
[AS]function laadmovie() {
_root.main.Scroll.Inhoud.unloadMovie
_root.main.Scroll.Inhoud.loadMovie(movietoplay)
}
function laadmenu() {
if (_root.main.Scroll.Inhoud.tag1 != _root.tag) {
_root.tag = _root.main.Scroll.Inhoud.tag1;
_root.linkhouder.links.loadMovie(tag+"_link.swf");
}}
on (release) {
_global.movietoplay = “gitaar_home.swf”;
laadmovie.call();
laadmenu.call()
}[/AS]
Well, the problem is still there. I’m becoming really hopeless. For some reason, he does change the movie, but the menu doesn’t come along. Problem is that het doesn’t change the ‘tag’ value, for some reason. Only possible reason I can think of is that flash doesn’t see it as an inequality, so naturally he doesn’t change the value. But why doesn’t he recognize the inequality???
Probably because I made some newb-mistake somewhere that messes things up…
What’s also really strange is that sometimes he changes the movie and sometimes he doesn’t… :-\ So it only work half the times…
I’ve put my fla file here, maybe you guys find the ‘bug’ ?
Just something that I noticed… all of the times that you refer to the tag variable or object you precede it with _root. except when you are loading the links?
If it requires the _root. then you will be creating a filename called _link.swf not guitar_link.swf.
Well, it doesn’t seem to require the _root part, because the debugger doesn’t report any errors. When I was trying to make the script, I made that mistake and flash said that it couldn’t find the link.swf file. So that is not the problem.
The problem isn, that for some reason, my variable tag stays the same instead of changing…:-\
The FLA file is too big to attach here, I tried again and this time there was a popup that said that it’s too big. I’ll try to make it smaller and I’ll zip it and I’ll post it tomorrow.
But I’m really getting frustrated of trying and trying and still it doesn’t work.
Does anyone know a site with a lot of FLA’s on it that I can examine to find out how to make a good full flash site?
Because I tried to make one with no knowledge of it at all. I know some basic coding, but that’s it. And as you can see, that isn’t enough…;(
It worked??? (inner YIIHAAAA) But… so weird, it doen’t work with me. I’ll try again and if it doesn’t work I’ll post the FLA’s.
But man, you gave me hope!!! =) =)
Here are the 2 fla’s of the movie and menu that should be loaded… But I wonder: isn’t the problem in the first few frames of my main movie? There, I give the variables a beginning value. I think that somehow, the program sticks to those values instead of changing them…
I gave them these values to load the correct movies when you come to my homepage for the first time, after that, the function takes over the navigation.
Man, OOOww man!!! All this trouble because of thàt little flaw!!! Oh boy!! But finally it works!!! YEs!!! I’m excited!
THank you so much, you’re the greatest!!!
One final question then: when should I use the _global part en when shouldn’t I? Just to I understand my mistake…