Calling Super class method

15 views
Skip to first unread message

Saravanan

unread,
Jan 30, 2008, 1:10:41 AM1/30/08
to Flex India Community
HI,

code [movies.mxml]
-----------------------------------------------------------------------------------------------------
private function changeRenderPage(event:ChangeBookEvent):void
{
var flexBook:FlexBook = new FlexBook();
flexBook.itemRenderer = (RestaurantPage as IFactory);//
RestaurantPage is a component


}


where flex book is a component that extends DataDrivenControl which
has set method itemRenderer which is not working properly...i cannot
set the value from actionscript...


code [FlexBook .as]
-----------------------------------------------------------------------------------------------------
public class FlexBook extends DataDrivenControl
{

}

code [DataDrivenControl.as]
-----------------------------------------------------------------------------------------------------

public class DataDrivenControl extends UIComponent
{
public function DataDrivenControl()
{
super();
}

private var _itemRenderer:IFactory;
public function set itemRenderer(value:IFactory):void
{
_itemRenderer = value;
}
}



I need to set itemRenderer from actionscript.... but its not working


thanks in advance .....

Arun

unread,
Jan 30, 2008, 2:52:39 AM1/30/08
to Flex India Community
Bro, its working fine.

Its makes calls to the set itemRenderer method successfully. Please
check whether you event is getting triggered properly and handler is
getting invoked.

Saravanan

unread,
Jan 30, 2008, 3:42:22 AM1/30/08
to Flex India Community
Nope not for me any bug in my code..?? can u show the code pls..for
creating instance of flexbook

On Jan 30, 12:52 pm, Arun <ag.arun.ku...@gmail.com> wrote:
> Bro, its working fine.
>
> Its makes calls to the set itemRenderer method successfully. Please
> check whether you event is getting triggered properly and handler is
> getting invoked.
>
>
>
> Saravanan wrote:
> > HI,
>
> > code [movies.mxml]
> > ---------------------------------------------------------------------------­--------------------------
> > private function changeRenderPage(event:ChangeBookEvent):void
> >  {
> >       var flexBook:FlexBook = new FlexBook();
> >       flexBook.itemRenderer = (RestaurantPage as IFactory);//
> > RestaurantPage is a component
>
> > }
>
> > where flex book is a component  that extends DataDrivenControl which
> > has set method itemRenderer which is not working properly...i cannot
> > set the value from actionscript...
>
> > code [FlexBook .as]
> > ---------------------------------------------------------------------------­--------------------------
> > public class FlexBook extends DataDrivenControl
> > {
>
> > }
>
> > code [DataDrivenControl.as]
> > ---------------------------------------------------------------------------­--------------------------
>
> > public class DataDrivenControl extends UIComponent
> >    {
> >            public function DataDrivenControl()
> >            {
> >                    super();
> >            }
>
> >            private var _itemRenderer:IFactory;
> >            public function set itemRenderer(value:IFactory):void
> >            {
> >                    _itemRenderer = value;
> >            }
> > }
>
> > I need to set itemRenderer from actionscript.... but its not working
>
> > thanks in advance .....- Hide quoted text -
>
> - Show quoted text -

Arun

unread,
Jan 30, 2008, 4:36:38 AM1/30/08
to Flex India Community
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" creationComplete="init()">
<mx:Script>
<![CDATA[
import com.comboBoxHeaderRenderer;
import com.FlexBook;

public function init():void{
var asdas:FlexBook=new FlexBook();
asdas.itemRenderer = (<rendererComponent> as IFactory); //I have
used some other rendere available on my side.
this.addChild(asdas);
}
]]>
</mx:Script>
</mx:Application>
***************************************************************************************************************************************
***************************************************************************************************************************************
package com
{
import mx.core.UIComponent;
import mx.core.IFactory;
import mx.controls.Alert;

public class DataDrivenControl extends UIComponent
{
public function DataDrivenControl()
{
super();
}

private var _itemRenderer:IFactory;
public function set itemRenderer(value:IFactory):void
{
_itemRenderer = value;
Alert.show("set");
}

}
}
***************************************************************************************************************************************
***************************************************************************************************************************************
package com
{
import flash.events.Event;
import mx.core.IFactory;

public class FlexBook extends DataDrivenControl
{
public function FlexBook():void{
super();

}

}
}
***************************************************************************************************************************************
***************************************************************************************************************************************

Saravanan

unread,
Jan 30, 2008, 4:56:03 AM1/30/08
to Flex India Community
wHAT MY PROBLEM IS the


Code in DataDrivenControl.as
--------------------------------------------------------
public function set itemRenderer(value:IFactory):void
{
_itemRenderer = value;
trace(value);//this
returns null....

}



this value does not executed...
On Jan 30, 2:36 pm, Arun <ag.arun.ku...@gmail.com> wrote:
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
> layout="absolute" creationComplete="init()">
>         <mx:Script>
>                 <![CDATA[
>                         import com.comboBoxHeaderRenderer;
>                         import com.FlexBook;
>
>                         public function init():void{
>                                 var asdas:FlexBook=new FlexBook();
>                                 asdas.itemRenderer = (<rendererComponent> as IFactory); //I have
> used some other rendere available on my side.
>                                 this.addChild(asdas);
>                         }
>                 ]]>
>         </mx:Script>
> </mx:Application>
> ***************************************************************************­************************************************************
> ***************************************************************************­************************************************************
> package com
> {
>         import mx.core.UIComponent;
>         import mx.core.IFactory;
>         import mx.controls.Alert;
>
>         public class DataDrivenControl extends UIComponent
>         {
>                 public function DataDrivenControl()
>                 {
>                         super();
>                 }
>
>                 private var _itemRenderer:IFactory;
>                 public function set itemRenderer(value:IFactory):void
>                 {
>                         _itemRenderer = value;
>                         Alert.show("set");
>                 }
>
> }
> }
>
> ***************************************************************************­************************************************************
> ***************************************************************************­************************************************************
> package com
> {
>         import flash.events.Event;
>         import mx.core.IFactory;
>
>         public class FlexBook extends DataDrivenControl
>         {
>                 public function FlexBook():void{
>                         super();
>
>                 }
>
>         }}
>
> ***************************************************************************­************************************************************
> ***************************************************************************­************************************************************
> > > - Show quoted text -- Hide quoted text -

Arun

unread,
Jan 30, 2008, 11:51:19 AM1/30/08
to Flex India Community
YEAHHHHH!...Got the soln. bro !!!
I did face the same problem and finally managed to chip it out long
ago.


Use the following code to assign the renderer component :

var fB:FlexBook=new FlexBook();
fB.itemRenderer = new ClassFactory(<rendererItem>);

instead of

fB.itemRenderer = <rendererItem> as IFactory;

I bet it'll work!

Saravanan

unread,
Jan 31, 2008, 1:55:12 AM1/31/08
to Flex India Community
Wow thanks Arun u saved me ......thats working ..

larry ackner

unread,
Oct 28, 2013, 12:08:23 AM10/28/13
to flex_...@googlegroups.com
hi,
sorry for a post here but i'm having trouble working with Squiggly with FlexBook . i know this group is very old. but hoping this is still monitor

Squiggly has the same functionality as any other web spell checker. squiggly red lines under misspelled words and right  clicking to bring up the context menu with possible words for replacement.

my problem is that a Group with a TextArea embedded  in FlexBook is stopping the modify context menu with word choices from being displayed.

thx,
larry



 
[my code]
<fx:Style>
        @namespace s "library://ns.adobe.com/flex/spark";
        @namespace mx "library://ns.adobe.com/flex/mx";
       
    </fx:Style>
    <fx:Script>
        <![CDATA[
            import com.adobe.linguistics.spelling.SpellUI;
           
            import mx.collections.ArrayCollection;
            import mx.containers.Canvas;
            import mx.controls.*;
            import mx.core.FlexGlobals;
            import mx.events.FlexEvent;
           
            private var can:Canvas = new Canvas();
            private var ta:TextArea = new TextArea();
       
           
            protected function creationCompleteHandler(event:FlexEvent):void
            {
                can.width = can.height = 600;
               
                ta.width = ta.height = ta.x = ta.y= 100;
               
                ta.text ="beakm me up";
           
                can.addElement(ta);
                var bps:ArrayCollection = new ArrayCollection();
                bps.addItem(can);
                fbook.content = bps.toArray();
               
               
                SpellUI.enableSpelling(ta, "en_US");
                SpellUI.enableSpelling(ta2, "en_US");
            }
       
           
        ]]>
    </fx:Script>

    <s:VGroup id="roots" height="100%" width="100%">   
    <controls:FlexBook id="fbook" width="100%" height="100%"
                       mouseEnabled="true"
                        paddingBottom="0" paddingLeft="0"
                       paddingRight="0" paddingTop="0" />
    <mx:TextArea id="ta2" text="beamk me up works"/>
   
    </s:VGroup>   
   
Reply all
Reply to author
Forward
0 new messages