我被困在一个影片剪辑上,我在翻转效果上制作然后把链接放在这个影片剪辑中 现在的问题是onrollover工作但是在发布时没有任何解决方案??
代码m使用
on(release){
getURL("name.html")
}
示例文件链接
http://escribir.biz/nb1/sample.fla
http://escribir.biz/nb1/sample.swf
主框具有翻转和展开效果,链接位于第2层的电影和第1层的框中 在实际的电影中有很多这样的盒子有链接,但是当翻版工作链接发布不起作用时
非常感谢您的帮助
答案 0 :(得分:1)
第一次尝试为你的movieclip创建一个简单的类并将你的控件放在那里。
例如:
class YourMovieClipClassName extends MovieClip
{
function YourMovieClipClassName() { super(); }
function onLoad()
{
this.ControlMyMC();
}
function ControlMyMC()
{
this.onRollOver = function()
{
//Do on some
}
this.onRollOut = function()
{
//Do on some
}
this.onPress = function()
{
//Do on some
}
this.onRelease = function()
{
this.getURL("name.html");
}
}
}
答案 1 :(得分:1)
或下载examples.zip查看http://www.comvos.net/downloads/examples.zip
class main extends MovieClip
{
function main() { super(); }
function onLoad()
{
this.ControlMyMC();
}
function ControlMyMC()
{
//Turn OFF the HandCursor of Main MC
this.useHandCursor = false;
this.onRollOver = function()
{
this["AnimatedBG"].gotoAndPlay(2);
trace("RollOver Main MC");
}
this.onRollOut = function()
{
this["AnimatedBG"].gotoAndPlay(21);
trace("RollOut Main MC");
}
var ButtonInstanceNames:Array = [
"Button1",
"Button2"
];
for(var i:Number = 0; i < ButtonInstanceNames.length; i++)
{
this[ButtonInstanceNames[i]].onEnterFrame = function()
{
if (this.hitTest(_root._xmouse, _root._ymouse, true))
{
//ROLL OVER BUTTON
if (!this.isRollOver)
{
this.isRollOver = true;
trace("RollOver " + _name);
}
}
else
{
//ROLL OUT BUTTON
if (this.isRollOver)
{
this.isRollOver = false;
trace("RollOut " + _name);
}
}
}
//ON RELEASE ---(if you want to use onPress .... just replace the onMouseUp wit onMouseDown
this[ButtonInstanceNames[i]].onMouseUp = function()
{
if (this.hitTest(_root._xmouse, _root._ymouse, true))
{
switch (_name)
{
case "Button1": trace("You Clicked on Button 1 ... replace me with ---> this.getURL(\"page1.html\");"); break;
case "Button2": trace("You Clicked on Button 2 ... replace me with ---> this.getURL(\"page2.html\");"); break;
//example
case "Button3": this.getURL("name.html"); break;
default: trace("aa"); break;
}
}
}
}
}
}