js µ÷ÓÃflash ½Ó¿Úº¯Êý
ExternalInterfaceExample.as
ÒÔÏÂʾÀýÑÝʾÁËÔÚ Flash Player Óë HTML ÈÝÆ÷Ö®¼ä·¢ËÍÊý¾ÝµÄ¹ý³Ì¡£
package {
import flash.display.Sprite;
import flash.events.*;
import flash.external.ExternalInterface;
import flash.text.TextField;
import flash.utils.Timer;
import flash.text.TextFieldType;
import flash.text.TextFieldAutoSize;
public class ExternalInterfaceExample extends Sprite {
private var input:TextField;
private var output:TextField;
private var sendBtn:Sprite;
public function ExternalInterfaceExample() {
input = new TextField();
input.type = TextFieldType.INPUT;
input.background = true;
input.border = true;
input.width = 350;
input.height = 18;
addChild(input);
sendBtn = new Sprite();
sendBtn.mouseEnabled = true;
sendBtn.x = input.width + 10;
sendBtn.graphics.beginFill(0xCCCCCC);
sendBtn.graphics.drawRoundRect(0, 0, 80, 18, 10, 10);
sendBtn.graphics.endFill();
sendBtn.addEventListener(MouseEvent.CLICK, clickHandler);
addChild(sendBtn);
output = new TextField();
output.y = 25;
output.width = 450;
output.height = 325;
output.multiline = true;
output.wordWrap = true;
output.border = true;
output.text = "Initializing...\n";
addChild(output);
if (ExternalInterface.available) {
try {
output.appendText("Adding callback...\n");
ExternalInterface.addCallback("sendToActionScript", receivedfromJavaScript);
if (checkJavaScriptReady()) {
output.appendText("JavaScript is ready.\n");
} else {
output.a
Ïà¹ØÎĵµ£º
±¾ÎÄÏêϸ½éÉÜFlashÈëÃÅÓ¦¸ÃÁ˽âµÄÖØÒª¸ÅÄî
¡¡¡¡ÎÒ¸ù¾Ý×Ô¼ºÑ§Ï°FlashµÄ¸Ð¾õΪÈëÃÅѧϰÕßÕûÀíÈçϱØÐëÁ˽âµÄһЩ¼òµ¥µ«ÊÇÖØÒªµÄ¸ÅÄϣÍû´ó¼ÒÒ»¸ö¸ö³Ô͸£¬·ñÔòÓûËÙÔò²»´ï¡£
¡¡¡¡1¡¢ÈýÖÖͼ²ã
¡¡¡¡Í¼²ã£ººÍPhotoshopµÄͼ²ã²î²»¶à¡£
¡¡¡¡µ¼Ïò²ã£º²»½ö¿ÉÒÔµ¼ÏòMotion¶¯»£¬»¹Óвο¼²ãµÄ×÷Óã¨Õâ¸ö¹¦ÄÜÓõÄÈ˾Ͳ»¶àÁË£©¡£
......
¸Õ¿ªÊ¼ÓÃCS4µÄʱºò¾Í×¢Òâµ½ÁËÕâ¸öÕâ¸ö¹¦Äܲ»¹ý¶¼Ã»Êµ¼ù¹ý,Õ⼸Ììʵ¼ùÁËһϷ¢ÏÖÊǸöºÜºÃºÜºÍгµÄµÄ¼¼ÄÜ .ÓÐÁËËüÎÒÃǾͿÉÒÔºÜɵ¹ÏµÄ±à¼Ò»Ð©ÎÒÃdzÌÐòÔ±ºÜÍ·Ì۵ĴúÂë,±ÈÈçflash¶¯»µÄÂ˾µÐ§¹û,Èç¹ûûÓÐÕâ¸ö¹¦ÄܹÀ¼Æ°ïÖúÎĵµÀïÃæµÄflash.filters°üµÃ¿´°ëÌì…ÓиöÕâ¸ö¹¦ÄÜÎÒÃǾͲ»ÓóîÁË.±ÈÈçÏÖÔÚÎÒÏ붯̬Ìí¼ÓÌí¼ÓÒ»¸öÔª¼ ......
import flash.net.FileFilter;
import flash.net.FileReferenceList;
import fl.controls.Button;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.events.HTTPStatusEvent;
import flash.display.Loader;
import flash.net.URLRequest;
var ......
1¡¢Ò»¸öºÜ³¤µÄMC·ÅÔÚ³¡¾°ÖÐÒªÕ¼¾Ý¼¸Ö¡£¿
»Ø´ð£ºÒ»¸öºÜ³¤µÄMC·ÅÈ볡¾°ÖÐÖ»Õ¼¾ÝÒ»Ö¡µÄλÖã¬Èç¹û½«ËüÍÏÁ˺öàÖ¡£¬Ö´ÐÐʱÿ¸ôÒ»Ö¡MC¶¼»áÖØ·Å¡£
2¡¢ÔÚÖÆ×÷Flash“Ñع켣Ô˶¯Ð§¹ûʱ£¬¶ÔÏó×ÜÊÇÑØÖ±ÏßÔ˶¯£¬ºÍ½Ì³Ì¶ÔÕÕһϣ¬×ö·¨ÍêÈ«Ò»Ñù£¬ÎªÊ²Ã´²»ÐУ¿
»Ø´ð£ºÔÒòºÜ¼òµ¥£¬Ö»ÒòΪÊ×βÁ½Ö¡µÄÖÐÐÄλÖÃûÓжÔ×¼Ôڹ켣ÉÏ£¬¶øµ¼ ......