« Apollo キター!!! | メイン | Spark project »

TextField 内の <a href="http://google.co.jp" target="_blank">

del.icio.us it!   hatena bookmark

はまりちゅう
as2です

TextField内のhtmlTextでリンクを"_blank"にするとfirefoxでポップアップブロックに引っかかる。リンク先は別ドメイン。

しかもリンクをクリックしまくると開いたりもする・・・。

SafariとかIEはだいじょーぶみたい。


普通にリンクしてもだめ


var t = createTextField("text", getNextHighestDepth(), 0,0,0,0);
t.autoSize = true;
t.html = true;
t.htmlText = "<a href='http://google.co.jp' target='_blank'>ここがりんく</a>"

asfunctionつかっていろいろやってもだめ


var t = createTextField("text", getNextHighestDepth(), 0,0,0,0);
t.autoSize = true;
t.html = true;
t.htmlText = "<a href='asfunction:link,http://google.co.jp'>ここがりんく</a>"

function link(str) {
getURL(str, "_blank"); // だめー
getURL("javascript:void(window.open('"+str+"', '_blank'))"); //ダメー
ExternalInterface.call("window.open",str); // だめーー
}

ちなみにmcのonPressとonReleaseでも挙動がちがうみたい

ブロックされない


b.onRelease = function() {
getURL("http://google.co.jp", "_blank");
}

ブロックされる


b.onPress = function() {
getURL("http://google.co.jp", "_blank");
}

たーすーけーてー



トラックバック

このエントリーのトラックバックURL:
http://un-q.net/mt-tb.cgi/111

コメント (3)

じぇぇ:

ん~俺もチャレンジしてみました。
一応解決したんですが・・・。
function windowOpen(url){
str = url;
window.open(str,"_blank");
}
を HTML側に書いておいて
Flash側からは asFunction を使って
ExternalInterface.call("windowOpen",str);
を呼ぶ。
う~ん。
javaScript で 引数をそのままだとだめー
でも中で別に定義してやるとOK
なぜでしょう?
ちなみに環境は Firefox/2.0.0.2 です。

>じぇぇさん
コメントありがとうございます。

HTML内にJSを書く方法でWindowsの場合のみ解決しました。
環境は同じくFirefox/2.0.0.2でした。

Mac 10.4.9 のFirefox/2.0.0.2の場合は、他の方法と同様の動作で、クリックしまくると、たまに開くような状態です。

なんなんだろーなー

dyo:

↓これ、かんけいないですかねぇ。
http://support.adobe.co.jp/faq/faq/qadoc.sv?229684+002

コメントを投稿

crossreview