flashλͼ¼¼ÊõÑо¿Æª(5)£ºÏñËØ»
½ñÌì¹â¹ËÁËÍâ¹úµÄijһЩ²©¿Í¶ÔλͼµÄÓ¦Ó㬷¢ÏÖ¶ÔλͼµÄ²Ù×÷»á±ä»¯³öºÜ¶àºÜ¶àЧ¹û£¬ÆäÖÐһƪÊÇÏñËØ»µÄʵÏÖ£¬½èÖúÕâÖÖ¶ÔλͼµÄÏñËØ²Ù×÷Ó¦Óã¬ÖØÐÂ×éºÏ³ÉеÄͼƬ£¬È»ºóÆ´ºÏ³ÉÒ»ÕÅеÄͼƬ¡£
˼·ºÜ¼òµ¥¡£½èÓÃÕâÖÖÊÖ·¨Ó¦ÓöÔһЩЧ¹û»áºÜ´ó°ïÖú¡£Èç¾ÛºÏÓë·ÖÉ¢µÄÏñËØ¶¯»¡£
×ó±ßÊÇÒ»ÕÅÕý³£µÄ£¬¶øÓÒ±ßÊÇÒ»Õž¹ýÏñËØ´¦ÀíµÄ»ÒÌ«ÀǵÄͼƬ¡£
ͨ¹ýÍⲿ¼ÓÔØ»ØÀ´µÄͼƬ£¬»ñÈ¡µ½Êý¾ÝÔ´£¬Í¨¹ýÕâ¸öÊý¾ÝÔ´ÎÒÃÇ¿ÉÒÔ½èÓÃbitmapdata ÀàµÄ»ñÈ¡ÏñËØµÄÖµµÄ²Ù×÷£¬Ã¿Ò»¸öÏñËØ°üº¬RBGµÄÖµ£¬Í¨¹ýgetPixel£¨x,y£©Äܹ»¶Ôλͼ½øÐÐÏñËØ»ñÈ¡¡£È»ºó½øÐÐÌî³äʹÓá£×îºó²úÉú³öÓÒ±ßÏñËØµÄ»ÃæµÄЧ¹û¡£Ö÷񻃾¼°µÄ·½·¨Ó¦ÓÃÊÇ
Á½¸öÑ»·»ñÈ¡ÏñËØµÄµÄÖµ¡£
//½øÐÐÏñËØ»ñÈ¡£¬ÖØ×éÏñËØ
for (var i:int=0; i<Width; i+=step)
{
for (var j:int=0; j<Height; j+=step)
{
var color:uint=bmpData.getPixel(i,j);
var rect:Rectangle=new Rectangle(i,j,step,step);
bmpData.fillRect(rect,color);//Ìî³äÏñËØ
}
}
ÏÂÃæÊÇʵÏÖ¹ý³Ì£¬×îÖ÷ÒªÁ˽⵽getPixelÕâ¸ö·½·¨Ê¹Óü´¿É¡£
view plaincopy to clipboardprint?
package
{
import flash.display.Sprite;
import flash.display.Loader;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.events.*;
import flash.net.*;
import flash.geom.Rectangle;
public class Main extends Sprite
{
private var loader:Loader;
private var url:String="3.jpg";
private var step:int=5;
public function Main()
Ïà¹ØÎĵµ£º
TKgame£¨Ìì¿ÕÓÎÏ·£©³ÉÁ¢ÓÚ2004Äê1Ô£¬´Ó×î³õµÄÖйúµÚÒ»¼ÒÍøÂçÓÎÏ·ÍâΧ·þÎñÌṩÉÌ£¬Èç½ñÒѳɳ¤ÎªÖйú×îÓÅÐãµÄÍøÂçÓÎÏ·¿ª·¢¡¢ÔËÓªÉÌÖ®Ò»¡£
¹«Ë¾ÖÂÁ¦ÓÚÍøÂçÓÎÏ·µÄ¿ª·¢ÓëÔËÓª£¬²¢»ý¼«Ì½Ë÷ÍøÒ³ÓÎÏ·Óë¿Í»§¶ËÓÎÏ·µÄ½áºÏģʽ¡£2008Ä꣬TkgameÕýʽ¿ªÊ¼ÆìϵÚÒ»¿îÍøÂçÓÎÏ·¡¶ÀÖÍÁ¡·µÄÔËÓª£¬¸Ã²úÆ·Ò»¾ÍƳö±ã»ñµÃÒµ½çºÍÍæ¼ÒµÄ¼«´óºÃÆÀ¡ ......
µçÄÔÓÐÒ»ÌìͻȻ³öÏÖÁËÒ»¸öÎÊÌ⣬ÔÚÎÒ½øÅ©³¡×¼±¸Ã¿ÈÕ͵²Ëʱ£¬³öÏÖÒ»¸ö½çÃæÒªÎÒÏÂÔØ×îÐÂFLASH²å¼þ£¬ÎÒ°´Í¼±êµã»÷£¬½á¹ûµçÄÔ¸æËßÎÒ°²×°Ê§°Ü£¬ºóÀ´»ù±¾Ã¿´ò¿ªÒ»¸öÍøÒ³¾Íµ¯³öÒªÎÒ°²×°FLASH PLAYERÖ®ÀàµÄ£¬´Ó´ËÎұ㿪ʼÁËÎÒÒì³£ÓôÃÆµÄÉÏÍøÉúÑÄ¡£ÔÚÍøÉÏÕÒÁËһЩ½â¾ö°ì·¨£¬È·Ê¼ÖÕû¸ã¶¨&helli ......
´ó¼ÒÔÚ×öflexÓ¦ÓÃʱÓÐûÓÐÅöµ½Òƶ¯¹ö¶¯Ìõʱ£¬Ò³Ãæ¿Ø¼þÏÔʾˢгٶۣ¬µ¼ÖÂÒ³Ãæ¶¼ÊǿؼþµÄ²ÐÓ°£¬¶àÁ˾ÍÏñ»¨ÆÁ£¬ÌرðÊÇÓÃһЩ¸´ÔӵIJ¼¾Ö¡£Õâ¸öÎÊÌâÀ§ÈÅÁËÎÒ¿ì°ë¸öÔ£¬Ò»Ö±Ã»ÕÒµ½ÎÊÌâµÄ¸ùÔ´¡£½ñÌìÎÞÒâÖз¢ÏÖ£¬ÆäʵÕâÎÊÌâ³öÔÚÎÒÃÇflex Ó¦ÓõÄwrapper templateÉÏÁË
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540 ......
Χ½Ë Flash µÄ²»½öÓÐ HTML 5£¬»¹ÓÐ JavaScript£¬ÖøÃûµÄ JavaScript ¿ò¼Ü jQuery
ÔÚÔ˶¯ÌØÐ§·½ÃæÒѾԽÀ´Ô½Á÷³©£¬ÓÐʱºòÄãÐèÒªµãÒ»ÏÂÓÒ¼üÀ´È·ÈÏËü²»ÊÇ Flash¡£±¾ÎĽéÉÜÁË10¸ö·Ç³£³öÉ«µÄ jQuery
Ô˶¯ÌØÐ§£¬ÕâЩЧ¹û¿ÉÒÔ¸üÓÐЧµØÕ¹Ê¾ÄãµÄÄÚÈÝ¡£
1. Á÷¸Ðµ¼º½²Ëµ¥
ÏÂÃæµÄµ¼º½²Ëµ¥£¬µ±Êó±êÔÚÉÏÃæÒÆ¶¯µÄʱºò£¬»áºÜÁ÷³©µØ´¹Ï ......
½ñÌì»»¸ö¿Úζ£¬ÖÆ×÷Ò»ÏÂÉÏ´«Í¼Æ¬£¬¹¦ÄܸöÈËÏ£Íû¾¡Á¿¼òµ¥»¯£¬·½±ãÀí½â£ºFlash cs4 ¶ÔFileReference ÀàÔö¼Ó¼¸ÏîÄÚÈÝ
Èçdata ÊôÐÔÄܹ»»ñÈ¡µ½Ò»¸ödata : ByteArray Õâ¸öÖµ£¬
Save ºÍLoad µÄ·½·¨ÊµÏÖÉÏ´«ºÍ±£´æÍ¼Æ¬¡£
ÓÐÁËÕâÁ½¸ö¹¦Äܺó£¬ÎÒÃÇ¿ÉÒÔʵÏÖÉÏ´«Í¼Æ¬µÄÄ¿µÄÁË£¬ÅäºÏLoader ¼ÓÔØByteArray ÕâÑù¾ÍÄÜʵÏÖͼƬ½áº ......