Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Loop movie on a single frame with AS2?

New Here ,
Apr 08, 2013 Apr 08, 2013

Hi, i'm animating a web banner, which is supposed to loop infinite times. The thing is, i learnt to use tweening prototype for my animation, so the entire code is written on a single frame.

Is there a way to loop the entire movie at the end?

TOPICS
ActionScript
594
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 08, 2013 Apr 08, 2013

use:

clearInterval(iniciarI);
var iniciarI:Number=setInterval(iniciar,2000);
iniciar();

function iniciar (){

//INTRO//

_root.fondo._x=2632;

_root.fondo._y=223;

_root.fondo.tween("_x",-38,25,"easeOutCubic",0.5)

_root.bloqueintro._x=535

_root.bloqueintro._y=226

_root.bloqueintro.tween("_x",-600,1.5,"easeOutCubic",6.5)

_root.opt._x=468

_root.opt._y=-50

_root.opt.tween("_y",146,1.5,"easeOutCubic",1.5)

_root.opt.tween("_x",-270,1.5,"easeOutCubic",6.5)

_root.esp._x=530

_root.esp._y=198

_root.esp._yscale=0

_root.esp.twee

...
Translate
Community Expert ,
Apr 08, 2013 Apr 08, 2013

put whatever code that initiates your animation into a function body.  call that function when your animation ends.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 08, 2013 Apr 08, 2013

Thanks! but I still need help.

Ok, let's say this is the code:

function iniciar (){

//INTRO//

_root.fondo._x=2632;

_root.fondo._y=223;

_root.fondo.tween("_x",-38,25,"easeOutCubic",0.5)

_root.bloqueintro._x=535

_root.bloqueintro._y=226

_root.bloqueintro.tween("_x",-600,1.5,"easeOutCubic",6.5)

_root.opt._x=468

_root.opt._y=-50

_root.opt.tween("_y",146,1.5,"easeOutCubic",1.5)

_root.opt.tween("_x",-270,1.5,"easeOutCubic",6.5)

_root.esp._x=530

_root.esp._y=198

_root.esp._yscale=0

_root.esp.tween("_yscale",100,1,"easeOutBounce",2.5)

_root.esp.tween("_x",-459,1.5,"easeOutCubic",6.5)

_root.de._x=621

_root.de._y=246

_root.de._yscale=0

_root.de.tween("_yscale",100,1,"easeOutBounce",2.5)

_root.de.tween("_x",-368,1.5,"easeOutCubic",6.5)

_root.trab._x=664

_root.trab._y=292

_root.trab._yscale=0

_root.trab.tween("_yscale",100,1,"easeOutBounce",2.5)

_root.trab.tween("_x",-325,1.5,"easeOutCubic",6.5)

//CONECTOR//

_root.conector._x=1659;

_root.conector._y = 244;

_root.conector.tween("_x",-800,1.5,"easeOutCubic",6.5);

_root.conector2._x=-800;

_root.conector2._y = 244;

_root.conector2.tween("_x",1924,1.5,"easeOutCubic",13);

_root.conector3._x=1924;

_root.conector3._y = 244;

_root.conector3.tween("_x",-800,1.5,"easeOutCubic",21);

_root.conector4._x=-800;

_root.conector4._y = 244;

_root.conector4.tween("_x",1924,1.5,"easeOutCubic",27);

};

iniciar();

So the whole animation is now into a function body. Still, how can i loop that function, if i only have one frame?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 08, 2013 Apr 08, 2013
LATEST

use:

clearInterval(iniciarI);
var iniciarI:Number=setInterval(iniciar,2000);
iniciar();

function iniciar (){

//INTRO//

_root.fondo._x=2632;

_root.fondo._y=223;

_root.fondo.tween("_x",-38,25,"easeOutCubic",0.5)

_root.bloqueintro._x=535

_root.bloqueintro._y=226

_root.bloqueintro.tween("_x",-600,1.5,"easeOutCubic",6.5)

_root.opt._x=468

_root.opt._y=-50

_root.opt.tween("_y",146,1.5,"easeOutCubic",1.5)

_root.opt.tween("_x",-270,1.5,"easeOutCubic",6.5)

_root.esp._x=530

_root.esp._y=198

_root.esp._yscale=0

_root.esp.tween("_yscale",100,1,"easeOutBounce",2.5)

_root.esp.tween("_x",-459,1.5,"easeOutCubic",6.5)

_root.de._x=621

_root.de._y=246

_root.de._yscale=0

_root.de.tween("_yscale",100,1,"easeOutBounce",2.5)

_root.de.tween("_x",-368,1.5,"easeOutCubic",6.5)

_root.trab._x=664

_root.trab._y=292

_root.trab._yscale=0

_root.trab.tween("_yscale",100,1,"easeOutBounce",2.5)

_root.trab.tween("_x",-325,1.5,"easeOutCubic",6.5)

//CONECTOR//

_root.conector._x=1659;

_root.conector._y = 244;

_root.conector.tween("_x",-800,1.5,"easeOutCubic",6.5);

_root.conector2._x=-800;

_root.conector2._y = 244;

_root.conector2.tween("_x",1924,1.5,"easeOutCubic",13);

_root.conector3._x=1924;

_root.conector3._y = 244;

_root.conector3.tween("_x",-800,1.5,"easeOutCubic",21);

_root.conector4._x=-800;

_root.conector4._y = 244;

_root.conector4.tween("_x",1924,1.5,"easeOutCubic",27);

};

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines