2011-03-14 55 views
0

我的Flash網站項目上使用deeplinking時遇到了一些問題。如何與外部SWF進行深度連接? (ActionScript 2.0)

我下面這個教程http://www.padizine.com/blog/swfaddress-tutorial-for-actionscript-2-0/

,這不行。上面我的代碼:

在我的HTML文件

<script type="text/javascript" src="javascript/swfaddress.js"></script> 

<script type="text/javascript"> 
    // <![CDATA[ 
    var so = new SWFObject("site.swf", "ZONAZEN", "990", "580", "8", "#73746E"); 
    so.addParam("scale", "noscale"); 
    so.addParam("allowFullScreen", "true"); 
    so.addParam("wmode","transparent"); 
    so.useExpressInstall('javascript/swfobject/expressinstall.swf'); 
    so.write("flashcontent"); 
    // ]]> 
    </script> 

在我的Flash文件:

import com.asual.swfaddress.SWFAddress; // on my first frame in my flash 

//及以上,這是我作爲按鈕(我對每個菜單項都有一個這樣的....:

on (release){ 
if (_root.olink != num) { 
    SWFAddress.setValue("empresa"); 
    this.tween("_y",16,1,"easeOutExpo",0); 
    _root.conteudo.tween("_y",37,1,"easeOutExpo",0); 
    _root.omenu.item_2.tween("_y",469,1,"easeOutExpo",0); 
    _root.omenu.item_3.tween("_y",490,1,"easeOutExpo",0); 
    _root.omenu.item_4.tween("_y",511,1,"easeOutExpo",0); 
    _root.omenu.item_5.tween("_y",532,1,"easeOutExpo",0); 
    _root.omenu["item_"+_root.olink].fundo_menu_ativo.tween("_alpha",0,1,"easeOutExpo",0); 
    _root.olink = num 
} 

}

我loadmovieclip功能:

function loadMovieClip(externalTarget:String, targetRoot:MovieClip) { 

var mcLoader:MovieClipLoader = new MovieClipLoader(); 
var listenerLoad:Object = new Object(); 

listenerLoad.onLoadStart = function(target:MovieClip) { 
    _root.loade._visible = true; 
    _root.loade.tween("_alpha",100,1,"easeOutExpo",0); 

}; 
//Loading Progress 
listenerLoad.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void { 
    percent = Math.round(bytesLoaded/bytesTotal * 100); 
    _root.loader.percentTxt.text = percent + "%"; 
}; 
//On Load Complete 
listenerLoad.onLoadComplete = function(target:MovieClip):Void { 
    _root.loade.tween("_alpha",0,1.5,"easeOutExpo",0,function() { 
    _root.loade._visible = false; 
    }); 
    _root.conteudo.tween("_alpha",100,1.5,"easeOutExpo",0,function() { 
    content_blocker._visible = false; 
    }); 
}; 

mcLoader.addListener(listenerLoad); 
mcLoader.loadClip(externalTarget,targetRoot); 

}

function saiconteudo() { 
_root.swfToOpen = _root.movie; 
_root.content_blocker._visible = true; 
_root.conteudo.tween("_alpha",0,1,"easeOutExpo",0,function() { 
_root.loadMovieClip(_root.swfToOpen,_root.conteudo); 
}); 

}

我正在忘卻的東西嗎?

Ty for help!

+0

任何人都可以幫忙????? – Preston

回答

0

你有這條線(從教程,但修改爲指定/ JavaScript的目錄):
<script type="text/javascript" src="javascript/swfobject.js" charset="utf-8"></script>
以上:
<script type="text/javascript" src="javascript/swfaddress.js"></script>

和你有沒有swfaddress.js文件在/ javascript目錄?

也swfobject.js文件應該在/ JavaScript的目錄,如果你沒有這個文件只是谷歌的SWFObject和下載

如果你有這個全部到位,它仍然沒有工作,你能解釋你有什麼問題?你是否收到一些錯誤消息或不正確的行爲?

+0

是的..我有 on page .... and yes again,I have all this place,但不工作,沒有錯誤消息, – Preston