I have a menu (mc_menu) with 6 button mc’s (btn_home, btn_about, …btn_contact) I also have 6 containerson the stage (content_home, content_about, …content_contact)
Right now I’m loading different external swf’s(home, about,…contact) with the following AS code:
function pagina(page) {
showContent(page);
}
function showContent(page) {
var c = this["content_"+page];
for (var i in this) {
if (this*._name.substr(0, 8) == "content_") {
this*._visible = (this*._name.substr(8) == page);
c.loadMovie(page+".swf");
}
loadingPage = page;
}
}
and on the buttons I call that functions:
function setButton() {
for (var i in menuMc) {
if (menuMc*._name.substr(0, 4) == "btn_") {
clip = menuMc*;
//RollOver and RollOut stuf goes here
clip.onRelease = function() {
[color=red]pagina(this._name.substr(4));[/color]
};
}
}
}
But I want the external swf’s to load in just one container with fade in and fade out. How can I reach this?
Look out in the flash samples installed on your hdd :)… you should have there a LoadMovie feature explained with all the as for fade in fade out.
Help > Samples
I can’t get it to work as yet. One question to make sure I understand what I should do. Do I still need the function [color=red]showContent,[/color] because that part is with the seperate content_mc’s, and I would like to work with just one container. I’m a bid confused? because in the tut the container color=red[/color] is declared in the [color=red]prototype loadPhoto[/color] (var p = _root.photo;) so I don’t know how to continiue?
You need the showContent, in that function you call the changePhoto:
_root.changePhoto(page+".swf");
In the tut they’ve used “photo”, if you look at the code in post#8, you’ll see I’ve changed that in your mc “c”.
So if you add that code, it should work… (like I’ve said before, I didn’t test it;) )
function pagina(page) {
showContent(page);
}
function showContent(page) {
var c = this["content_"+page];
for (var i in this) {
if (this*._name.substr(0, 8) == "content_") {
this*._visible = (this*._name.substr(8) == page);
_root.changePhoto(page+".swf");
}
loadingPage = page;
}
}
If you use this with my gallery code, there is a chance it’ll work, LOL.
the container has an instancename “c”.
If you cant get it working, post a .fla?
Thanks for the patience
Sorry but I don’t understand the part with content_.I tried it with just one container (content) and I tried it with a content_ container for every seperate swf but it doesn’t work. HeI have send the zip by email becauseI couln’t get it smal enough to attach it here
MovieClip.prototype.loadPhoto2 = function() {
// specify the movieclip to load images into
var p = this.whereToLoad;
//------------------------------------------
p._alpha = 0;
p.loadMovie(this.picToLoad);
this.onEnterFrame = loadMeter;
};
that should do it. now you call the function with two parameters, the item you want to load, and which container you want to load it into. you call the function like this: