FlexÖÐImage¼ÓÔØͼƬ³ö´íʱÏÔʾĬÈÏͼƬµÄ¼¸ÖÖ·½·¨
FlexÖÐImage¼ÓÔØͼƬ³ö´íʱÏÔʾĬÈÏͼƬµÄ·½·¨Ö÷ÒªÓÐÒÔϼ¸ÖÖ£º
·½·¨Ò»£ºÀûÓà brokenImageSkin ·ç¸ñÏÔʾһ¸öĬÈϵÄͼ£¬Ö»ÐèÉèÖÃCSS¾ÍÐÐÁË£¬ÈçÏ£º
<mx:Style>
Image {
brokenImageSkin: Embed("assets/404.jpg");
}
</mx:Style>
·½·¨¶þ£º¼àÌýImage×é¼þµÄIOErrorEvent.IO_ERRORʼþ£¬´úÂëÈçÏ£º
private function errorHandler():void
{
image.source = "assets/404.jpg";
}
<mx:Image id="image" source="http://²»´æÔÚ.jpg" ioError="errorHandler()"/>
·½·¨Èý£º¼Ì³ÐImageÀ࣬¸²¸ÇÆäset source·½·¨£¬ÈçÏ£º
override public function set source(value:Object):void
{
if(!value || value == ""){
value = "assets/404.jpg";
}
super.source = value;
}
ÍƼöʹÓõÚÈýÖÖ·½·¨£¬ÒòΪµÚÒ»ÖÖ·½·¨¸úµÚ¶þÖÖ·½·¨Óиö¹²Í¬µÄȱµã£¬ÈçÏÂÇé¿ö£º
<mx:Image id="image" source="" ioError="errorHandler()"/>
´ËʱÎÞÂÛÊǵÚÒ»ÖÖ·½·¨»¹ÊǵڶþÖÖ·½·¨¶¼²»»áÏÔʾĬÈÏͼƬ£¬¶øµÚÈýÖÖ·½·¨¾Í¿ÉÒÔ½â¾öÕâ¸öÎÊÌâ¡£
µÚÈýÖÖ·½·¨¾ßÌåʵÏÖ¼°Ê¹Ó÷½·¨ÈçÏ£º
MyImage.as
package
{
import flash.events.IOErrorEvent;
import mx.controls.Image;
public class MyImage extends Image
{
private var defaultImage:String = "assets/404.jpg";
public function MyImage()
{
this.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
}
override public function set source(value:Object):void
{
if(!value || value == ""){
value = defaultImage;
}
super.source = value;
}
private function ioErrorHandler(event:IOErrorEvent):void
{
super.source = defaultImage;
}
}
}
Main.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*">
<local:MyImage id="image" source=""/>
</mx:Application>
ÍƼöʹÓõÚÈýÖÖ·½·¨¡£
Ïà¹ØÎĵµ£º
flex¹ö¶¯ÌõËäÈ»ºÜºÃÓ㬵«×ÜÊÇ»á³öÏÖÒâÏë²»µ½µÄÎÊÌ⡣ǰ¼¸Ìì˵ÁË£¬Í϶¯ºó»¨ÆÁµÄÎÊÌ⣬½ñÌìÓÖ·¢ÏÖÁ˸ü¶ñÐĵÄÎÊÌâ¡£µ±Äã°ÑÈÝÆ÷µÄ¿í¶Èµ÷Ϊ100%ºó £¬verticalScrollbarPolicy ÓÃĬÈϵÄauto¡£ÕâÊÇÈç¹ûÄãËõ·Å´°¿Ú»á³öÏÖ¹ö¶¯Ìõ£¬µ«ÎÊÌâÕâÊǾͳöÏÖÁË£¬Ö»Òª³öÏÖÁË´¹Ö±¹ö¶¯Ìõ£¬Ë®Æ½¹ö¶¯Ìõ¾ÍÊDZ»ÆȳöÏÖ¡£
<?xml version="1.0" enco ......
ÓÉÓÚ±¾ÈË×î½üæÓÚÕÒ¹¤×÷ºÍ±ÏÒµÉè¼Æ£¬Ã»ÓÐʱ¼äÀ´¼ÌÐøÕâ¸öϵÁУ¬ ֻдÁ˵Úһƪ£¬×Ô¼ºÒ²Éî¸Ð²ÑÀ¢£¬Õâһƪ½éÉÜÒ»ÏÂÕâ¸ödemoµÄÕûÌå¼Ü¹¹°É£¬ÏÈÌùÏÂÏÂÔصØÖ·¡£http://download.csdn.net/source/2118707
Ä¿Ç°·þÎñ¶ËÒÑÍê³ÉµÇ½ע²áÄ£¿é£¬Ê¹ÓÃSocket±à³Ì£¬TCPÐÒé¡£µÈ·þÎñ¶ËÍê³É½«ÍêÕûµÄ±àдһ¸öϵÁеĽ̡̳£~~
......
Flex Builder 3 ÏÂÔØ°²×°Óë×¢²áÂë(ת)
Flex Builder 3 Õýʽ°æ£¬·¢²¼ÓÚÖйúʱ¼ä 2008 Äê 2 Ô 25 ÈÕ£»
ÏÂÔصØÖ·Ò»£º
http://download.macromedia.com/pub/flex/flex_builder/FB3_win.exe
´óС£º 424 MB £»Î´½øÐÐѹËõµÄ Flex Builder 3 °²×°Îļþ
²»ÓÃ×¢²áµÇ¼£¬¿ÉÒÔÖ±½ÓÏÂÔØ¡£
ÏÂÔصØÖ·¶þ£º
http://trials.adobe.com/ ......
ÕâÑùµÄÒ»ÖÖÇé¿ö£º
ʹÓÃLoaderÈ¥loadÒ»¸öswf:
var fileURL:String = “assets/test.swf”
var swfLoader:Loader = new Loader();
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoaded);
swfLoader.load(new URLRequest(fileURL));
function swfLoaded(evt:Event):void{
&n ......
Ò»¡¢Flex BuilderµÄ°²×°
1¡¢ÏµÍ³ÒªÇó£º
Eclipse 3.3.x (32-bit)
Sun JRE 1.5.x or newer (32-bit)
Firefox 3.0 (32-bit)
£¨ÆäÖУ¬Eclipse°æ±¾ºÜÖØÒª£¬ÏÖÔÚÒѾµ½ÁË3.5.xÁË£¬ÎÒÊÔ¹ý·Ç3.3.xµÄ½ÏÐÂEclipse£¬µ«ÊÇ×ܲ»³É¹¦£¬¶ø3.3.xµÄ°²×°ÎļþºÜÄÑÕ ......