-
FLASH-8制作火焰效果(超简单)
效果
FLASH8.0软件下载页面.
打开这个网址:http://www.onlinedown.net/soft... 注册码供WPD800-53339-14332-97403 WPD800-50636-84532-08752 WPD800-52630-05632-86415制作方法一、打开flash8软件(其它flash软件好象不支持),新建文档(设置皆默认,当然文档大小可自定义设置)二、选中默认图层第一帧,打开动作面板,输入以下代码var mcs = createEmptyMovieClip("query", -1);with (mcs){beginFill(0, 100);lineStyle(0, 0, 0);moveTo(0, 0);lineTo(Stage.width, 0);lineTo(Stage.width, Stage.height);lineTo(0, Stage.height);lineTo(0, 0);endFill();} // End of withvar McR = 40;var McA = 60;var CreaMovie = this.createEmptyMovieClip("CreaMc", 0);with (CreaMovie){fillType = "radial";colors = [16776960, 16776960];alphas = [McA, 0];ratios = [0, 255];matrix = new flash.geom.Matrix();matrix.createGradientBox(McR, McR, 0, 0, 0);beginGradientFill(fillType, colors, alphas, ratios, matrix);moveTo(0, 0);lineTo(0, McR);lineTo(McR, McR);lineTo(McR, 0);lineTo(0, 0);endFill();} // End of withCreaMovie._visible = false;var McNum = 1;var McMore = 200;var McRandom = 6;var McY = 4;var Mc_x = Stage.width / 2;var Mc_y = Stage.height / 2 + Stage.height / 4;var Mc_more = 100;var Mc_scal = 50;flame = function (){var _loc3 = random(Mc_scal) + 1;var _loc2 = CreaMovie.duplicateMovieClip("flames" + McNum, McNum, {_x: Mc_x, _y: Mc_y, _alpha: Mc_more / 2, _xscale: _loc3 + 5, _yscale: _loc3 + 5});_loc2.blendMode = "add";_loc2.fast = Math.floor(_loc3 / 10);_loc2.action = random(2) == 1 ? (1) : (-1);_loc2.scal = 10 - _loc2.fast;_loc2.n = _loc2.s = 1;_loc2._r = _loc2._g = 255;_loc2._b = 0;_loc2.gs = (10 - _loc2.scal + 2) * 3;_loc2.onEnterFrame = function (){this._x = this._x + this.fast * this.action * this.n * this.s;this._y = this._y - McY;this._xscale = this._xscale + this.scal * this.n * this.s;this._yscale = this._yscale + this.scal * this.n * this.s;this._alpha = this._alpha + 10 * this.n * this.s;this._g = this._g - this.gs;this._r = this._r - 2;if (this._g <= 0)
{this._g = 0;} // end ifnew Color(this).setRGB(this._r << 16 | this._g << 8 | this._b);
if (this._xscale >= Mc_more){this.n = -1;this.s = 2.000000E-001;} // end ifif (this._alpha >= Mc_more){this._alpha = Mc_more;}else if (this._alpha <= random(20))
{this.removeMovieClip();delete this.onEnterFrame();} // end else if};if (McNum >= McMore){McNum = 0;} // end if++McNum;};setInterval(flame, 10);三、OK!测试存盘海洋腾迅博客--QQ623251631
(转载请说明出处葬爱海洋2010/7/31 19:30:46
举报不良信息