另一個安全性的問題

心得筆記 2007/04/25 07:55

昨天遇到一個安全性的問題,HELP看了那麼多次,果然還是要遇到了才知道HELP中解釋的道理
情況是這樣的

我有一個SWF檔 a.swf 在 a22.com

另一個SWF檔 b.swf 在 b33.com

而 a.swf 執行的時候會用loadclip的方式l載入 b.swf並執行 b.swf中的function b_function()

結果載不出來,於是,我第一個反應是想到crossdomain.xml沒過
我在瀏覽器網址列寫下
b33.com/crossdomain.xml
果然,找不到檔案
後來我在b33.com主機的根目錄下加上了crossdomain.xml這個檔案
內文如下
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy
  SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
 <allow-access-from domain="*" to-ports="*"/>
</cross-domain-policy>

在執行一次
a22.com/a.swf

load到了!
但是
a.swf 呼叫 b_function()的這行code卻沒有執行...

翻了翻HELP
我把b.swf 的第一個影格加上
System.security.allowDomain("*");

在執行一次
a22.com/a.swf

a.swf 成功呼叫b.swf 中的 b_function()

HELP上面還說除了function 變數也有跨domain的存取限制,
所以跨domain的存取變數和function 都要依賴System.security.allowDomain()這個公用函數才行!!

以上

top

Trackback Address :: http://diary.tw/allenliao/trackback/159

  1. allenliao 2007/05/02 05:02 MODIFY/DELETE REPLY

    要雙方System.security.allowDomain
    才可以註冊onRelease getURL

  2. Nike Dunk Shoes 2011/11/12 07:24 MODIFY/DELETE REPLY

    The important thing in life is to have a great aim , and the determination to attain it.

  3. coach outlet online 2012/04/05 13:08 MODIFY/DELETE REPLY

    [URL=http://www.pumashoefactory.com/]puma shoes[/URL] the F1event comes to china. The passion [URL=http://www.pumashoefactory.com/mens-puma-cayman-ferrari-shoes-c-83.html]ferrari puma[/URL]

  4. [coach outlet] 2012/04/27 08:15 MODIFY/DELETE REPLY

    coach outlet has a zippered closure and buckles for extra security. Shiny brass hardware, rounded leather handle, and an interior pocket. It also includes a limited edition Hawaii luggage tag and lock.This summer,?coach outlet store online combined with Chinese style, the international trend of the subversive elements in bold, the idea of ?weaving in elements in the interpretation of low-carbon fashion casual.As our Coach Outlet Online guarantees high quality for you, we have gained more customers'trust. The more they order, the more discounts they will enjoy.

Write a comment


PREV : [1] : ... [51] : [52] : [53] : [54] : [55] : [56] : [57] : [58] : [59] : ... [80] : NEXT