# Popup.as SCRIPT ERROR HELP

**URL:** <https://forum.kirupa.com/t/popup-as-script-error-help/205059>\
**Category:** flash\
**Created:** [October 25, 2006, 7:22pm UTC](https://forum.kirupa.com/t/popup-as-script-error-help/205059 "2006-10-25T19:22:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![scvc193223](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@scvc193223](https://forum.kirupa.com/u/scvc193223)\
**Post date:** [October 25, 2006, 7:22pm UTC](https://forum.kirupa.com/t/popup-as-script-error-help/205059/1 "2006-10-25T19:22:18Z")

</div>

What do these actually mean. I know what nested means, but this as stuff is getting to me. I haven’t written a script yet without an error. Even when I am learning from a book. Can ANYONE help with my two as problems.

**Error** /Users/scottcarlton/Desktop/testingForm/Popup.as: Line 10: Class and interface definitions cannot be nested.  
dynamic class Popup extends MovieClip {

**Error** /Users/scottcarlton/Desktop/testingForm/Popup.as: Line 19: ActionScript 2.0 class scripts may only define class or interface constructs.  
this.ObjectForm = new Object();

Total ActionScript Errors: 2 Reported Errors: 2

///Popup.as Script////

dynamic class Popup extends MovieClip {  
function SetMessage(msg\_str:String, error:Boolean) {  
if (error) {  
this[“Title\_txt”].text = “ERROR”;  
this[“Title\_txt”].textColor = 0xFF0000;  
} else {  
this[“Title\_txt”].text = “Thank You”;  
this[“Title\_txt”].textColor = 0xFF0000;  
}  
[COLOR=“Red”]dynamic class Popup extends MovieClip {[/COLOR]  
var ObjectForm:Object;  
public function onLoad():Void {  
//component initialization functions can be performed here  
}  
public function Popup () {  
//Popup constructor function component initialization function can’t be //placed here because the componet hasn’t been create yet.  
}  
}  
[COLOR=“Red”]this.ObjectForm = new Object();[/COLOR]  
this.ObjectForm.click = this.Closee;  
this[“ButtonOk”].addEventListener(“click, this.ObjectForm”);  
}  
function CloseMe(ev:Object) {  
removeMovieClip(this);  
}  
}

---

<div class="post-metadata">

**Author:** ![mathew\_er](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mathew\_er](https://forum.kirupa.com/u/mathew_er)\
**Post date:** [October 25, 2006, 8:03pm UTC](https://forum.kirupa.com/t/popup-as-script-error-help/205059/2 "2006-10-25T20:03:44Z")

</div>

Its all wrongly written… you can have only one class definition… inside that you put your members…

```auto
dynamic class Popup extends MovieClip
{
    // put the content here like

    var someVar : Object;
    
    // or

    public someFunction () : Void
    {
        // stuff
    }
}

```

---

<div class="post-metadata">

**Author:** ![scvc193223](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@scvc193223](https://forum.kirupa.com/u/scvc193223)\
**Post date:** [October 25, 2006, 8:44pm UTC](https://forum.kirupa.com/t/popup-as-script-error-help/205059/3 "2006-10-25T20:44:26Z")

</div>

Thanks…that cleaned up the errors, but I still can’t seem to get everything to work together. Here are my files. Take look if you can and see what I need to do. Big learning curve.

here is the link to the files:

[www.scottcarlton.net/testingForm.zip](http://www.scottcarlton.net/testingForm.zip)
