TypeError: Error #1034: 強ÖÆÐÍ変換¤Ëʧ敗¤·¤Þ¤·¤¿¡£jp.co.nec.necst.pi.ap2web::TestEvent@1645ee79 ¤ò jp.co.nec.necst.pi.ap2web.TestEvent ¤Ë変換¤Ç¤¤Þ¤»¤ó¡£
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9156]
at UserDetail/navToUserSet()[D:\program\eclipse\workspace\netboard\flex_src\UserDetail.mxml:190]
at UserDetail/___UserDetail_Button3_click()[D:\program\eclipse\workspace\netboard\flex_src\UserDetail.mxml:305]
ÕâÁ½Ìì×öflexÅöµ½ÉÏÃæÕâ¸öÎÊÌ⣬Ö÷ÒªÊÇFlexÄ£¿éͨ¹ýʼþ´«ÖµÊ±·¢ÉúÁËÕâ¸ö´íÎ󣬵÷ÊÔÁË°ëÌì·¢ÏÖdispatchEvent(event)µÄʱºò³öÏÖ£¬
µ«Ò»Ö±ÕÒ²»µ½½â¾ö°ì·¨£¬TestEventÊÇ×Ô¼º¶¨ÒåµÄʼþ£¬×Ô¼º×ª»»×Ô¼º»¹×ª»»²»ÁË£¬ÓôÃƵ½¹Ò£¡
ºóÀ´ÎÞÄλ»ÁËÁíÒ»ÖÖ·½·¨´«Öµ£¬³É¹¦´«Öµ£¬µ«ÊǵãÏÂÀ¿òʱÓÖ·¢ÉúDragManagerImpl@12631a61ת»»Îª mx.managers.IDragManager±¨´í£¬ÉÏGoogleËÑË÷ÁËÏ£ ......
ÔÚFlexÀһ°ãµÄµ¯³ö´°¿Ú£¨³ýÁËAlertÒÔÍ⣩¶¼¿ÉÒÔÓÃTitleWindow×é¼þÍê³É£¬Ö÷´°¿ÚºÍTitleWindowµÄÊý¾Ý´«Êä¿ÉÒÔÓÃÒÔÏ·½·¨£º
¼ÙÉèTitleWindowµÄʵÀýÎļþΪtitleWin.mxml£¬ÔòÒªÔÚApplicationÖÐÓÃPopUpManager´´½¨Ò»¸ötitleWinµÄÒýÓÃ
private var popWin:titleWin = titleWin(PopUpManager.createPopUp(this,titleWin,true));
Èç¹ûÒª½«ApplicationµÄÒ»¸ö×é¼þµÄÖµ´«¸øtitleWin£¬ÈçApplicationµÄid="userName"µÄTextInputµÄÖµ´«¸øtitleWin,±ØÐëÏÈÔÚtitleWin.mxmlÀïÉùÃ÷Ò»¸öTextInputµÄ×é¼þ£º
public var userNameInPop:TextInput;
È»ºóÔÚApplicationÀ
popWin.userNameInPop=userName;
ÕâÑù¾ÍÏ൱ÓÚ°ÑApplicationµÄuserNameµÄTextInput×é¼þ´«¸øÁËtitleWin,¿ÉÒÔÔÚtitleWin.mxmlÀï°ó¶¨Õâ¸öֵȻºóÔÚÎı¾¿òÀïÏÔʾ³öÀ´:
[Bindable]
public var userNameInPop:TextInput;
<mx:TextInput x="110" y="39" id="popUserName" text="{userNameInPop.text}"/>
¶øÒª°ÑtitleWinµÄÖµ´«¸øApplicationÔòÖ»ÐèÔÚtitleWin.mxmlÀï°ÑTextInputµÄÖµ¸³¸øuserNameInPopµÄtext¼´¿É£º
userNameInPop.text=popUserName.text;
È«²¿´úÂëÈçÏÂ:
titleWin.mxml
<?xml version="1.0" encodi ......
FlexÓ¦ÓõĸùÊÇSystemManger£¬ËüÊÇflash.display.MovieClipµÄ×ÓÀ࣬һ¸öFlash PlayerÏÔʾ¶ÔÏóÀàÐÍ¡£SystemManagerÓÐÁ½¸öÖ¡£¬µÚÒ»Ö¡ÊÇÓÃÀ´ÏÔʾӦÓÃÔØÈëµÄ½ø¶Èָʾ£¬Õâ¸öÖ¡ÊÇÇáÁ¿µÄ£¬ËùÒÔËü¼¸ºõÄÜÁ¢¼´ÏÂÔغÍÔËÐС£µÚ¶þÖ¡±ãÊÇÓ¦Óñ¾Éí¡£µ±Ò»¸öFlexÓ¦ÓõÄSystemManagerʵÀý½øÈëµ½µÚ¶þÖ¡£¬Ëü´´½¨Ò»¸öÖ÷Ó¦ÓõÄʵÀý¡£SystemManagerʵÀýÓÐÒ»¸öapplicationÊôÐÔ,ÔÚËüµÚ¶þÖ¡´´½¨Ó¦ÓöÔÏó֮ǰ£¬ËüÊÇnullµÄ¡£ÔÚÄǸöµã£¬Ó¦ÓÃʵÀý±»³õʼ»¯²¢ÔËÐÐËü×Ô¼ºµÄÆô¶¯´¦Àí¡£ÒâÖ¸ËùÓеÄÓ¦ÓöÔÏóÄÚ²¿µÄÉúÃüÖÜÆÚʼþ·¢Éú¡£ÄÚ²¿µÄÉúÃüÖÜÆÚʼþΪ£º preinitializeÓ¦Óñ»³õʼ»¯£¬µ«ÈÔû´´½¨ÈκÎ×Ó×é¼þ¡£ initializeÓ¦ÓÃÒÑ´´½¨×Ó×é¼þ£¬µ«¼«²¼¾ÖÕâЩ×é¼þ¡£ creationCompleteÓ¦ÓÃÒѱ»³õʼʵÀý»¯Íê³É£¬²¢ÒѲ¼¾ÖËùÓеÄ×é¼þ¡£Ò»µ©Ó¦ÓÃÍê³ÉËüµÄÄÚ²¿Æô¶¯´¦Àí£¬Ëüͨ¹ý·Ö·¢applicationCompleteʼþ֪ͨSystemManager¡£´ÓÕâ¸öµãÖ®ºó£¬Ó¦ÓÃ×¼±¸ÔËÐÐÁË¡£ SystemManagerÒ²¹ÜÀíËùÒÔ±»ÔÚǰ̨ÏÔʾµÄÄÚÈÝ£¬¼´ËùÓеÄpop ups£¬¹â±ê£¬¹¤¾ßÌáʾ¡£ SystmeManager ÓÐÒ»¸ötoplevelSystemManagerµÄÊôÐÔ£¬ÒýÓõ½µ±Ê±ÔÚFlashPlayerÀïÔËÐеĸù¼¶µÄSystemManagerʵÀý¡£µ±Ò»¸öÓ¦ÓÃÊÇ×÷ΪFlashPlayerµÄÖ÷Ó¦Óñ»ÔØÈëµÄ£¬Õâ¸öÊôÐÔ×ÜÊÇ×ÔÒýÓõģ¬ ......
¾³£ÔÚDemoÖлῴµ½ÁÐ±í£¬±í¸ñµÈ·½Ê½À´ÏÔʾÊý¾Ý¡£µ±È»ÓÐʱºòÒ²ÐèÒªÌí¼ÓÊý¾Ýµ½ÕâЩÁбí»òÕß±í¸ñÖС£Óкܶ෽ʽÌá½»£¬ÕâÀïչʾһ¸öµ¯³ö´°¿ÚµÄ·½Ê½À´Ìí¼ÓеÄÊý¾Ýµ½DataGridÖС£
Àý×Óչʾ£º
Ê×ÏÈ£¬ÎÒÃÇ¿ªÊ¼½¨ÉèÒ»¸ö»ù±¾µÄ½çÃæ½á¹¹£¬Ò»¸ö´øÓС°Notes"±êÌâµÄPanel,Ò»¸öDataGrid£¬ÒÔ¼°Ò»¸öÓÃÓÚÌá½»Êý¾ÝµÄ°´Å¥¡£
Xml´úÂë
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
width="500" height="300">
<mx:Panel title="Notes"
width="100%" height="100%"
layout="vertical" horizontalAlign="right"
paddingTop="3" paddingLeft="3" paddingRight="3" paddingBottom="3">
<mx:DataGrid width="100%" height="100%">
<mx ......
×î½üÔÚÏîÄ¿ÖÐÓöµ½flex¿çÓò·ÃÎʵݲȫɳÏäÎÊÌ⣬²é×ÊÁÏÁ˽⵽ÐèÒªÔÚ·þÎñ¶Ë¼ÓÉÏcrossdomain.xmlÎļþ£¬¼´£º
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*"/>
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
µ«¶ÔÓÚ¾ßÌå´æ·ÅÔÚweb·þÎñµÄÄǸöĿ¼Ï£¬Ò»Ö±À§»ó²»ÒÑ£¬×îÖÕ·¢ÏÖÔÚÒ»°ãÇé¿öÏÂ(ÔÚ´ËÒÔ·þÎñÆ÷ΪtomcatΪÀý˵Ã÷)´æ·ÅÔÚ
webapps/ROOT/ Ï£¬¼´ËùνµÄ¸ùĿ¼£¬ÇÒƲ¿ªÕâÌõ¹æÔò£¬Ò»ÑÔÒÔ±ÎÖ®£¨ËùÓÐÇé¿ö¶¼Í¨Óã©£ºÖ»ÒªÄã¿ÉÒÔͨ¹ý
http://127.0.0.1:8080/crossdomain.xml·ÃÎʵ½¸Ãxml ¾Í¿ÉÒÔÁË¡£ ......
×î½üÔÚÏîÄ¿ÖÐÓöµ½flex¿çÓò·ÃÎʵݲȫɳÏäÎÊÌ⣬²é×ÊÁÏÁ˽⵽ÐèÒªÔÚ·þÎñ¶Ë¼ÓÉÏcrossdomain.xmlÎļþ£¬¼´£º
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*"/>
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
µ«¶ÔÓÚ¾ßÌå´æ·ÅÔÚweb·þÎñµÄÄǸöĿ¼Ï£¬Ò»Ö±À§»ó²»ÒÑ£¬×îÖÕ·¢ÏÖÔÚÒ»°ãÇé¿öÏÂ(ÔÚ´ËÒÔ·þÎñÆ÷ΪtomcatΪÀý˵Ã÷)´æ·ÅÔÚ
webapps/ROOT/ Ï£¬¼´ËùνµÄ¸ùĿ¼£¬ÇÒƲ¿ªÕâÌõ¹æÔò£¬Ò»ÑÔÒÔ±ÎÖ®£¨ËùÓÐÇé¿ö¶¼Í¨Óã©£ºÖ»ÒªÄã¿ÉÒÔͨ¹ý
http://127.0.0.1:8080/crossdomain.xml·ÃÎʵ½¸Ãxml ¾Í¿ÉÒÔÁË¡£ ......
ÀûÓÃSocketʵÏÖC++ÓëFlexͨÐÅ
Ò»¡¢C++·þÎñÆ÷¶Ë
£¨ÓõÄÊÇVisual Studio 2008£¨05£¬03µÄÓ¦¸ÃÒ²¿ÉÒÔ£¬VC++µÄ¿ÉÄÜÐèÒªÉÔ΢¸Ä¶¯£©£©
´úÂëÈçÏ£º
#include <winsock2.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
using namespace std;
#pragma comment(lib,"ws2_32.lib")
void main(){
WORD wVersionRequested;
WSADATA wsaData;
int err;
short port=1300;//¶Ë¿ÚºÅ
wVersionRequested = MAKEWORD( 1, 1 );
err = WSAStartup( wVersionRequested, &wsaData );//³õʼ»¯Ì×½Ó×Ö
if ( err != 0 )
{
return;
}
if ( LOBYTE( wsaData.wVersion ) != 1 || HIBYTE( wsaData.wVersion ) != 1 )
{
WSACleanup( );
return;
}
SOCKET sockSrv=socket(AF_INET,SOCK_STREAM,0);//´´½¨Ì×½Ó×Ö
SOCKET sockConn;//ÓÃÀ´ºÍ¿Í»§¶ËͨÐŵÄÌ×½Ó×Ö
SOCKADDR_IN addrSrv;//ÓÃÀ´ºÍ¿Í»§¶ËͨÐŵÄÌ×½Ó×ÖµØÖ·
......
ÀûÓÃSocketʵÏÖC++ÓëFlexͨÐÅ
Ò»¡¢C++·þÎñÆ÷¶Ë
£¨ÓõÄÊÇVisual Studio 2008£¨05£¬03µÄÓ¦¸ÃÒ²¿ÉÒÔ£¬VC++µÄ¿ÉÄÜÐèÒªÉÔ΢¸Ä¶¯£©£©
´úÂëÈçÏ£º
#include <winsock2.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
using namespace std;
#pragma comment(lib,"ws2_32.lib")
void main(){
WORD wVersionRequested;
WSADATA wsaData;
int err;
short port=1300;//¶Ë¿ÚºÅ
wVersionRequested = MAKEWORD( 1, 1 );
err = WSAStartup( wVersionRequested, &wsaData );//³õʼ»¯Ì×½Ó×Ö
if ( err != 0 )
{
return;
}
if ( LOBYTE( wsaData.wVersion ) != 1 || HIBYTE( wsaData.wVersion ) != 1 )
{
WSACleanup( );
return;
}
SOCKET sockSrv=socket(AF_INET,SOCK_STREAM,0);//´´½¨Ì×½Ó×Ö
SOCKET sockConn;//ÓÃÀ´ºÍ¿Í»§¶ËͨÐŵÄÌ×½Ó×Ö
SOCKADDR_IN addrSrv;//ÓÃÀ´ºÍ¿Í»§¶ËͨÐŵÄÌ×½Ó×ÖµØÖ·
......