# Help making Flash 7 AS2 code working on all Flash versions

**URL:** <https://forum.kirupa.com/t/help-making-flash-7-as2-code-working-on-all-flash-versions/286752>\
**Category:** flash\
**Created:** [April 20, 2009, 3:40pm UTC](https://forum.kirupa.com/t/help-making-flash-7-as2-code-working-on-all-flash-versions/286752 "2009-04-20T15:40:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![humbuged](https://avatars.discourse-cdn.com/v4/letter/h/b38774/32.png) [@humbuged](https://forum.kirupa.com/u/humbuged)\
**Post date:** [April 20, 2009, 3:40pm UTC](https://forum.kirupa.com/t/help-making-flash-7-as2-code-working-on-all-flash-versions/286752/1 "2009-04-20T15:40:52Z")

</div>

Hello 🙂

I did this AS2 code in Flash CS4 and have a little trouble with it.

```auto
if (as2_mc.text != "Using Actionscript 2") {
	_root.createEmptyMovieClip("dynamic_mc",1);
	_root.dynamic_mc.beginFill(0x000000);
	_root.dynamic_mc.moveTo(0,0);
	_root.dynamic_mc.lineTo(Stage.width,0);
	_root.dynamic_mc.lineTo(Stage.width,Stage.height);
	_root.dynamic_mc.lineTo(0,Stage.height);
	_root.dynamic_mc.lineTo(0,0);
	_root.dynamic_mc.endFill();
	_root.dynamic_mc._x = 0;
	_root.dynamic_mc._y = 0;
	_root.createTextField("dynamic_txt",2,0,0,150,1);
	_root.dynamic_txt.text = "Not using Actionscript 2";
	var textstyle:TextFormat = new TextFormat();
	textstyle.color = 0xffffff;
	textstyle.size = 16;
	textstyle.font = "Arial";
	textstyle.align = "center";
	_root.dynamic_txt.setTextFormat(textstyle);
	_root.dynamic_txt.autoSize = true;
	_root.dynamic_txt.multiline = true;
	_root.dynamic_txt.wordWrap = true;
	_root.dynamic_txt._x = (Stage.width-_root.dynamic_txt._width)/2;
	_root.dynamic_txt._y = (Stage.height-_root.dynamic_txt._height)/2;
}

```

It works like I want it to in Flash 7 and looks like [this, but when I change the publish settings into Flash 8/9/10, the code looks like [url=http://www.fhqhosting.com/ui/as2\_f10.swf]this](http://www.fhqhosting.com/ui/1as2_f7.swf).

How do I make the code work on all AS2 Flash versions?
