Hello Friends,
Actually i need a class that extends a super class.
Shall i have two classes in a single .as file? if i do like i cant get
a result
but if i have a separate class in a package it works fine
my previous code
package com
{
public class Example
{
public var status:String = "undefined";
public function Example()
{
status = "it has value now";
trace('status in super : '+status);
}
}
public class ExampleEx extends Example
{
public function ExampleEx()
{
//super();
trace('status in subclass : '+super.status);
}
}
}
my application code
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Script>
<![CDATA[
import com.*;
import mx.controls.Alert;
private function displayConstructor():void{
var ex:ExampleEx = new ExampleEx();
}
]]>
</mx:Script>
<mx:Button label="click" click="displayConstructor()"/>
</mx:Application>
-- it is not working ?
Is it possible????
now my code
package com
{
public class Example
{
public var status:String = "undefined";
public function Example()
{
status = "it has value now";
trace('status in super : '+status);
}
}
}
package com
{
public class ExampleEx extends Example
{
public function ExampleEx()
{
//super();
trace('status in subclass : '+super.status);
}
}
}
my application code
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Script>
<![CDATA[
import com.*;
import mx.controls.Alert;
private function displayConstructor():void{
var ex:ExampleEx = new ExampleEx();
}
]]>
</mx:Script>
<mx:Button label="click" click="displayConstructor()"/>
</mx:Application>
-- It is working fine.
Thanks&Regards,
Gerald A