FlexÓëJavascript»¥ÏàͨÐÅ
FlexÓëJavascript»¥ÏàͨÐÅ¡£
ÔÚFlexÖÐÓÐÕâôһ¸öÀࣺExternalInterface.ÔÚÕâ¸öÀàÖÐËü¸øÎÒÃÇ£ºcallºÍaddCallback
FlexÖÐAsµ÷ÓÃJsµÄ·½·¨ÊÇ£º
1¡¢µ¼Èë°ü £¨import flash.external.ExternalInterface;£©
2¡¢Ê¹ÓÃExternalInterface.call("Jsº¯ÊýÃû³Æ",²ÎÊý)½øÐе÷Óã¬Æä·µ»ØµÄÖµ¾ÍÊÇJsº¯ÊýËù·µ»ØµÄÖµ
Jsµ÷ÓÃAsµÄ·½·¨ÊÇ£º
1¡¢µ¼Èë°ü £¨import flash.external.ExternalInterface;£©
2¡¢ÔÚinitAppÖÐʹÓÃExternalInterface.addCallback("ÓÃÓÚJsµ÷Óõĺ¯ÊýÃû",AsÖеĺ¯ÊýÃû)½øÐÐ×¢²áÏÂ
3¡¢jsÖÐ ¾Í¿ÉÒÔÓÃdocument.getElementById("FlasÔÚHtmlÖеÄID").×¢²áʱÉèÖõĺ¯ÊýÃû£¨²ÎÊý£©½øÐе÷ÓÃ.
Ïà¹ØÎĵµ£º
<!-- -->
<!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;
mso-font-charset:2;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:0 268435456 0 0 -2147483648 0;}
@font-face
{font-family:ËÎÌå;
panose-1:2 ......
½ñÌìÔÚ×öÏîÄ¿µÄʱºòÓöµ½ÁËÒ»¸öÎÊÌ⣬·ÃÎÊxmlÎļþ¾ÍÊdzɹ¦²»ÁË¡£¿´ÁË¿´ÒÔǰд¹ýµÄ´úÂë¶¼¿ÉÒÔ£¬¶øÕâ¸öÏîÄ¿ÖÐΪʲô¾Í²»ÐÐÁËÄØ£¿×Ðϸ²é¿´ÁËĿ¼£¬ÊǰÙ˼²»µÃÆä½â°¡¡£
´íÎóÐÅÏ¢£º*** Security Sandbox Violation ***
Connection to file:///C|/loading.swf halted - not permitted from xxxx/data.xml¡£Õâ¸öxmlÊÇÔÚ¹¤³ÌÀïÃæsr ......
¹¹½¨¸ßÐÔÄܵÄJ2EEÓ¦Óò»µ«ÐèÒªÁ˽ⳣÓõÄʵʩ¼¼ÇÉ¡£ÏÂÃæ½éÉÜ×î³£ÓõÄ10ÖÖÓÐЧ·½·¨£¬¿É°ïÖú¼Ü¹¹Éè¼ÆÊ¦ÃÇ¿ìËÙ³ÉΪÕâ·½ÃæµÄר¼Ò¡£
JavaÐÔÄܵĻù´¡—ÄÚ´æ¹ÜÀí
ÈκÎJavaÓ¦Ó㬵¥»úµÄ»òJ2EEµÄÐÔÄÜ»ù´¡¶¼¿É¹é½áµ½ÄãµÄÓ¦ÓÃÊÇÈçºÎ¹ÜÀíÄÚ´æµÄÎÊÌâ¡£JavaµÄÄÚ´æ¹ÜÀí°üÀ¨Á½¸öÖØÒªÈÎÎñ£ºÄÚ´æµÄ·ÖÅäºÍÄÚ´æµÄ»ØÊÕ¡£ÔÚÄÚ´æµÄ·ÖÅäÖУ¬Ä ......
package org.openscales.core.format
{
import flash.utils.getQualifiedClassName;
import flash.xml.XMLNode;
import org.openscales.core.Util;
import org.openscales.core.feature.Feature;
import org.openscales.core.geometry.Collection;
import org.openscales.core. ......
<script type="text/javascript">
function getFileSize(filePath) {
var image=new Image();
image.dynsrc=filePath;
alert(image.fileSize);
}
</script> &nbs ......