Personal nice day,
I'm a little big problem with this code below, I am new to AS3.
In my code below I have a swf with three buttons that pull external swf when
you click. I would do a sequel if the user does not click the buttons and a
loop at the end, someone help me?
Since already many thanks.
*
**Below the code of a frame.*
/////////////////////// AS ////////////////////////////////////////
// Declação de Variáveis e Incialização da página HOME
var link:URLRequest=new URLRequest("banner1.swf");
mcCarrega.gotoAndPlay(2);
// Eventos dos Botões
banner1.addEventListener(MouseEvent.CLICK, clique);
banner2.addEventListener(MouseEvent.CLICK, clique);
banner3.addEventListener(MouseEvent.CLICK, clique);
// Função clique que troca o valor da variável LINK
function clique(evt:MouseEvent):void {
switch (evt.currentTarget) {
case (banner1):
link=new URLRequest("banner1.swf");
break;
case (banner2):
link=new URLRequest("banner2.swf");
break;
case (banner3):
link=new URLRequest("banner3.swf");
break;
}
mcCarrega.gotoAndPlay(2);
}
/////////////////////// AS ////////////////////////////////////////
*Below the code of the 20th frame of the load.*
/////////////////////// AS ////////////////////////////////////////
stop();
//Declaração de Variável
var carrega:Loader = new Loader();
// Carregando o arquivo escolhido na variável CARREGA
carrega.load(MovieClip(root).link);
// Verificação de Eventos de Carregamento
carrega.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,
carregando);
carrega.contentLoaderInfo.addEventListener(Event.COMPLETE, completo);
//Funções de Carregamento
function carregando(evt:ProgressEvent):void {
var perc:Number=evt.bytesLoaded/evt.bytesTotal;
barra.scaleX=perc;
percentual.text=Math.floor(perc*100)+"%";
}
function completo(evt:Event):void {
MovieClip(root).container.removeChildAt(0);
MovieClip(root).container.addChild(carrega);
play();
}
/////////////////////// AS ////////////////////////////////////////
--
You received this message because you are subscribed to the Google Groups
"SWFObject" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/swfobject?hl=en.