ScrollPane et loader ne fonctionne pas ensemble
bonjour je cherche le moyen de faire fonctionner un scrollPane ou je place plusieurs boutons appelant chacun un swf externe. Je fait mon animation sans "scrollPane" cela fonctionne:lol: ,mon scrollPane sans le loader aussi , si je rajoute le loader mon scrollPane clignotent.
le code (qui ne fonctionne pas) pour appeler la 1ere animation :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| var loader:Loader=new Loader();
var mcExternal:MovieClip;
this.addChild(loader);
sp.source = MC;
MovieClip(sp.content).Animation1.addEventListener(MouseEvent.CLICK,swf1);
MovieClip(sp.content).Animation2.addEventListener(MouseEvent.CLICK,swf2);
MovieClip(sp.content).Animation3.addEventListener(MouseEvent.CLICK,swf3);
MovieClip(sp.content).Animation4.addEventListener(MouseEvent.CLICK,swf4);
MovieClip(sp.content).Animation5.addEventListener(MouseEvent.CLICK,swf5);
MovieClip(sp.content).Animation6.addEventListener(MouseEvent.CLICK,swf6);
function swf1(e:MouseEvent){
loader.load(new URLRequest("Anim1.swf"));
loader.x = 10;
loader.y = 10;
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE,swfIn);
mcExternal = loader.content as MovieClip; |
le code du loader pour appeler les 6 animations(qui fonctionne):
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
| Select.visible=false;
var loader:Loader=new Loader();
var mcExternal:MovieClip;
this.addChild(loader);
stage.addEventListener(Event.COMPLETE,swf1);
function swf1(e:Event):void {
loader.unloadAndStop();
mcExternal=null;
mcWait.visible=true;
Select.visible=true // bouton retour au menu
Btn1.visible=true; // les 6 boutons visible
Btn2.visible=true;
Btn3.visible=true;
Btn4.visible=true;
Btn5.visible=true;
Btn6.visible=true;
}
Select.addEventListener(MouseEvent.CLICK,unloadSwf);
function unloadSwf(e:MouseEvent):void {
//loader.unload();
loader.unloadAndStop();
mcExternal=null;
mcWait.visible=true; // choix du swf
Select.visible=true // bouton retour au menu
Animation1.visible=true; // les 6 boutons visbles
Animation2.visible=true;
Animation3.visible=true;
Animation4.visible=true;
Animation5.visible=true;
Animation6.visible=true;
}
Animation2.addEventListener(MouseEvent.CLICK,swf2)
function swf2(MouseEvent):void {
loader.load(new URLRequest("Anim2.swf"));
loader.x=10;
loader.y=10;
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE,swfIn);
mcExternal=loader.content as MovieClip;
mcWait.visible=false;
Select.visible=true;
Btn1.visible=false; // je cache les boutons pour pas gêner l'animation
Btn2.visible=false;
Btn3.visible=false;
Btn4.visible=false;
Btn5.visible=false;
Btn6.visible=false;
} |
Voila un peu l'idée pour gain de place je voudrait ajouter un scrollPane et pouvoir y ajouter d'autre animation.