\n";
for ($i = 0; $i < count($arr_xml['URL']); $i++) {
if( isset($arr_xml['PostID'][$i]) && $arr_xml['PostID'][$i] > 0 ) continue;
echo "
".$arr_xml['BeforeText'][$i]." ".$arr_xml['Text'][$i]." ".$arr_xml['AfterText'][$i]."\n";
}
echo "";
}
}
function tla_updateLocalXML($url, $file, $time_out)
{
if($handle = fopen($file, "a")){
fwrite($handle, "\n");
fclose($handle);
}
if($xml = file_get_contents_tla($url, $time_out)) {
$xml = substr($xml, strpos($xml,''));
if ($handle = fopen($file, "w")) {
fwrite($handle, $xml);
fclose($handle);
}
}
}
function tla_getLocalXML($file)
{
$contents = "";
if($handle = fopen($file, "r")){
$contents = fread($handle, filesize($file)+1);
fclose($handle);
}
return $contents;
}
function file_get_contents_tla($url, $time_out)
{
$result = "";
$url = parse_url($url);
if ($handle = @fsockopen ($url["host"], 80)) {
if(function_exists("socket_set_timeout")) {
socket_set_timeout($handle,$time_out,0);
} else if(function_exists("stream_set_timeout")) {
stream_set_timeout($handle,$time_out,0);
}
fwrite ($handle, "GET $url[path]?$url[query] HTTP/1.0\r\nHost: $url[host]\r\nConnection: Close\r\n\r\n");
while (!feof($handle)) {
$result .= @fread($handle, 40960);
}
fclose($handle);
}
return $result;
}
function tla_decodeXML($xmlstg)
{
if( !function_exists('html_entity_decode') ){
function html_entity_decode($string)
{
// replace numeric entities
$string = preg_replace('~([0-9a-f]+);~ei', 'chr(hexdec("\1"))', $string);
$string = preg_replace('~([0-9]+);~e', 'chr(\1)', $string);
// replace literal entities
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
$trans_tbl = array_flip($trans_tbl);
return strtr($string, $trans_tbl);
}
}
$out = "";
$retarr = "";
preg_match_all ("/<(.*?)>(.*?)", $xmlstg, $out, PREG_SET_ORDER);
$search_ar = array('<', '>', '"');
$replace_ar = array('<', '>', '"');
$n = 0;
while (isset($out[$n]))
{
$retarr[$out[$n][1]][] = str_replace($search_ar, $replace_ar,html_entity_decode(strip_tags($out[$n][0])));
$n++;
}
return $retarr;
}
tla_ads();
?>
Comments (5)
不兼容太郁闷了 话说应该再出个B2到B3的对照表 说说哪些API更改了 原来写的大部分都不能用了 很多包都移除了 郁闷ING
P.S 莫非这是沙发~~
Posted by auzn | December 14, 2007 9:31 AM
Posted on December 14, 2007 09:31
Good 顶一下~
Posted by 呆呆熊 | December 14, 2007 11:08 AM
Posted on December 14, 2007 11:08
Kingda兄,我想要动态创建一个swfLoader并且动态读取。不用MXML来写。但是为什么SWFLoaderCompleteHandler这个函数根本就不执行?
private var perloaderSWFLoader:SWFLoader;
perloaderSWFLoader=new SWFLoader();
perloaderSWFLoader.addEventListener(Event.COMPLETE,SWFLoaderCompleteHandler);
perloaderSWFLoader.source="Resource/AlsoLoader.swf";
perloaderSWFLoader.autoLoad=true;
public function SWFLoaderCompleteHandler(e:Event):void
{
trace("Load Complete!");
addChild(perloaderSWFLoader);
perloaderSWFLoader.scaleContent=true;
perloaderSWFLoader.width=651;
perloaderSWFLoader.height=365;
perloaderSWFLoader.setStyle("horizontalCenter",0);
perloaderSWFLoader.setStyle("verticalCenter",0);
}
我试用了perloaderSWFLoader.load();但是运行时报错.
难道只能用Flash.display.loader来做么?那样做我试过,确实可以。但是却失去了布局的能力。
因为这个swf需要一些特殊的布局.
Posted by Azure | December 16, 2007 10:08 PM
Posted on December 16, 2007 22:08
对于问题的补充:
因为是要修改Flex默认的初始化进度条。所以还要把Flex的加载状态传给swf.所以我需要转换成MovieClip。
我在殿堂之路里面看到的只有把SWFLoader.content as Movieclip,也自己是试验了flash.display.loader转movieclip,发现无法强制转换。
请问这要怎么解决才好。。?
Posted by Azure | December 16, 2007 10:56 PM
Posted on December 16, 2007 22:56
为啥http://download.macromedia.com/pub/labs/air/air_b3_win_121207.exe装不上哩?火星了
Posted by jeff | January 9, 2008 5:31 PM
Posted on January 9, 2008 17:31