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

Change some code from as3 to as2

New Here ,
Apr 12, 2014 Apr 12, 2014

Hi, I want to use as2 because it compatible with my website.

I want to change some code from as3 to as2

/////////////////////////////image1////////////////////////////////

if(MovieClip(this.parent).imagetxt.text == "a") {

    var imgurl:String = "C:/Users/Thái/Desktop/ls/cotton-1.jpg";

    var myrequest:URL = new URL(imgurl);

    myloader.scaleContent = true;

    myloader.load(myrequest);

}

/////////////////////////////image2////////////////////////////////

else if(MovieClip(this.parent).imagetxt.text == "b") {

    var imgurl2:String = "http://aloflash.com/images/upload/3.jpg";

    var myrequest2:URLRequest = new URLRequest(imgurl2);

    myloader.scaleContent = true;

    myloader.load(myrequest2);

}

thank you for your support.

TOPICS
ActionScript
318
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 12, 2014 Apr 12, 2014

use:

var myloader:MovieClip=this.createEmptyMovieClip("loader_mc",this.getNextHighestDepth());

if (MovieClip(this._parent).imagetxt.text == "a") {

    var imgurl:String = "C:/Users/Thái/Desktop/ls/cotton-1.jpg";

    myloader.load(imgurl);

} else if (MovieClip(this._parent).imagetxt.text == "b") {

    var imgurl2:String = "http://aloflash.com/images/upload/3.jpg

    myloader.load(imgurl2);

}

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

thank you for your support

But it has one error in line

var myloader:MovieClip=this.createEmptyMovieClip("loader_mc",this.getNext HighestDepth());

This error is

Symbol=togglewindow, layer=as, frame=11, Line 13')' or ',' expected
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 12, 2014 Apr 12, 2014
LATEST

change your publish settings to as2.

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