RE: [flexcoders] Flex Code Behind issue

2008-04-07 Thread Alex Harui
I didn't run the code, but in reading it I see that the MXML version hooks to 
"rollover" and the AS version hooks to "mouseOver" which would explain the 
difference

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Igor 
Costa
Sent: Monday, April 07, 2008 2:34 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex Code Behind issue

 

Very Stange behavior.

 

I´ve tested your code and couldn´t get same error.

 

Log a bug for it.

 

Regards

Igor Costa



 

On 4/6/08, firdosht <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: 

Hey guys,
 so I have created a simple flex proj

http://www.adobe.com/2006/mxml 
<http://www.adobe.com/2006/mxml> " layout="absolute" themeColor="#0EFF02">




   

   

   

   




   

   







So basically all the code above does is changes the backgroundColor of the 
Canvas. It works fine 




Now if I make a MXML Component using the Code Behind Method




















 








http://www.adobe.com/2006/mxml 
<http://www.adobe.com/2006/mxml> " layout="absolute" themeColor="#0EFF02" 
xmlns:ns1="item.*">




 











ListItem.mxml




http://www.adobe.com/2006/mxml 
<http://www.adobe.com/2006/mxml> " width="400" height="300" xmlns:item="item.*">




















CListItem.as

package item

{

   import flash.events.MouseEvent;  

   import mx.containers.Canvas;

   import mx.events.FlexEvent;






   public class CListItem extends Canvas

   {

   public function CListItem()

   {

  super();

  
this.addEventListener(FlexEvent.CREATION_COMPLETE, onComponentLoaded); 

   }

   

   private function 
onMouseOver(evt:MouseEvent):void{




  trace("CListItem.onMouseOver :");

  
this.setStyle("backgroundColor",0xff00ff);  
 

   }

   

   private function onMouseOut(evt:MouseEvent):void{

  trace("CListItem.onMouseOut");




  
this.setStyle("backgroundColor",0x00); 

   }

   

   private function 
onComponentLoaded(evt:FlexEvent):void{  
 

  
this.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);  
  

  
this.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);  




   }  

   }

}







Now when I mouse over the Button component the onMouseOut function gets called 
and there is a flicker in the backgroundColor.

If I dont use the Code Behind Method then the onMouseOut function does not get 
called when I rollOver the button.






Can anyone explain this strange behavior? 

Thanks



Cheers

Firdosh







 




-- 

Igor Costa
www.igorcosta.com <http://www.igorcosta.com> 
www.igorcosta.org <http://www.igorcosta.org>  

 



Re: [flexcoders] Flex Code Behind issue

2008-04-07 Thread Igor Costa
Very Stange behavior.

I´ve tested your code and couldn´t get same error.

Log a bug for it.

Regards
Igor Costa



On 4/6/08, firdosht <[EMAIL PROTECTED]> wrote:
>
>   Hey guys,
>  so I have created a simple flex proj
>
> http://www.adobe.com/2006/mxml"; layout="absolute" 
> themeColor="#0EFF02">
>   
>   
>   
>themeColor="#099FFF" backgroundColor="#D7" rollOver="onOver(event);" 
> rollOut="onOut(event);">
>   
>   
> 
>
>
> So basically all the code above does is changes the backgroundColor of the 
> Canvas. It works fine
> Now if I make a MXML Component using the Code Behind Method
>
>
>
>
>
>
>
>
>
>
>
> *
>
>
> *http://www.adobe.com/2006/mxml"; layout="absolute" 
> themeColor="#0EFF02" xmlns:ns1="item.*">
>  
> 
>
>
>
>
> *ListItem.mxml*
> http://www.adobe.com/2006/mxml"; width="400" 
> height="300" xmlns:item="item.*">
>  
> 
>
>
>
> *
>
>
>
>
>
>
>
>
>
> CListItem.as*
>
> package item
> {
>   import flash.events.MouseEvent; 
>   import mx.containers.Canvas;
>   import mx.events.FlexEvent;
>
>   public class CListItem extends Canvas
>   {
>   public function CListItem()
>   {
>   super();
>   this.addEventListener(FlexEvent.CREATION_COMPLETE, 
> onComponentLoaded);  
>   }
>   
>   private function onMouseOver(evt:MouseEvent):void{
>   trace("CListItem.onMouseOver :");
>   this.setStyle("backgroundColor",0xff00ff);  
> 
>   }
>   
>   private function onMouseOut(evt:MouseEvent):void{
>   trace("CListItem.onMouseOut");
>   this.setStyle("backgroundColor",0x00);  
> 
>   }
>   
>   private function onComponentLoaded(evt:FlexEvent):void{ 
> 
>   this.addEventListener(MouseEvent.MOUSE_OVER, 
> onMouseOver);  
>   this.addEventListener(MouseEvent.MOUSE_OUT, 
> onMouseOut);
>   }   
>   }
> }
>
>
>
> Now when I mouse over the Button component the onMouseOut function gets 
> called and there is a flicker in the backgroundColor.
> If I dont use the Code Behind Method then the onMouseOut function does not 
> get called when I rollOver the button.
>
> Can anyone explain this strange behavior?
> Thanks
>
> Cheers
> Firdosh
>
>
>
>
>
> 
>



-- 

Igor Costa
www.igorcosta.com
www.igorcosta.org


[flexcoders] Flex Code Behind Issue

2008-04-06 Thread firdosht
Hey guys,
so I have created a simple flex proj 



http://www.actionscript.org/forums/showthread.php3?t=166539



[flexcoders] Flex Code Behind issue

2008-04-06 Thread firdosht
Hey guys,
  so I have created a simple flex proj
http://www.adobe.com/2006/mxml";
layout="absolute" themeColor="#0EFF02">









So basically all the code above does is changes the backgroundColor of
the Canvas. It works fine
Now if I make a MXML Component using the Code Behind Method














http://www.adobe.com/2006/mxml";
layout="absolute" themeColor="#0EFF02" xmlns:ns1="item.*">






ListItem.mxml
http://www.adobe.com/2006/mxml"; width="400"
height="300" xmlns:item="item.*">













CListItem.as
package item
{
import flash.events.MouseEvent;
import mx.containers.Canvas;
import mx.events.FlexEvent;

public class CListItem extends Canvas
{
public function CListItem()
{
super();
this.addEventListener(FlexEvent.CREATION_COMPLETE, onComponentLoaded);
}

private function onMouseOver(evt:MouseEvent):void{
trace("CListItem.onMouseOver :");
this.setStyle("backgroundColor",0xff00ff);
}

private function onMouseOut(evt:MouseEvent):void{
trace("CListItem.onMouseOut");
this.setStyle("backgroundColor",0x00);
}

private function onComponentLoaded(evt:FlexEvent):void{
this.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
this.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
}
}
}



Now when I mouse over the Button component the onMouseOut function gets
called and there is a flicker in the backgroundColor.
If I dont use the Code Behind Method then the onMouseOut function does
not get called when I rollOver the button.

Can anyone explain this strange behavior?
Thanks

Cheers
Firdosh



 


[flexcoders] Flex Code Behind issue

2008-04-06 Thread firdosht
Hey guys,
  so I have created a simple flex proj
http://www.adobe.com/2006/mxml";
layout="absolute" themeColor="#0EFF02">









So basically all the code above does is changes the backgroundColor of
the Canvas. It works fine
Now if I make a MXML Component using the Code Behind Method














http://www.adobe.com/2006/mxml";
layout="absolute" themeColor="#0EFF02" xmlns:ns1="item.*">






ListItem.mxml
http://www.adobe.com/2006/mxml"; width="400"
height="300" xmlns:item="item.*">













CListItem.as
package item
{
import flash.events.MouseEvent;
import mx.containers.Canvas;
import mx.events.FlexEvent;

public class CListItem extends Canvas
{
public function CListItem()
{
super();
this.addEventListener(FlexEvent.CREATION_COMPLETE, onComponentLoaded);
}

private function onMouseOver(evt:MouseEvent):void{
trace("CListItem.onMouseOver :");
this.setStyle("backgroundColor",0xff00ff);
}

private function onMouseOut(evt:MouseEvent):void{
trace("CListItem.onMouseOut");
this.setStyle("backgroundColor",0x00);
}

private function onComponentLoaded(evt:FlexEvent):void{
this.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
this.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
}
}
}



Now when I mouse over the Button component the onMouseOut function gets
called and there is a flicker in the backgroundColor.
If I dont use the Code Behind Method then the onMouseOut function does
not get called when I rollOver the button.

Can anyone explain this strange behavior?
Thanks

Cheers
Firdosh



 


[flexcoders] Flex Code Behind issue

2008-04-06 Thread firdosht
Hey guys,
  so I have created a simple flex proj
http://www.adobe.com/2006/mxml";
layout="absolute" themeColor="#0EFF02">









So basically all the code above does is changes the backgroundColor of
the Canvas. It works fine
Now if I make a MXML Component using the Code Behind Method














http://www.adobe.com/2006/mxml";
layout="absolute" themeColor="#0EFF02" xmlns:ns1="item.*">






ListItem.mxml
http://www.adobe.com/2006/mxml"; width="400"
height="300" xmlns:item="item.*">













CListItem.as
package item
{
import flash.events.MouseEvent;
import mx.containers.Canvas;
import mx.events.FlexEvent;

public class CListItem extends Canvas
{
public function CListItem()
{
super();
this.addEventListener(FlexEvent.CREATION_COMPLETE, onComponentLoaded);
}

private function onMouseOver(evt:MouseEvent):void{
trace("CListItem.onMouseOver :");
this.setStyle("backgroundColor",0xff00ff);
}

private function onMouseOut(evt:MouseEvent):void{
trace("CListItem.onMouseOut");
this.setStyle("backgroundColor",0x00);
}

private function onComponentLoaded(evt:FlexEvent):void{
this.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
this.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
}
}
}



Now when I mouse over the Button component the onMouseOut function gets
called and there is a flicker in the backgroundColor.
If I dont use the Code Behind Method then the onMouseOut function does
not get called when I rollOver the button.

Can anyone explain this strange behavior?
Thanks

Cheers
Firdosh



 


[flexcoders] Flex Code Behind issue

2008-04-06 Thread firdosht
Hey guys,
  so I have created a simple flex proj
http://www.adobe.com/2006/mxml";
layout="absolute" themeColor="#0EFF02">









So basically all the code above does is changes the backgroundColor of
the Canvas. It works fine
Now if I make a MXML Component using the Code Behind Method














http://www.adobe.com/2006/mxml";
layout="absolute" themeColor="#0EFF02" xmlns:ns1="item.*">






ListItem.mxml
http://www.adobe.com/2006/mxml"; width="400"
height="300" xmlns:item="item.*">













CListItem.as
package item
{
import flash.events.MouseEvent;
import mx.containers.Canvas;
import mx.events.FlexEvent;

public class CListItem extends Canvas
{
public function CListItem()
{
super();
this.addEventListener(FlexEvent.CREATION_COMPLETE, onComponentLoaded);
}

private function onMouseOver(evt:MouseEvent):void{
trace("CListItem.onMouseOver :");
this.setStyle("backgroundColor",0xff00ff);
}

private function onMouseOut(evt:MouseEvent):void{
trace("CListItem.onMouseOut");
this.setStyle("backgroundColor",0x00);
}

private function onComponentLoaded(evt:FlexEvent):void{
this.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
this.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
}
}
}



Now when I mouse over the Button component the onMouseOut function gets
called and there is a flicker in the backgroundColor.
If I dont use the Code Behind Method then the onMouseOut function does
not get called when I rollOver the button.

Can anyone explain this strange behavior?
Thanks

Cheers
Firdosh