FlexÖÐimage¿Ø¼þÈçºÎÌí¼Ó±ß¿ò
Ò³Ãæ´úÂ룺
<?xml version="1.0"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:marsImage="mars.display.*"
backgroundColor="#000000"
layout="absolute">
<marsImage:BorderImage
borderAlpha="{aBar.value}"
borderWidth="{wBar.value}"
borderColor="{colorTool.selectedColor}"
source="@Embed('../img/panda.jpg')"
width="258" height="229" x="180" y="62"/>
<mx:Label x="180" y="327" text="ÇëÑ¡Ôñ±ß¿òÑÕÉ«" color="#FDFDFD" fontSize="16"/>
<mx:Label x="180" y="391" text="ÇëÑ¡Ôñ±ß¿ò¿í¶È" color="#FDFDFD" fontSize="16"/>
<mx:Label x="377" y="391" text="ÇëÑ¡Ôñ±ß¿ò͸Ã÷¶È" color="#FDFDFD" fontSize="16"/>
<mx:ColorPicker x="305" y="327" color="#FDFDFD" id="colorTool"/>
<mx:VSlider x="525" y="255" minimum="0" maximum="1" id="aBar" />
<mx:HSlider x="180" y="423" minimum="0" maximum="6" id="wBar"/>
</mx:Application>
¿Ø¼þ´úÂëÈçÏ£º
package mars.display
{
import mx.controls.Image;
//±ß¿òÑÕÉ«
[Style(name="borderColor", type="uint", format="Color", inherit="no")]
//±ß¿ò¿í¶È
[Style(name="borderWidth", type="Number", format="Length", inherit="no")]
//±ß¿ò͸Ã÷¶È
[Style(name="borderAlpha", type="Number", format="Length", inherit="no")]
public class BorderImage extends Image
{
public function BorderImage()
{
super();
}
override protected function updateDisplayList(w:Number, h:Number):void{
super.updateDisplayList(w,h);
graphics.clear();
graphics.lineStyle(getStyle('borderWidth'),getStyle('borderColor'),getStyle('borderAlpha'),false);
var x:Number=-(getStyle('borderWidth
Ïà¹ØÎĵµ£º
¹¹½¨¸ßÐÔÄܵÄJ2EEÓ¦Óò»µ«ÐèÒªÁ˽ⳣÓõÄʵʩ¼¼ÇÉ¡£ÏÂÃæ½éÉÜ×î³£ÓõÄ10ÖÖÓÐЧ·½·¨£¬¿É°ïÖú¼Ü¹¹Éè¼ÆʦÃÇ¿ìËÙ³ÉΪÕâ·½ÃæµÄר¼Ò¡£
JavaÐÔÄܵĻù´¡—ÄÚ´æ¹ÜÀí
ÈκÎJavaÓ¦Ó㬵¥»úµÄ»òJ2EEµÄÐÔÄÜ»ù´¡¶¼¿É¹é½áµ½ÄãµÄÓ¦ÓÃÊÇÈçºÎ¹ÜÀíÄÚ´æµÄÎÊÌâ¡£JavaµÄÄÚ´æ¹ÜÀí°üÀ¨Á½¸öÖØÒªÈÎÎñ£ºÄÚ´æµÄ·ÖÅäºÍÄÚ´æµÄ»ØÊÕ¡£ÔÚÄÚ´æµÄ·ÖÅäÖУ¬Ä ......
<img src="{{----}}13730" mce_src="{{----}}13730"/><span id="__caret">_</span><?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationCo ......
ʹÓÃjsÀ´²Ù×÷flex
Ê×ÏÈÔÚfademo.mxmlÖÐÉùÃ÷Ò»¸öbutton£¬²¢Ìí¼ÓÒ»¸öbtnClick·½·¨£º
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="l ......
--------------ex2_01_solution ѡȡʱ¼ä-----------------------
...
private function dateChangeHandler():void
{
// The Alert.show() message displays a static string plus the selected date in the startDate control
......
package
{
import mx.containers.Panel;
import mx.controls.Button;
import flash.events.Event;
import mx.events.FlexEvent;
import flash.events.MouseEvent;
import mx.controls.Alert;
/**
* This class is used to create a Custom Panel
* with Maximum, Minimum, close
* and also drag p ......