C#ÓëFlash½»»¥
C#ÓëFlash½»»¥ £¨×ª×ÔСÀÚÔÚÏߣ©
C#ÓëFlash½»»¥
Ç°¶ÎÈÕ×Ó¹«Ë¾ÒªÇó×öÒ»¸öC#ÓëFlash½»»¥µÄ¶«Î÷£¬ÓÃÀ´C#Óë¶ÌÐÅèͨѶ½«Êý¾Ý´«µ½FlashÉÏÏÔʾÓë²Ù×÷µÄÓ¦Óá£
µÚÒ»²½C#Ìí¼Ó×é¼þ
´ò¿ªVS2005-¹¤¾ß-Ñ¡Ôñ¹¤¾ßÏäÏî-COM×é¼þ-Ñ¡ÔñShockwave Flash Object-È·¶¨
Ìí¼ÓºÃ×é¼þÍù³¡¾°ÉÏÍÏ·Å£¬Èç¹ûÌáʾע²áÐèÇó×¢²á
c# ×¢²á¿Ø¼þ-ÔÚÔËÐÐÊäÈë-»Ø³µ£¨flash9f.ocxÕâ¸öÎļþÒÔϵͳÖÐʵ¼ÊÎļþΪ׼¡££©
regsvr32 c:\windows\system32\macromed\flash\flash9f.ocx
»òÕßregsvr32 c:\windows\system32\macromed\flash\flash10a.ocx
µÚ¶þ²½½«Flash×é¼þÍÏÈ볡¾°
½«Flash×é¼þÍÏÈ볡¾°£¬ÉèÖüÓÔصÄswf·¾¶¡£ÉèÖÃ×é¼þid¡£
×é¼þµÄMovieÊôÐÔ£ºÖ¸¶¨Òª²¥·ÅµÄswfµÄ·¾¶£¬
Èç¹ûswfÔÚ±¾µØÓ²ÅÌ£¬ÔòÐèҪд³É ´ÓÅÌ·û¿ªÊ¼µÄ¾ø¶Ô·¾¶
Èç¹ûswfÔÚijÍøÕ¾ÉÏ£¬ÔòÐèҪд³É ÍêÈ«µÄurlÍøÖ·
¸ü¶à¸Ã×é¼þÊôÐÔ/·½·¨
µÚÈý²½AS´úÂëƬ¶Î
¸Õ¿ªÊ¼ÓÃFSCommandÓëÍøÒ³VBSCRIPT×öÁËÒ»¸öͨѶ£¬ÒÔΪÕâÑù¾ÍÄÜÓëC#ͨѶÁË£¬½á¹û´íÎóÁË¡£
»¹µÃÓÃExternalInterface.addCallback£¬ExternalInterface.callµÄ·½·¨À´ÓëC#ͨѶ¡£
³ÌÐò´úÂë
import flash.external.*;
//ÏòC#·¢ËÍÊý¾Ý
ExternalInterface.call ("test", "str", Math.random ());
//½ÓÊÜC#·¢À´µÄÊý¾Ý
ExternalInterface.addCallback ("c2flash", null, c2flash);
function c2flash (s:String)
{
out_txt.text = s;
}
µÚËIJ½C#´úÂëƬ¶Î
³ÌÐò´úÂë
private void Form1_Load(object sender, EventArgs e)
{
flash.Movie = "E:/c2flash.swf";
flash.FlashCall += new AxShockwaveFlashObjects._IShockwaveFlashEvents_FlashCallEventHandler(flash_FlashCall);
}
void flash_FlashCall(object sender, AxShockwaveFlashObjects._IShockwaveFlashEvents_FlashCallEvent e)
{
string s = nodeXml(e.request.ToString())[0].ChildNodes[0].InnerText.ToString();
//½ÓÊÜFlash´«À´µÄÖµ
this.textBox1.Text = s;
throw new Exception("The method or operation is not implemented.");
}
private void button1_Click(object sender, EventArgs e)
{
&
Ïà¹ØÎĵµ£º
ÒÔÏÂÊÇÎÒÔÚÍøÉÏÕÒµÄÒ»·Ý¹ØÓÚ½â¾öÕâ¸öÎÊÌâµÄ´ð°¸..µ«ÊµÑé¹ýºó¸Ð¾õ²»Ì«¿ÉÐÐ!
___________________________________________________________________
˵µ½Õâ¸öÎÊÌ⣬¿ÉÄÜÓÐÈ˾ͻá˵£¬ÄÇ»¹²»¼òµ¥£¬Ö±½ÓÓÃflashµÄActionScriptÖеÄurl·½·¨²»¾Í¸ã¶¨ÁË£¬ÄÇô
Èç¹ûÎÒÃǵÄUIÈËÔ±Éè¼ÆÍêflash,µ«flash¶ÔÓ¦µÄÁ´½á»¹Ã»ÓÐÈ·¶¨»òÕßÒÔºó» ......
ÔÚ×öasp.netµÄWeb¿ª·¢µÄʱºò£¬ÎÒÃǾ³£»áÓöµ½Ò»´ÎÐÔÉÏ´«¶à¸öÎļþµÄÐèÇó¡£Í¨³£ÎÒÃǵĽâ¾ö·½·¨Êǹ̶¨·Å¶à¸öÉÏ´«Îļþ¿ò£¬ÕâÑùµÄ½â¾ö°ì·¨ÏÔÈ»ÊDz»ºÏÀíµÄ£¬ÒòΪһ´ÎÉÏ´«¶à¸ö£¬¾ÍÒâζ×ÅÊýÁ¿²»È·¶¨¡£Òò´ËÎÒÃǾÍÒªÈÃÕâЩÎļþÉÏ´«¿ò¶¯Ì¬Ìí¼Ó£¬ÏÂÃæÎÒÒÔÎÒ×öµÄÒ»¸öͼ¿â¹ÜÀíÖеÄÉÏ´«Í¼Æ¬µÄ¹¦ÄÜΪÀý
ÏÈ¿´Ð§¹û£º
´ò¿ªµÄ³õʼ½çÃ棺
ĬÈÏ ......
public static class AccessHelper
{
//Êý¾Ý¿âÁ¬½Ó×Ö·û´®
//WebForm
//public static readonly string conn_str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + HttpContext.Current.Request.PhysicalApplicationPath + System.Configuration.ConfigurationManager ......
ÓÉÓÚÎÒµÄÄǸö¡¶Çóflash¿Ø¼þµÄÊôÐÔ¼°Ê¼þ·½·¨ÔÚC#ÖС·Ìû×ÓÓÉÓÚÎÒ×Ô¼ºµÄ»Ø¸´³¬¹ý3´Î£¬ÎÞ·¨¸¡³öË®ÃæÁË¡£
½ñÌì¾¹ýϸÐĵĹ۲ìÍøÂçµÄÀý×Ó,Ã÷°×ÁËһЩflashºÍC#µÄ½»»¥¡£°Ñ¾Ñé·ÖÏí¡£
Àý×Ó£º
private void axShockwaveFlash1_FSCommand(object sender, &nbs ......