ÿÌìѧһµãflash£¨67£© ÉÏ´«Í¼Æ¬
½ñÌì»»¸ö¿Ú棬ÖÆ×÷Ò»ÏÂÉÏ´«Í¼Æ¬£¬¹¦ÄܸöÈËÏ£Íû¾¡Á¿¼òµ¥»¯£¬·½±ãÀí½â£ºFlash cs4 ¶ÔFileReference ÀàÔö¼Ó¼¸ÏîÄÚÈÝ
Èçdata ÊôÐÔÄܹ»»ñÈ¡µ½Ò»¸ödata : ByteArray Õâ¸öÖµ£¬
Save ºÍLoad µÄ·½·¨ÊµÏÖÉÏ´«ºÍ±£´æͼƬ¡£
ÓÐÁËÕâÁ½¸ö¹¦Äܺó£¬ÎÒÃÇ¿ÉÒÔʵÏÖÉÏ´«Í¼Æ¬µÄÄ¿µÄÁË£¬ÅäºÏLoader ¼ÓÔØByteArray ÕâÑù¾ÍÄÜʵÏÖͼƬ½áºÏ¡£²»¹ýÓÐһЩͼƬÏà²á»áÉæ¼°µ½µÈ±ÈËõ·ÅµÄÎÊÌ⣬Õâ¸ö¹¦ÄÜ¿ÉÒÔÌí¼ÓÉÏÈ¥¡£»á¸ü¼ÓÍêÉÆ¡£
ͼƬ¹ýÂË£ºÓÃÓÚ˧ѡͼƬµÄÀàÐÍ£¬²ÉÓÃFileFilterÀà¾ÍÄÜʵÏÖͼƬ¹ýÂË¡£
imagesFilter:FileFilter = new FileFilter("Images", "*.jpg;*.gif;*.png");//ͼƬ¹ýÂË
ÏÂÃæÊÇ´úÂëÇåµ¥£º¿ÉÒÔʵÏÖÒ»ÕÅͼƬÉÏ´«µ½flash player µ±ÖУ¬µ«ÊÇûÓÐʵÏֺͷþÎñÆ÷½»»¥µÄ¹ý³Ì¡£Òò´ËÖ»ÊÇËã°ë³ÉÆ·£¬¿ÉÒÔ×ÔÐÐÍêÉÆ¡£
package
{
//ҪʵÏÖÉÏ´«Ò»ÕÅͼƬµÄ¹¦ÄÜ
import flash.display.Sprite;
import flash.events.*;
import flash.net.*;
import flash.display.SimpleButton;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Loader;
public class Main extends Sprite
{
private var file:FileReference;
private var loader:Loader;
private var imagesFilter:FileFilter = new FileFilter("Images", "*.jpg;*.gif;*.png");//ͼƬ¹ýÂË
public function Main()
{
Btn_add.addEventListener(MouseEvent.CLICK,onClick);//°´Å¥Ìí¼Ó
}
private function onClick(event:MouseEvent):void
{
upLoadImage();
}
//ÉÏ´«Í¼Æ¬
private function upLoadImage():void
{
file=new FileReference();
file.addEventListener(Event.SELECT,selectHandler);
file.addEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);
file.browse([imagesFilter]);
}
private function ioErrorHandler(event:IOErrorEvent):void
{
throw new Error("ÉÏ´«Ê§°Ü");
}
private function selectHandler(event:Event):void
{
file.addEventListener(Event.COMPLETE,loadcompleteHandler);//¼ÓÔØÍê±Ï
file.load();
}
private function loadcompleteHandler(event:Event):void
{
loader=new Loader();//½øÐмÓÔØ
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,imgLoadComplete);//¼à²âͼ
Ïà¹ØÎĵµ£º
µçÄÔÓÐÒ»ÌìͻȻ³öÏÖÁËÒ»¸öÎÊÌ⣬ÔÚÎÒ½øÅ©³¡×¼±¸Ã¿ÈÕ͵²Ëʱ£¬³öÏÖÒ»¸ö½çÃæÒªÎÒÏÂÔØ×îÐÂFLASH²å¼þ£¬ÎÒ°´Í¼±êµã»÷£¬½á¹ûµçÄÔ¸æËßÎÒ°²×°Ê§°Ü£¬ºóÀ´»ù±¾Ã¿´ò¿ªÒ»¸öÍøÒ³¾Íµ¯³öÒªÎÒ°²×°FLASH PLAYERÖ®ÀàµÄ£¬´Ó´ËÎұ㿪ʼÁËÎÒÒì³£ÓôÃƵÄÉÏÍøÉúÑÄ¡£ÔÚÍøÉÏÕÒÁËһЩ½â¾ö°ì·¨£¬È·Ê¼ÖÕû¸ã¶¨&helli ......
ÕâÊÇһƪÀ´×ÔAdobe ¿ª·¢ÕßÖÐÐĵÄÎÄÕ£¬ÓÉRIAMeeting·ÒëС×é³ÉÔ±ÍõºØ·Òë¡£ÔÎĵØÖ·ÊÇ£ºhttp://www.adobe.com/devnet/flashplayer/articles/privacy_mode_fp10.1.html
ÓÐʱºòÄãÏ£ÍûʹÓÃ˽ÃÜä¯ÀÀ·½Ê½À´´ò¿ªÍøÕ¾£¬Adobe Flash Player 10.1 ½«ÔÚ¶à¸öä¯ÀÀÆ÷ÖÐÖ§³Ö˽ÃÜä¯ÀÀ·½Ê½¡£
˽ÃÜä¯ÀÀ½«ÈÃÄãä¯ÀÀÍøÒ³µ«²»ÔÚµçÄÔÉÏÁôÏÂÈκÎÀ ......
ÔÚ֮ǰÖÆ×÷µÄ°æ±¾£¬ÓÉÓÚûÓÐÒýÈ뻺³åµÄЧ¹û£¬¿´ÆðÀ´Ð§¹û²¢²»ºÃ£¬ÕâÒ»´ÎÐÞ¸Äһϣ¬°Ñ֮ǰµÄ¸ÄÔìһϡ£ÓÐÁË»º³åµÄ°ïÖú£¬Ð§¹ûÍêÉÆÁ˺ܶà
µ«ÊÇ»¹ÊÇÓÐÄÚ´æµÄһЩÎÊÌ⣬ÈÃÈ˾õµÃ²»Ë¬¡£
¸Ä½ø°ì·¨£¬¶ÔÿһÕÅͼƬ¼ÓÈëEvent¡£EnterFrame ʼþ£¬Ã¿Ò»Ö¡Ë¢Ð£¬ÕâÑùµÄºÃ´¦Ê¹¶¯»±äµÃÁ¬¹á£¬µ«ÊDz»ºÃµÄµØ·½»áµ¼ÖÂÄÚ´æʹÓùý¶à
ʹ ......
´ó¼ÒÔÚ×öflexÓ¦ÓÃʱÓÐûÓÐÅöµ½Òƶ¯¹ö¶¯Ìõʱ£¬Ò³Ãæ¿Ø¼þÏÔʾˢгٶۣ¬µ¼ÖÂÒ³Ã涼ÊǿؼþµÄ²ÐÓ°£¬¶àÁ˾ÍÏñ»¨ÆÁ£¬ÌرðÊÇÓÃһЩ¸´ÔӵIJ¼¾Ö¡£Õâ¸öÎÊÌâÀ§ÈÅÁËÎÒ¿ì°ë¸öÔ£¬Ò»Ö±Ã»ÕÒµ½ÎÊÌâµÄ¸ùÔ´¡£½ñÌìÎÞÒâÖз¢ÏÖ£¬ÆäʵÕâÎÊÌâ³öÔÚÎÒÃÇflex Ó¦ÓõÄwrapper templateÉÏÁË
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540 ......
ÕâÀïÓÃÁËÁ½ÖÖ·½·¨£¬getURL(”javascript:º¯ÊýÃû”)ºÍExternalInterface£¬ExternalInterface¸üÎȶ¨Ò»Ð©¡£
AS´úÂë:
on (release) {
getURL(”javascript:say(’ÎÒÊÇFlashÖеÄÎÄ×Ö£¬ÓÃgetURL·½·¨’)”);
}
»ò
on (release) {
import flash.external.ExternalInterface;
Externa ......