Hi, i have a small problem. Ive got three mc’s which i use as a links. AS looks like this:
stop();
/////////////////////////////////
import flash.events.MouseEvent;
import flash.display.*;
import flash.utils.getDefinitionByName;
/////////////////////////////////
function addMovieFromLibraryOmnie(mcIName:String){
var tMC:Class = getDefinitionByName(mcIName) as Class;
var newMc:MovieClip = new tMC() as MovieClip;
removeChild(newMc);
newMc.x=517;
newMc.y=-234;
addChild(newMc);
}
function addMovieFromLibraryGaleria(mcIName:String){
var tMC:Class = getDefinitionByName(mcIName) as Class;
var newMc:MovieClip = new tMC() as MovieClip;
newMc.x=517;
newMc.y=-234;
addChild(newMc);
}
function addMovieFromLibraryKontakt(mcIName:String){
var tMC:Class = getDefinitionByName(mcIName) as Class;
var newMc:MovieClip = new tMC() as MovieClip;
newMc.x=517;
newMc.y=-234;
addChild(newMc);
}
/////////////////////////////////
omnie.buttonMode = true;
omnie.addEventListener (MouseEvent.CLICK, omnia);
omnie.addEventListener (MouseEvent.ROLL_OVER, omnia01);
omnie.addEventListener (MouseEvent.ROLL_OUT, omnia02);
function omnia ($event:MouseEvent) {
tabbg.gotoAndPlay(2);
addMovieFromLibraryOmnie("tekst");
}
function omnia01 ($event:MouseEvent) {omnie0.gotoAndPlay(2);}
function omnia02 ($event:MouseEvent) {omnie0.gotoAndPlay(6);}
/////////////////////////////////
galeria.buttonMode = true;
galeria.addEventListener (MouseEvent.CLICK, galery);
galeria.addEventListener (MouseEvent.ROLL_OVER, galery01);
galeria.addEventListener (MouseEvent.ROLL_OUT, galery02);
function galery ($event:MouseEvent) {tabbg.gotoAndPlay(2);}
function galery01 ($event:MouseEvent) {galeria0.gotoAndPlay(2);}
function galery02 ($event:MouseEvent) {galeria0.gotoAndPlay(6);}
/////////////////////////////////
kontakt.buttonMode = true;
kontakt.addEventListener (MouseEvent.CLICK, contact);
kontakt.addEventListener (MouseEvent.ROLL_OVER, contact01);
kontakt.addEventListener (MouseEvent.ROLL_OUT, contact02);
function contact ($event:MouseEvent) {tabbg.gotoAndPlay(2);}
function contact01 ($event:MouseEvent) {kontakt0.gotoAndPlay(2);}
function contact02 ($event:MouseEvent) {kontakt0.gotoAndPlay(6);}
/////////////////////////////////
I want to solve my problem - loading and unloading movies from library. For example:
when you click on galeria,omnie or kontakt it will display tabbg (which is on the stage) and some mc from library. The biggest problem is that there is possiblity that when you will click on galeria and next on omnie - on stage will be displayed both. Ive tried to make some functions - one function for adding sth from library and other to remove the child but it came for nothing;/ is there any way to solve it? I ask because if it comes to as2 there are no problems. But in as3…;/ please help;)