asp向flash传值
在做个动画,需要取动态的值大概是这样http://192.168.20.91/update/dtxyflash.swf?time=123需要取到当前页面地址的这个time...
在做个动画,需要取动态的值
大概是这样http://192.168.20.91/update/dtxyflash.swf?time=123
需要取到当前页面地址的这个time的值在flash里显示 展开
大概是这样http://192.168.20.91/update/dtxyflash.swf?time=123
需要取到当前页面地址的这个time的值在flash里显示 展开
2个回答
展开全部
这样这样可以直接传递进去的,用SWF?这种方式只能参数预先传递,FLash在加载的时候获取,在运行中变量不能变化,用_root.参数名 来获取,
我建议最好用 flash 内部的程序请求ASP页面 获取这样操控更灵活
参考程序
onClipEvent (load)
{
movieWIDTH = Stage.width;
movieHEIGHT = Stage.height;
oldx = 1;
oldy = 1;
vx = (x - oldx) * 10;
vy = (y - oldy) * 10;
gravity = 0;
bounce = 9.000000E-001;
radius = this._width / 2;
ScaleRange = 200;
ScaleMin = 150;
Rotation = Math.random() * 4;
angle = 0;
angleRate = 1.000000E-001;
max = 12;
Sound1 = new Sound();
Sound1.attachSound("soccer_01");
Sound1.setVolume(10);
}
// [onClipEvent of sprite 31 in frame 1]
onClipEvent (enterFrame)
{
oldx = x;
oldy = y;
x = this._x;
y = this._y;
this._xscale = this._yscale = Math.abs(Math.sin(angle) * ScaleRange) + ScaleMin;
if (Math.abs(Math.sin(angle)) < 5.000000E-002)
{
Sound1.start(0, 1);
vx = vx * bounce;
vy = vy * bounce;
} // end if
angle = angle + angleRate;
if (dragging)
{
vx = (x - oldx) * 10;
vy = (y - oldy) * 10;
}
else
{
vy = vy + gravity;
x = x + int(vx) / 5;
y = y + vy / 10;
if (y < radius)
{
y = radius;
vx = vx * bounce;
vy = vy * -bounce;
} // end if
if (y > movieHEIGHT - radius)
{
y = movieHEIGHT - radius;
vx = vx * bounce;
vy = vy * -bounce;
Sound1.start(0, 1);
} // end if
if (x < radius)
{
x = radius;
vx = vx * -bounce;
vy = vy * bounce;
Sound1.start(0, 1);
} // end if
if (x > movieWIDTH - radius)
{
x = movieWIDTH - radius;
vx = vx * -bounce;
vy = vy * bounce;
Sound1.start(0, 1);
} // end if
with (this)
{
_x = x;
_y = y;
} // End of with
if (Math.abs(vx) > 1.000000E-001)
{
this.mcDetails._rotation = this.mcDetails._rotation + vx / 3;
} // end if
} // end else if
}
// [Action in Frame 1]
totalWidth = preloader_mc.percentbar_mc._width;
preloader_mc.percentbar_mc._width = 0;
preloader_mc.kPercent.text = "0%";
preloader_mc.onEnterFrame = function ()
{
var _loc4 = _root.getBytesLoaded();
var _loc3 = _root.getBytesTotal();
if (_loc3 != -1)
{
var _loc5 = Math.round(_loc4 / 1024);
var _loc6 = Math.round(_loc3 / 1024);
percent = Math.round(_loc5 / _loc6 * 100);
if (isNaN(percent))
{
this.kPercent.text = "0%";
}
else
{
this.kPercent.text = percent + "%";
this.percentbar_mc._width = totalWidth * (percent / 100);
} // end else if
if (_loc4 == _loc3 && _loc3 > 0)
{
delete this.onEnterFrame;
gotoAndPlay("start");
}
else if (_loc4 == -1)
{
failureReport_txt.text = "The file is not currently available. Please try again later. If you continue to receive this message, please contact the system administrator.";
} // end if
} // end else if
};
stop ();
// [Action in Frame 16]
function zhuan(key)
{
if (chek eq 0)
{
limit._visible = 1;
} // end if
if (chek eq 1)
{
_root.dart3.nextFrame();
_root.dart3.launching._y = -50;
var _loc8 = [1, 2, 3];
var _loc5 = _loc8.concat();
var _loc6 = key;
num = _loc5[_loc6];
trace ("随机背景" + _loc5[_loc6]);
_loc5.splice(_loc6, 1);
_root["bg" + num].board.gotoAndStop(rew);
_root["bg" + num].play();
initial_arr = [1, 2, 3, 4, 5, 6];
var _loc7 = initial_arr.concat();
_loc7.splice(chek - 1, 1);
var _loc4 = _loc7.concat();
for (var _loc2 = 0; _loc2 < 2; ++_loc2)
{
var _loc3 = random(_loc4.length);
_root["bg" + _loc5[_loc2]].board.gotoAndStop(_loc4[_loc3]);
trace ("bg" + _loc5[_loc2]);
trace ("随机抽出号码" + _loc4[_loc3]);
_loc4.splice(_loc3, 1);
} // end of for
} // end if
} // End of the function
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function (ok)
{
if (ok)
{
userid = myXML.firstChild.childNodes[0].firstChild;
chek = myXML.firstChild.childNodes[1].firstChild;
msg = myXML.firstChild.childNodes[2].firstChild;
rew = myXML.firstChild.childNodes[3].firstChild;
limit.msg_txt = msg;
}
else
{
trace ("error");
} // end else if
};
myXML.load("flash_come.jsp?" + Math.random() * 10000);
limit._visible = 0;
control._visible = 1;
control.useHandCursor = false;
btnreplay._visible = 0;
stop ();
我建议最好用 flash 内部的程序请求ASP页面 获取这样操控更灵活
参考程序
onClipEvent (load)
{
movieWIDTH = Stage.width;
movieHEIGHT = Stage.height;
oldx = 1;
oldy = 1;
vx = (x - oldx) * 10;
vy = (y - oldy) * 10;
gravity = 0;
bounce = 9.000000E-001;
radius = this._width / 2;
ScaleRange = 200;
ScaleMin = 150;
Rotation = Math.random() * 4;
angle = 0;
angleRate = 1.000000E-001;
max = 12;
Sound1 = new Sound();
Sound1.attachSound("soccer_01");
Sound1.setVolume(10);
}
// [onClipEvent of sprite 31 in frame 1]
onClipEvent (enterFrame)
{
oldx = x;
oldy = y;
x = this._x;
y = this._y;
this._xscale = this._yscale = Math.abs(Math.sin(angle) * ScaleRange) + ScaleMin;
if (Math.abs(Math.sin(angle)) < 5.000000E-002)
{
Sound1.start(0, 1);
vx = vx * bounce;
vy = vy * bounce;
} // end if
angle = angle + angleRate;
if (dragging)
{
vx = (x - oldx) * 10;
vy = (y - oldy) * 10;
}
else
{
vy = vy + gravity;
x = x + int(vx) / 5;
y = y + vy / 10;
if (y < radius)
{
y = radius;
vx = vx * bounce;
vy = vy * -bounce;
} // end if
if (y > movieHEIGHT - radius)
{
y = movieHEIGHT - radius;
vx = vx * bounce;
vy = vy * -bounce;
Sound1.start(0, 1);
} // end if
if (x < radius)
{
x = radius;
vx = vx * -bounce;
vy = vy * bounce;
Sound1.start(0, 1);
} // end if
if (x > movieWIDTH - radius)
{
x = movieWIDTH - radius;
vx = vx * -bounce;
vy = vy * bounce;
Sound1.start(0, 1);
} // end if
with (this)
{
_x = x;
_y = y;
} // End of with
if (Math.abs(vx) > 1.000000E-001)
{
this.mcDetails._rotation = this.mcDetails._rotation + vx / 3;
} // end if
} // end else if
}
// [Action in Frame 1]
totalWidth = preloader_mc.percentbar_mc._width;
preloader_mc.percentbar_mc._width = 0;
preloader_mc.kPercent.text = "0%";
preloader_mc.onEnterFrame = function ()
{
var _loc4 = _root.getBytesLoaded();
var _loc3 = _root.getBytesTotal();
if (_loc3 != -1)
{
var _loc5 = Math.round(_loc4 / 1024);
var _loc6 = Math.round(_loc3 / 1024);
percent = Math.round(_loc5 / _loc6 * 100);
if (isNaN(percent))
{
this.kPercent.text = "0%";
}
else
{
this.kPercent.text = percent + "%";
this.percentbar_mc._width = totalWidth * (percent / 100);
} // end else if
if (_loc4 == _loc3 && _loc3 > 0)
{
delete this.onEnterFrame;
gotoAndPlay("start");
}
else if (_loc4 == -1)
{
failureReport_txt.text = "The file is not currently available. Please try again later. If you continue to receive this message, please contact the system administrator.";
} // end if
} // end else if
};
stop ();
// [Action in Frame 16]
function zhuan(key)
{
if (chek eq 0)
{
limit._visible = 1;
} // end if
if (chek eq 1)
{
_root.dart3.nextFrame();
_root.dart3.launching._y = -50;
var _loc8 = [1, 2, 3];
var _loc5 = _loc8.concat();
var _loc6 = key;
num = _loc5[_loc6];
trace ("随机背景" + _loc5[_loc6]);
_loc5.splice(_loc6, 1);
_root["bg" + num].board.gotoAndStop(rew);
_root["bg" + num].play();
initial_arr = [1, 2, 3, 4, 5, 6];
var _loc7 = initial_arr.concat();
_loc7.splice(chek - 1, 1);
var _loc4 = _loc7.concat();
for (var _loc2 = 0; _loc2 < 2; ++_loc2)
{
var _loc3 = random(_loc4.length);
_root["bg" + _loc5[_loc2]].board.gotoAndStop(_loc4[_loc3]);
trace ("bg" + _loc5[_loc2]);
trace ("随机抽出号码" + _loc4[_loc3]);
_loc4.splice(_loc3, 1);
} // end of for
} // end if
} // End of the function
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function (ok)
{
if (ok)
{
userid = myXML.firstChild.childNodes[0].firstChild;
chek = myXML.firstChild.childNodes[1].firstChild;
msg = myXML.firstChild.childNodes[2].firstChild;
rew = myXML.firstChild.childNodes[3].firstChild;
limit.msg_txt = msg;
}
else
{
trace ("error");
} // end else if
};
myXML.load("flash_come.jsp?" + Math.random() * 10000);
limit._visible = 0;
control._visible = 1;
control.useHandCursor = false;
btnreplay._visible = 0;
stop ();
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询