Copy link to clipboard
Copied
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));
}
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;
}
Copy link to clipboard
Copied
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;
}
Copy link to clipboard
Copied
thank you very much
Copy link to clipboard
Copied
You're welcome
Find more inspiration, events, and resources on the new Adobe Community
Explore Now