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

As2 code to As3 conversion please

New Here ,
Nov 19, 2013 Nov 19, 2013

Hey, could someone help me converting the following code to AS3. Thanks for any help..

id=_root.id;

if(this._y<>_root.txk){

this._y=_root.txk;

_root.txk+=60;

}

this._x=_root.txx;

textyazı="";

onEnterFrame=function(){

this._name=namet.text;

if(_root.txk==360){

_root.txx+=60;

_root.txk=60;

}

this.onPress=function(){

if(_root["t"+namet.text].txtn.text<>namet.text){

_root.attachMovie("txt_dd","t"+namet.text,_root.derinlik);

_root["t"+namet.text]._x=100;

_root["t"+namet.text]._y=100;

_root["t"+namet.text].txtyname.text=namet.text;

_root["t"+namet.text].txtn.text=namet.text;

_root["t"+namet.text].txtyazılar.text=textyazı;

_root.derinlik++;

}

}

}

///////////////

txtac = SharedObject.getLocal(id);

setInterval(function(){

if(txtac.data.namet<>"" && txtac.data.id>0){

namet.text=txtac.data.namet;

textyazı=txtac.data.textyazı;

id=txtac.data.id;

}else{

namet.text=_name;

}

if(namet.text=="undefined"){

          namet.text=_name;

}

if(textyazı==undefined){

          textyazı="";

}

},50);

this.useHandCursor=false;

TOPICS
ActionScript
427
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 ,
Nov 19, 2013 Nov 19, 2013

that's terrible coding.  it looks like it's from a commercial template notorious for terrible coding.

if there's more coding than the snippet your showed, it's not worth converting.  you should start over and code it properly.

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
Guru ,
Nov 20, 2013 Nov 20, 2013
LATEST

1.download flashdevelop (Flash has bad code hinting and error descriptions)

2.start with deleting underscores in _root,_x,_y

3.work your way up from there

4.Lines like:

this.onPress=function

are probably attached directly to a button or MovieClip: This is not possible in as3 anymore. You have to take the code out of the button and put it on the timeline of the button, if it is a MovieClip.

5.The Event Model has changed considerably:

onEnterFrame=function(){

// do stuff here

}

is now

addEventListener(ENTER_FRAME, enterFrameHandler);

function enterFrameHandler(e:Event):void{

//do stuff here

}

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