Flex»ù´¡ÖªÊ¶µã
ÔÚApplicationÖÐÌí¼Ó·ÇUIComponent×é¼þ
Æ©ÈçÒÔÏ´úÂë¾Í»á±¨´í£º
private function init():void { var sp:Sprite = new Sprite(); addChild(sp);}
TypeError: Error #1034: Ç¿ÖÆת»»ÀàÐÍʧ°Ü:ÎÞ·¨½« flash.display::Sprite@156b7b1 ת»»Îª mx.core.IUIComponent¡£
ÕâÊÇÒòΪApplicationµÄaddChild·½·¨²¢·ÇÍêÈ«¼Ì³Ð×ÔDisplayObjectContainer£¬
Application→LayoutContainer→Container →UIComponent→FlexSprite→Sprite
→DisplayObjectContainer
¶øÊÇÔÚContainerÄÇÀï±»ÖØдÁË£º
public override function addChild(child:DisplayObject):DisplayObject
ËäÈ»²ÎÊýchildµÄÀàÐÍÊÇDisplayObject£¬µ«ÊÇËü±ØÐëʵÏÖIUIComponent½Ó¿Ú£¨ËùÓÐFlex×é¼þ¶¼ÊµÏÖÁËÕâÒ»½Ó¿Ú£©£¬²ÅÄÜÌí¼Ó¡£
Èç¹ûÒªÔÚApplicationÀïÌí¼ÓSprite£¬¿ÉÒÔÏÈ°ÑËü×°½øÒ»¸öUIComponent£¬È»ºóÔÙÌí¼ÓÕâ¸öUIComponent£º
¹Ù·½µÄ˵·¨£º
* <p><b>Note: </b>While the <code>child</code> argument to the method
* is specified as of type DisplayObject, the argument must implement
* the IUIComponent interface to be added as a child of a container.
* All Flex components implement this interface.</p>
Àý×Ó£º
import mx.core.UIComponent;private function init():void {
var sp:Sprite = new Sprite();
var uc:UIComponent = new UIComponent();
uc.addChild(sp); addChild(uc);
}
ΪºÎÒªÖØÔØEventµÄclone·½·¨
Ò»°ãÇé¿öÏÂÊÇûÓÐÎÊÌâµÄ£¬µ«ÊÇÒÔÏÂÇé¾°Ï»á³öÎÊÌâ
¾Ù¸öÀý×Ó£¬ÀÏʦµãÃû£¬Ñ§ÉúÓ¦´ð£¬Èç¹ûѧÉúÓ¦´ðÒԺ󣬿δú±í¼Ç¼Òѵ½
Ê×ÏÈteacher.addEventListener(CallEvent.CALL, student.receive);
ÔÚteacherÉÏÌí¼ÓCallEvent,
teacher.call("name1" );
µ±teacher·¢³öcallʼþµÄʱºò£¬study»áÓ¦´ð£¬
public function receive(e:CallEvent):void
{
if (e.name == this.name)
{
trace(name + " is here");
this.dispatchEvent(e);
}
}
Èç¹û×öµ½ÕâÀï¾Í½áÊøÍêȫûÓбØÒªÖØÔØclone·½·¨£¬µ«ÊÇÈç¹ûºóÐø¿Î´ú±íÒª¼àÌýѧÉúµÄreceiveʼþ¼Ç¼µÄʱºò¾Í±ØÐëÒªÖØÔØ
EventµÄclone·½·¨£¬·ñÔòµÄ»°£¬student.addEventListener(CallEvent.CALL, add);ÔÚaddÖоͻá³öÏÖÂ
Ïà¹ØÎĵµ£º
Flexƽ̨֧³Ö·¶Î§¹ã·ºµÄ·¢²¼Ä£Ê½£¬ËüÃÇÊÇ£º
1. ¿Í»§¶Ëģʽ£¬¼´Ó¦ÓóÌÐòÖ»ÔËÐÐÔÚ¿Í»§¶ËÉ϶ø²»ÐèÒª·þÎñÆ÷×ÊÔ´¡£
2. ʹÓüòµ¥µÄRPC ·ÃÎÊ·þÎñÆ÷Êý¾Ý£¬ ¼´Ê¹ÓÃHTTPService £¨HTTP GET»òPOSTÇëÇó£©
ºÍ WebService£¨Í¨¹ýʹÓÃSOAP£© ¡£
3. Flex Data Servicesģʽ£¬¿ÉÒÔÌṩ¸üΪ¸ß¼¶µÄÌØÐÔ£¬È ......
»ùÔªÊý¾ÝÀàÐÍ°üÀ¨ Boolean¡¢int¡¢Null¡¢Number¡¢String¡¢uint ºÍ void¡£ActionScript ºËÐÄÀ໹¶¨ÒåÏÂÁи´ÔÓÊý¾ÝÀàÐÍ£º
Object¡¢ Array¡¢Date¡¢Error¡¢Function¡¢RegExp¡¢XML ºÍ XMLList¡£
Boolean Êý¾ÝÀàÐÍ
Boolean Êý¾ÝÀàÐÍ°üº¬Á½¸öÖµ£ºtrue ºÍ false¡£¶ÔÓÚ Boolean ÀàÐ͵ıäÁ¿£¬ÆäËüÈκÎÖµ¶¼ÊÇÎÞЧµÄ¡£Ò ......
ÑùÕÅͼ£º
ʹÓ÷½·¨£º
ÉèÖÃApplication±êÇ©µÄpreloaderΪ MyComponent.MyDownloadProgressBar
<mx:Application preloader="MyComponent.MyDownloadProgressBar" >
ÏÂÃæÊÇMyDownloadProgressBar.asµÄ´úÂ룺
package MyComponent
{
import flash.display.*;
import flash.events.*;
import flash.filte ......
ÔÚeclipseÖÐн¨ÁËÒ»¸öwebÏîÄ¿ È»ºóÔÚwebÏîÄ¿ÖÐÏëÌí¼Óflex ¿ª·¢Ç°Ì¨¡£ÔÚwebÏîÄ¿ÃûÉϵã»÷ÓÒ¼ü ----flex project Nature ----- Add flex project Nature ÔÚµ¯³öµÄ¶Ô»°¿òÖÐ ÉèÖÃÈçͼ£º
È»ºó µã»÷ next
Flex WAR file £º Ñ¡Ôñ ÄãµÄblazeds µÄ·¾¶ È»ºóµã»÷ Finish
½á¹û ÏîÄ¿ÏÔʾº ......
Flex Builder 3 Õýʽ°æ£¬·¢²¼ÓÚÖйúʱ¼ä 2008 Äê
2 ÔÂ 25 ÈÕ£»
ÏÂÔصØÖ·Ò»£º
http://download.macromedia.com/pub/flex
/flex
_builder/FB3_win.exe
´óС£º 424 MB £»Î´½øÐÐѹËõµÄ Flex Builder 3 °²×°Îļþ
²»ÓÃ×¢
²áµÇ¼£¬¿ÉÒÔÖ±½ÓÏÂÔØ¡£
ÏÂÔصØÖ·¶þ£º
http://tria
ls.adobe.com/Applications/.../FB3_WW ......