then how should i define above code Thanks&Regards, Gerald A On Thu, Nov 19, 2009 at 4:36 PM, Saravanan <[email protected]> wrote:
> YUP > > On Nov 19, 1:13 am, FlexiSush <[email protected]> wrote: > > Hi, > > you cannot have more than one public class in a single .as file. Due > > to this it will not work. > > > > On Nov 18, 10:44 am, Gerald Anto <[email protected]> wrote: > > > > > > > > > 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 > > -- > > You received this message because you are subscribed to the Google Groups > "Flex India Community" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<flex_india%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/flex_india?hl=. > > > -- Thanks & Regards, A Gerald -- You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/flex_india?hl=.

