Flex´ÓÒ³Ãæurl»ñÈ¡²ÎÊý£¨×ܽᣩ
¹ØÓÚflexÈçºÎÏòij¸öÒ³Ãæ´«µÝ²ÎÊý£¬ÎÒÒÔÇ°ÓÐÕâ·½ÃæµÄ±Ê¼Ç£¬flexͨ
¹ý·ÇAmfPHP;¾¶Óëºǫ́½»»¥
ÖÐURLLoader+URLRequest+URLVariables·½·¨Ò²¿ÉÒÔÓÃÓÚÏòflexÒ³Ãæ´«²ÎÊý¡£ºó
̨php¶Ë½ÓÊÕ²ÎÊýºÜ¼òµ¥£¬ÏÖÔÚÌÖÂÛÒ»ÏÂflex¶ËÈçºÎ´¦ÀíÒ³Ãæurl´«µÝ¹ýÀ´µÄ²ÎÊý¡£
ÍøÉÏÕâ·½ÃæÎÄÕ²»ÉÙ£¬²»¹ý¶¼¶àÉÙÓÐЩÎÊÌ⣬ÎÒ×ܽáһϣ¬Ð´ÔÚÕâÀï¡£
·½·¨Ò»£º
flex½ÓÊÕÍøÒ³´«Öµ£¡~
Code
1
<?
xml version
=
"
1.0
"
encoding
=
"
utf-8
"
?>
2
<
mx:Application xmlns:mx
=
"
http://www.adobe.com/2006/mxml
"
layout
=
"
absolute
"
3
applicationComplete
=
"
initApp()
"
>
4
5
<
mx:Label text
=
6
"
Will run the app deployed at http://{serverURL}:{port}/MyGreatApp.html
"
/>
7
<
mx:Script
>
8
<!
[CDATA[
9
[Bindable]
10
var serverURL:String;
11
12
[Bindable]
13
var port:String;
14
15
function initApp():
void
{
16
serverURL
=
Application.application.parameters.serverURL;
17
port
=
Application.application.parameters.port
18
}
19
]]
>
20
</
mx:Script
>
21
</
mx:Application
>
×÷ÕßÔÚÎÄÕÂ×îºóд£º“ÍⲿÒÔtest.swf?serverURL=String&port=String µÄÐÎʽÔÚÍøÒ³Öе÷Óã¡”
ÕâÑù×öȷʵûÓÐÎÊÌ⣬µ«Æ½Ê±µÄflex³ÌÐò¶¼ÊÇÒÔhtmlΪÈÝÆ÷½«swfÎļþ°ü×°ÁËÆðÀ´¡£Èç¹ûÓÃtest.html?serverURL=String&
amp;port=StringµÄ·½Ê
Ïà¹ØÎĵµ£º
4. Àí½âʼþ½×¶Î(Event Phases) ÎÒÃÇ°Ñʼþ´¥·¢Ô´·ÖΪÁ½ÀࣺһÀàÊÇÄÇЩÏÔʾÔÚ½çÃæÖеÄÔªËØÅ׳öµÄʼþ£¬Ò»ÀàÊÇÄÇЩ²»ÔÚ½çÃæÖÐÏÔʾµÄÔªËØÅ׳öµÄʼþ¡£ºÜ¼òµ¥£¬¾Ù¸öÀý×Ó£ºµÚÒ»ÀàÈçURLLoader¶ÔÏóÈ¥loadͼƬ»òÆäËû×ÊÔ´ËùÅ׳öµÄÈçcompleteʼþ£¬¾ÍÊôÓÚµÚÒ»Àà¡£½çÃæÉϵÄÒ»¸ö°´Å¥ËùÅ׳öµÄclickʼþ¾ÍÊǵڶþÀ࣬Ëü»á´¥·¢Ò»¸öʼþÁ÷£¬ ......
·µ»ØÊý¾ÝµÄ¸ñʽresultFormatÓм¸ÖÖÀàÐÍ£¬object¡¢array¡¢xml¡¢flashvars¡¢textºÍe4x£¬Ä¬ÈϵÄÉèÖÃΪobject¡£
RESULT_FORMAT_ARRAY : String = "array"
[] ½á¹û¸ñʽ“array”Óë“object”ÏàËÆ£¬µ«ÊÇÆä·µ»ØµÄֵʼÖÕΪÊý×飻ÕâÑù£¬Èç¹û´Ó½á¹û¸ñʽ“object”·µ»ØµÄ½á¹ûÉв»ÊÇÊý×飬Ôò½«°Ñ¸ÃÏî ......
Summary(¸ÅÊö)£º Adobe Flex µÄ dataGrid ÓкÜÇ¿´óµÄ¹¦ÄÜ£¬±ÈÈçItemRenderer,headerRendererµÈ£¬¿ÉÒÔ·½±ãµØʵÏÖ×Ô¼ºÏëÒªµÄ¹¦ÄÜ¡£µ«¶ÔdataGridÖ±½Ó±à¼²¢±£´æµ½Service¶Ë£¬¾ÍÓеãÂé·³ÁË¡£
Requirement(ÐèÇó)£º ¶ÔdataGrid½øÐе¥Î»¸ñ±à¼£¬ÈôÓб仯£¬±£´æµ½Service; ·ñÔò²»±£´æ¡£
Solution(½â¾ö·½°¸): ÔËÓÃDataGrid µÄ  ......
ÍøÉÏÄܲ鵽ºÜ¶àÀàËÆ×ÊÁÏ£¬µ«ÍêÕûÐÔ²»¸Ò¹§Î¬¡£ÒÔÏÂÊǽâ¾ö·½°¸¼°Òªµã£º
·½·¨Ò»£º
ͨ¹ýurlµÄ·½Ê½Ïòflex´«²ÎÊý
µÚ1²½£ºÔÚÍøÒ³ÖÐÉèÖÃÒ»¸öÁ´½Ó£¬Èç <a
href="test.jsp?p1=test1&p2=test2">²âÊÔÁ´½ÓÒ»</a>£¬ÆäÖÐtest.jspǶÈëÁË
flash
µÚ2²½£º»ñÈ¡²ÎÊý
var params:Object
=URLUtil.parseUrlPara ......