Alert not correct to CSS file with <mx:Canvas>


hi all,

 

     want apply css file alert. so, have:

 

     1. css file called commonstyle.css:

    

alert{

color : #0f3177;

title-style-name : "alerttitle";

header-height:19;

border-thickness: 1;

drop-shadow-enabled: true;

drop-shadow-color :#d1ddf7;

background-color: #ffffff;

corner-radius :6;

border-style :solid;

header-colors : #90a4d1, #5970a0;

footer-colors : #9db6d9, #ffffff;

border-color : #5970a0;

}

.alerttitle{

font-family :verdana;

font-size :10;

font-weight :bold;

text-align :left;

color :#ffffff;

}

2. alert class custom:

package

 

component

{

 

import mx.controls.alert;

 

 

public class alert extends alert

{

[

embed(source="images/alert_error.gif")]

 

private static var iconerror:class;

 

[

embed(source="images/alert_info.gif")]

 

private static var iconinfo:class;

 

[

embed(source="images/alert_confirm.gif")]

 

private static var iconconfirm:class;

 

 

public static function info(message:string, closehandler:function=null):void{

show(message,

"information", alert.ok, null, closehandler, iconinfo);

}

 

 

public static function error(message:string, closehandler:function=null):void{

show(message,

"error", alert.ok, null, closehandler, iconerror);

}

 

 

public static function confirm(message:string, closehandler:function=null):void{

show(message,

"confirmation", alert.yes | alert.no, null, closehandler, iconconfirm);

}

 

}

}

3. mxml component:

<mx:canvas

xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" creationcomplete="init()">

 

<mx:style source="styles/commonstyle.css" />

                       

<mx:script>

private

 

function test():void{

alert.error(

"alert test...");

}

</mx:script>

</mx: canvas>

 

but @ line:  <mx:style source="styles/commonstyle.css" />, i received warning: css type selectors not supported in components: 'alert' , alert dialog not correct css file !.

 

there problem is: when replace <mx:canvas > <mx:application>, alert dialog ok.

 

pls, me.

thanks.

hi ,

 

try include css file in main mxml file have <mx:application /> tag... instead of compoennet file...

 

<mx:application>

     <mx:style source="styles/commonstyle.css" />

</mx:application>

 

 

 

thanks,

bhasker



More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Hur installera Joomla på One.com - Joomla! Forum - community, help and support

removing index.php from URL address - Joomla! Forum - community, help and support

「イメージマップのアンカー名には、...」のエラーが出ないようにしたい