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

Converting AS2 to AS3 Please!

New Here ,
Apr 07, 2014 Apr 07, 2014

Hi guys.

I having a major problem in trying to convert an old AS2 code into AS3.

It would be great if you guys could help in anyway you can.

onClipEvent (enterFrame)

{

    this;

    if (_x > 520)

    {

        setProperty(this, _x, -20);

    } // end if

    this;

    if (_x < -20)

    {

        setProperty(this, _x, 520);

    } // end if

    setProperty(this, _x, _x + Number(1.250000E+000));

}

TOPICS
ActionScript
544
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

LEGEND , Apr 07, 2014 Apr 07, 2014

In the timeline of the object in question, try:

addEventListener(Event.ENTER_FRAME, moveX);

function moveX(evt:Event):void {

    if(x > 520){

         x = -20;

    }

    if(x < -20){

         x = 520;

    }

    x += 1.25;

}

Translate
LEGEND ,
Apr 07, 2014 Apr 07, 2014

In the timeline of the object in question, try:

addEventListener(Event.ENTER_FRAME, moveX);

function moveX(evt:Event):void {

    if(x > 520){

         x = -20;

    }

    if(x < -20){

         x = 520;

    }

    x += 1.25;

}

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, 2014 Apr 08, 2014

thank you very much

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
LEGEND ,
Apr 08, 2014 Apr 08, 2014
LATEST

You're welcome

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