flex ÈÕ¼Ç1 cairngorm
ѧflex¾ÍÊÇΪÁËÌø²Û£¬Íò¶ñµÄ¹«Ë¾£¬Äêµ×ʲô¶¼Ã»ÓУ¬º¦µÄÎÒ¶¼Ã»Ç®»Ø¼Ò£¬±¾ß°¡¡£
ѧflexÒѾÓÐÒ»¶Îʱ¼äÁË£¬ÎÒÊÇjava³ÌÐòÔ±£¬»¶Ó´ó¼Ò½»Á÷
×î½üѧÁ˵ãcairngorm ¸Ð¾õÓÃÆðÀ´±Èstruts·±ËöÒ»µã£¬·Ï»°ÉÙ˵£¬ÉÏ´úÂ룺
1.ÏÈ¿´vo,±¾ÊµÀýÊÇÒ»¸öÌí¼ÓÁªÏµÈ˵ÄСÀý×Ó£¬Ãû×Ö£¬ÓÊÏ䣬Ìí¼Óʱ¼äÈý¸öÊôÐÔ£¬¶¼ÊǸã javaµÄ£¬ÁõÈôӢ˵ÁË ,ÄãÖªµÀ£¬ÎÒÖªµÀ
package adobe.vo
{
import com.adobe.cairngorm.vo.ValueObject;
public class ContactVO implements ValueObject
{
public function ContactVO()
{
}
public var fullName:String;
public var email:String;
public var addContactDate:String;
}
}
2.½ÓÏÂÀ´¾Ímvc°É£¬cairngorm ¼¸¸öÖ÷ÒªµÄ×é¼þ £º
modellocator £¨Æäʵ¾ÍÊÇÒ»¸öÈ«¾ÖµÄÈÝÆ÷£¬°ÑÄãÐèÒª±£´æµÄÊý¾Ý·ÅÀï±ß£©
command (Õâ¸öÊÇboss,¸ºÔð°ÑÊý¾Ý¼ÓÈëµ½modellocatorÖУ¬»¹¿ÉÒÔÓÐÒ»¸ö´úÀí£¬±ØÒªµÄ»°£¬ºÍÊý¾Ý¿â½»Á÷½»Á÷)
frontControl ( ÎÒ˵¾ÍÊÇÒ»¸ö¼àÌýÆ÷£¬½ºþÉÏÓÐÊÂÁËËû¶¼È¥±¨¸æÕÆÃÅÈË(command))
cairngormEvent (×Ô¶¨Òåʼþ ûʲôºÃ˵µÎ)
´úÂëÉÏ modellocator
package adobe.model
{
import com.adobe.cairngorm.model.ModelLocator;
import mx.collections.ArrayCollection;
[Bindable]
public class ContactModelLocator implements ModelLocator
{
public function ContactModelLocator()
{
}
private static var instance:ContactModelLocator;
//µ¥ÀýµÄ£¬ÎÒÖªµÀ£¬ÄãÖªµÀ
public static function getInstance():ContactModelLocator{
if(instance == null){
instance = new ContactModelLocator();
}
return instance;
}
//Êý×飬Ïë·Åʲô¾Í·Åʲô
public var contacts:ArrayCollection = new ArrayCollection();
}
}
command:
package adobe.commands
{
import adobe.control.AddContactEvent;
import adobe.model.ContactModelLocator;
import adobe.vo.ContactVO;
import com.adobe.cairngorm.commands.Command;
import com.adobe.cairngorm.control.CairngormEvent;
import mx.formatters.DateFormatter;
public class AddContactCommand implements Command
{
public function AddConta
Ïà¹ØÎĵµ£º
ת£ºhttp://www.k-zone.cn/zblog/post/flex-flash-player-gc.html
Flex±à³Ì×¢ÒâÖ®ÐÔÄÜÓÅ»¯¡¢À¬»ø»ØÊÕµÄһЩ×ܽá
×Ô´Ó¿ªÊ¼×öFlex¡¢ActionScript 3.0µÄÏîÄ¿£¬ÎÒ¾ÍÒ»Ö±ÓëÀ¬»ø»ØÊÕ¡¢ÐÔÄÜÓÅ»¯ÕâЩÎÊÌâ´ò½»µÀ£¬Òò´ËÒ²×ܽáÁËһЩÓÅ»¯µÄ·½°¸£¬Í¬Ê±ÔÚһЩQQȺÖÐÒ²µÃµ½ÁËһЩ“¸ßÈË”µÄÖ¸µã£¬Òò´Ë½«´ËÄÚÈݼǼһÏ¡£
ÒÔÏ ......
as:
var app:Object;
function setApp(ap:Object):void{
this.app=ap;
}
btn.addEventListener(MouseEvent.CLICK,onClick);
function onClick(event:MouseEvent):void{
app.fun(btn.label);
}
flex:
private function onSwfLoaded(event:Event):void
{
myloader.addEventListen ......
Flexʼþ»úÖÆÊǹ۲ìÕßģʽ£¬¼´Ê×ÏÈҪע²áʼþ£¬Ê¼þ·Ö·¢ºóͨ¹ýʼþÏìÓ¦º¯Êý½øÐд¦Àí¡£
ÀýÈçÔÚAS3ÖУº
button.addEventListener(¡°click¡±,onClick);//Ïòbutton×¢²áÒ»¸öclickʼþ
internal function onClick(evt:MouseEvent):void{txt.text=¡°click a button!¡±;}//ʼþÏìÓ¦º¯Êý ÄÇôע²áʼþ×¢²áʲôÄØ£¿Í¨ ......
ÉùÃ÷£º×Ô¼ºÏëµÄ¡¢Ð´µÄ¶«Î÷£¬×ªÔØÇë×¢Ã÷³ö´¦£» ²»ÒªÏòÎÒÒª´úÂ룻 from CSDN ID: wander000
Ä¿µÄ£ºÔÚ×öС³ÌÐòʱ£¬ÏÔʾһЩÖØÒªµÄÊý¾ÝÈçÕʺÅÃÜÂëµÈ£¬²»ÏëÈñðÈËÖ±½Ó¿´µ½£¬ÔÚÖ¸¶¨×é¼þÉÏ°´¹æ¶¨ºÃµÄ¹ì¼£»Î¶¯Êó±ê²ÅÏÔʾ¡£
ÎÊÌ⣺һ¡¢Ö±½Ó´ò¿ªÊý¾Ý¿â²»¾Í¿´µ½Ã÷ÂëÁË£¿¶þ¡¢ÔõôÅжÏÊó±ê¹ì¼£µÄÐÎ×´£¿
½â¾ö£ºÒ»¡¢Êý¾Ý¿â´æȡʱÓÃÉÏ¼Ó ......
Õ⼸ÌìҪѧһÏÂflex¿ª·¢£¬µ«ÊÇ°²×°µÄÊÇeclipse²å¼þ°æµÄ£¬¿ÉÊÇ°²×°ºÃºó·¢ÏÖûÓпÉÊÓ»¯µÄ±à¼ÊÓͼ£¬×îºó·¢ÏÖÆäʵÊÇÒòΪflexµÄmxmlÎļþµÄ´ò¿ª·½Ê½ÊÇʹÓõÄspket±à¼Æ÷´ò¿ªµÄ£¬ËùÒÔûÓпÉÊÓ»¯±à¼ÊÓͼ£¬ÓÚÊÇ°ÉspketжÔØÁË¡£¾ÍºÃÁË¡£¼Ç¼һÏ£¬Ï£ÍûÄÜ°ïµ½±ðÈË£¬Ò²ÈÃ×Ô¼º¼Çס ......