swfmillã使ã£ã¦åçã«FlashLite1.1ãä½æããæ¹æ³ï¼ç»åç½®æï¼
swfmillã使ã£ã¦åçã«FlashLite1.1ãä½æããæ¹æ³ã§ãã
#æã£ã¦ããæºå¸¯ã¯Androidã§ç»é¢ã¯ãã¡ã³ãã§ã(^^;
ã¡ããã¨åå¼·ãã¦ãã©ã³ãã å¾
ã¡åãFlashãä½ã£ã¦ã¿ãããªãã£ã¦æãããã£ãããªã®ã§ããã®æé ã説æãããã¨æãã¾ãã
å¿
è¦ã¨ãªããã®
swfmillï¼cygwin版のパッチ入りswfmillのダウンロードï¼
Flash CS( Flash Liteä½æç°å¢ )
1æ30kb以å
ã®ç»åï¼æ
#ä»ã¾ã§ã®è¨äºãswfmillで動的FlashLite作成!ãã©ããã
Flash CSã使ç¨ãã¦ãã³ãã¬ã¼ããªFlashLiteãä½æ
Flash CSãèµ·åãããä½æã¦ã£ã¶ã¼ãã§ã¢ãã¤ã«çãé¸æã
解å度ã¯240x340ç¨åº¦ãããã¿ããã
ç»åããã¬ã¼ã ãã¨ã«ï¼ç¨®é¡é
ç½®ããã¡ã¤ã«âèªã¿è¾¼ã¿âã©ã¤ãã©ãªã«èªã¿è¾¼ã¿ã§é
ç½®ã§ããããã«ãªãã¾ãã
ã¿ã¤ã ã©ã¤ã³ã§å³ã¯ãªãã¯âãã¼ãã¬ã¼ã ã®æ¿å
¥ãªã©ã§ãã¬ã¼ã ãåå²ãã¦ããããã¾ãã¡èªåããã®è¾ºãè¦æã
ç»åï¼ãè¨å®
ç»åï¼ãè¨å®
ç»åï¼ãè¨å®
次ã«ã©ã³ãã 表示ã«ãªãããã«actionãã¬ã¼ã ã®ï¼ãã¬ã¼ã ç®ã«ä»¥ä¸ã®actionscriptãè¨è¿°ã
ã©ã³ãã ã§2,3,4ãã¬ã¼ã ã«é£ãã§ã¹ããããã¾ãã
i=random(3)+2; gotoAndStop(i);
CTRL+Enterã§åä½ã確èªã§ãã¾ãã
ãã¡ã¤ã«âæ¸ãåºãâã¤ã¡ã¼ã¸ã®æ¸ãåºãã§template.swfã¨åºåããã°ãã³ãã¬ã¼ãã®å®äºã¨ãªãã¾ãã
ä»å¾ããã®ãã³ãã¬ã¼ããªswfãã¡ã¤ã«ã使ã£ã¦åçã«FlashLiteãä½æãã¦ããã¾ãã
Flaãã¡ã¤ã«ã®ãã¦ã³ãã¼ã
http://moeten.info/flex/20090903_flashlite/template.fla
swfmillã使ç¨ãã¦swfãxmlã«å¤æ
swfmillã使ç¨ãã¦å ã»ã©ä½æãããã³ãã¬ã¼ããªswfãxmlã«å¤æã
swfmill swf2xml template.swf > template.xml
template.xmlã®ãã¦ã³ãã¼ã
http://moeten.info/flex/20090903_flashlite/template.xml
ãã³ãã¬ã¼ãxmlãã¡ã¤ã«ãç·¨é
xmlãã¡ã¤ã«ãéãã¦ãç»åãæ ¼ç´ããã¦ããé¨åãPHPãç½®æããããããã«%IMAGE1%ãªã©ã¨æ¸ããããã
ï¼é·ãæååãã£ã½ãæåã®ç¾
åãããé¨åãç»åã
ä»åã¯ä»¥ä¸ã®ããã«ä¿®æ£ãã¾ããã
<?xml version="1.0" encoding="UTF-8"?> <swf version="4" compressed="0"> <Header framerate="24" frames="4"> <size> <Rectangle left="0" right="4800" top="0" bottom="6800"/> </size> <tags> <SetBackgroundColor> <color> <Color red="255" green="255" blue="255"/> </color> </SetBackgroundColor> <DoAction> <actions> <PushData> <items> <StackString value="i"/> </items> </PushData> <PushData> <items> <StackString value="3"/> </items> </PushData> <Random/> <PushData> <items> <StackString value="2"/> </items> </PushData> <AddCast/> <SetVariable/> <PushData> <items> <StackString value="i"/> </items> </PushData> <GetVariable/> <GotoExpression play="0"/> <PushData> <items> <StackString value="t"/> </items> </PushData> <GetVariable/> <Pop/> <EndAction/> </actions> </DoAction> <ShowFrame/> <DefineBitsJPEG2 objectID="1"> <data> <data>%IMAGE1%</data> </data> </DefineBitsJPEG2> <DefineShape objectID="2"> <bounds> <Rectangle left="0" right="4800" top="0" bottom="6800"/> </bounds> <styles> <StyleList> <fillStyles> <ClippedBitmap objectID="1"> <matrix> <Transform scaleX="20.00000000000000" scaleY="20.00000000000000" transX="0" transY="0"/> </matrix> </ClippedBitmap> </fillStyles> <lineStyles/> </StyleList> </styles> <shapes> <Shape> <edges> <ShapeSetup fillStyle1="1"/> <LineTo x="4800" y="0"/> <LineTo x="0" y="6800"/> <LineTo x="-4800" y="0"/> <LineTo x="0" y="-6800"/> <ShapeSetup/> </edges> </Shape> </shapes> </DefineShape> ã ä¸ç¥ ã <PlaceObject2 replace="1" depth="1" objectID="6"/> <ShowFrame/> <End/> </tags> </Header> </swf> EOD;
template_php.xmlã®ãã¦ã³ãã¼ã
http://moeten.info/flex/20090903_flashlite/template_php.xml
PHPã使ç¨ãã¦ç»åé¨åãç½®æããã
PHPã§ç»åãç½®æã
//ãã³ãã¬ã¼ãxmlãã¡ã¤ã«ã®åå¾ $template = file_get_contents( "template_php.xml" ); //ç»åbase64ã¸ã¨ã³ã³ã¼ã $image1 = base64_encode( file_get_contents( "image1.jpg" ) ); $image2 = base64_encode( file_get_contents( "image2.jpg" ) ); $image3 = base64_encode( file_get_contents( "image3.jpg" ) ); //base64æååã«æ¹è¡æåãããã¨ãã°ãå ´åãããã®ã§åãé¤ã $arr_from = array( "\r\n", "\r", "\n" ); $arr_to = array( "" , "" , "" , ); $image1 = str_replace( $arr_from , $arr_to , $image1 ); $image2 = str_replace( $arr_from , $arr_to , $image2 ); $image3 = str_replace( $arr_from , $arr_to , $image3 ); //ç»åã®ç½®æï¼æ¸ãè¾¼ã¿ï¼ $template = str_replace( $arr_from , $arr_to , $template ); $arr_from = array( "%IMAGE1%", "%IMAGE2%", "%IMAGE3%" ); $arr_to = array( $image1, $image2, $image3 ); $template = str_replace( $arr_from , $arr_to , $template ); //ç½®ææ¸ã¿xmlãã¡ã¤ã«ãåºå file_put_contents( "template_new.xml" , $template );
以ä¸ã§ãã³ãã¬ã¼ããã¡ã¤ã«ã®ç»åé¨åãç½®æããããã¨ãã§ãã¾ããã
ç½®æãã¦ã§ããæ°ãããã³ãã¬ã¼ããã¡ã¤ã«ããã¦ã³ãã¼ã
http://moeten.info/flex/20090903_flashlite/template_new.xml
swfmillã使ç¨ãã¦xmlãã¡ã¤ã«ãswfã«å¤æ
次ã«ç»åãç½®æããxmlãã¡ã¤ã«ãswfã«å¤æãã¾ãã
swfmill xml2swf template_new.xml > template_new.swf
ããã§ã©ã³ãã å£ç´ã®FlashLiteãããã°ã©ã ã§ä½æã§ãã¾ããã
å®éã®ãµã³ãã«ã¯ãã¡ã
ãããªæããæè¨ã¯auã®æ©è½ã§ãã
http://moeten.info/maidcafe/i/?&m=s&id=123
æºå¸¯ããã¢ã¯ã»ã¹ããã¨FlashLiteã表示ããã¾ãã
ãã½ã³ã³ããã§ããã¼ã¸ã表示ããå¾ãå³ã¯ãªãã¯âåçã§ã©ããªæãã«ãªããè¦ãã¾ãã
表示ãããFlashãä¿åãã¦å£ç´å¾
ã¡åãã«è¨å®ããã¨ãæºå¸¯ãéããã³ã«ç»åãã©ã³ãã ã§è¡¨ç¤ºããã¾ãã
ä½æããä¸ã§æ°ãã¤ããç¹
ä½æããä¸ã§æ°ãã¤ããç¹ã
FlashLiteã¯100kb以å
ç»åãç½®æããå ´åã¯ç»åãbase64ã«ããã¹ãå¤æããéãæ¹è¡æåãåé¤ãã¦ããã
swfãã¡ã¤ã«ã«ç´æ¥ã¢ã¯ã»ã¹ããããsoftbankã§ã¯
<?php echo file_get_contents( "template_new.swf" ); ?>
ãªã©ã§ç´æ¥swfãã¡ã¤ã«ãåºåããã¨ã表示ã¯ã§ããããä¿åãã§ããªãã®ã§ã
<?php header( "HTTP/1.1 302 Found(Moved Temporary)" ); header( "Location: http://moeten.info/maidcafe/i/flashlite/template_new.swf" ); ?>
ã¨ãã¦ç´æ¥ãã¡ã¤ã«ã«ã¢ã¯ã»ã¹ãããã¦swfãã¡ã¤ã«ãéãããã
åèã«ãªããµã¤ã
以ä¸ãã¨ã¦ãåèã«ãªããã¼ã¸ã§ãã