flash as3.0调用外部文件,怎样在代码中控制图片的大小
请各位高手帮帮忙!这个flash动画效果,是调用的外部文件图片,如何添加控制图片大小的代码,代码如下:functionmover(){this._x=Math.cos(t...
请各位高手帮帮忙!
这个flash动画效果,是调用的外部文件图片,如何添加控制图片大小的代码,
代码如下:
function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var _loc2 = this._y / (centerY + radiusY);
this._xscale = this._yscale = _loc2 * 100;
this.angle = this.angle + this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
} // End of the function
stop ();
var folder = "thumbnails/";
var total;
var radiusX = 190;
var radiusY = 95;
var centerX = 235;
var centerY = 170;
var speed = 5.000000E-003;
tn_group_mc._visible = false;
fm_label.text = "";
fm_url.text = "";
var xml = new XML();
xml.ignoreWhite = true;
xml.onLoad = function ()
{
var _loc4 = this.firstChild.childNodes;
total = _loc4.length;
for (var _loc2 = 0; _loc2 < total; ++_loc2)
{
var _loc3 = tn_group_mc.duplicateMovieClip("tn" + _loc2, _loc2);
_loc3.angle = _loc2 * (6.283185E+000 / total);
_loc3.onEnterFrame = mover;
_loc3.tn_mc.inner.loadMovie(folder + _loc4[_loc2].attributes.filename);
_loc3.tn_reflection_mc.inner.loadMovie(folder + _loc4[_loc2].attributes.filename);
_loc3.fm_label = _loc4[_loc2].attributes.label;
_loc3.fm_url = _loc4[_loc2].attributes.url;
_loc3.fm_button.onRollOver = function ()
{
fm_label.text = "Title: " + this._parent.fm_label;
fm_url.text = "URL: " + this._parent.fm_url;
};
_loc3.fm_button.onRollOut = function ()
{
fm_label.text = "";
fm_url.text = "";
};
_loc3.fm_button.onRelease = function ()
{
getURL(this._parent.fm_url, "");
};
} // end of for
};
xml.load(folder + "thumbnails.xml");
this.onMouseMove = function ()
{
speed = (this._xmouse - centerX) * 5.000000E-005;
};
外部文件:thumbnails.xml
<thumbnails>
<thumbnail filename="1.jpg" label="51" url="#" />
<thumbnail filename="2.jpg" label="51" url="#" />
</thumbails>
请各位高手帮忙解决一下代码!谢谢……
麻烦一下,能不能给出具体的代码,在什么位置添加,我对as3.0也不是很了解,有急用!
可以再加分的 展开
这个flash动画效果,是调用的外部文件图片,如何添加控制图片大小的代码,
代码如下:
function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var _loc2 = this._y / (centerY + radiusY);
this._xscale = this._yscale = _loc2 * 100;
this.angle = this.angle + this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
} // End of the function
stop ();
var folder = "thumbnails/";
var total;
var radiusX = 190;
var radiusY = 95;
var centerX = 235;
var centerY = 170;
var speed = 5.000000E-003;
tn_group_mc._visible = false;
fm_label.text = "";
fm_url.text = "";
var xml = new XML();
xml.ignoreWhite = true;
xml.onLoad = function ()
{
var _loc4 = this.firstChild.childNodes;
total = _loc4.length;
for (var _loc2 = 0; _loc2 < total; ++_loc2)
{
var _loc3 = tn_group_mc.duplicateMovieClip("tn" + _loc2, _loc2);
_loc3.angle = _loc2 * (6.283185E+000 / total);
_loc3.onEnterFrame = mover;
_loc3.tn_mc.inner.loadMovie(folder + _loc4[_loc2].attributes.filename);
_loc3.tn_reflection_mc.inner.loadMovie(folder + _loc4[_loc2].attributes.filename);
_loc3.fm_label = _loc4[_loc2].attributes.label;
_loc3.fm_url = _loc4[_loc2].attributes.url;
_loc3.fm_button.onRollOver = function ()
{
fm_label.text = "Title: " + this._parent.fm_label;
fm_url.text = "URL: " + this._parent.fm_url;
};
_loc3.fm_button.onRollOut = function ()
{
fm_label.text = "";
fm_url.text = "";
};
_loc3.fm_button.onRelease = function ()
{
getURL(this._parent.fm_url, "");
};
} // end of for
};
xml.load(folder + "thumbnails.xml");
this.onMouseMove = function ()
{
speed = (this._xmouse - centerX) * 5.000000E-005;
};
外部文件:thumbnails.xml
<thumbnails>
<thumbnail filename="1.jpg" label="51" url="#" />
<thumbnail filename="2.jpg" label="51" url="#" />
</thumbails>
请各位高手帮忙解决一下代码!谢谢……
麻烦一下,能不能给出具体的代码,在什么位置添加,我对as3.0也不是很了解,有急用!
可以再加分的 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询