Skip navigation
    5 Replies Latest reply on Jun 28, 2011 11:10 PM by relaxatraja

    How to modify the code to use the image on stage instead of in library?

    mdnavaz Level 1


      The following code I found on website is for working with the image which is in library. But how to modify it to work with the image on stage. Because I don't want to use it from the library.


      The second question ------ Is it the AS2 code or AS3. If it is AS2 code then please let me know how to modify it to work with AS3.


      animator = CreateEmptyMovieClip('animator',1);
      bg_1 = animator.attachMovie('bg_mc','bg_1',1);
      bg_2 = animator.attachMovie('bg_mc','bg_2',2);
      bg_1._x = bg_1._width/2:
      bg_2._x = bg_2._width/2:
      speed = 1;
      cloudWidth = 380;
      animator.onEnterFrame = function(){
      bg_1._x -= speed:
      bg_2._x -= speed:
      if(bg_1._x <= -bg_1._width) bg_1._x = cloudWidth;
      if(bg_2._x <= -bg_2._width) bg_2._x = cloudWidth;



        More Like This


        • Correct Answers - 10 points