So in your main movie (which has the buttons to load the children) do you
have a stop() action somewhere? Basically if the swf is playing and you
reach the last frame, you just want to put a gotoAndPlay() action which
tells the player to loop back to a certain frame (which is past you
preloader / code definitions).

Lets say for an example (and as you have noted) that your preloading code is
on frame 20 and your main animation you want to loop starts on frame 21.
Lets also say your swf is100 frames in total. ONce preloaded, you want to
call play() from your preload code (which you do already). When the playhead
reaches frame 100, just call gotoAndPlay(21) (or if you define a frame
label, gotoAndPlay("animLoop");

BTW - there are much better forums for asking general Flash questions like
this. You should try kirupa.com and actionscript.org

Aran


On Wed, Aug 18, 2010 at 7:34 AM, Rodrigo Peixoto
<[email protected]>wrote:

> 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]<swfobject%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/swfobject?hl=en.
>

-- 
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.

Reply via email to