加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Actionscript 2.0 Flash "HD VIDEO" - Investig

发布时间:2020-12-15 06:44:53 所属栏目:百科 来源:网络整理
导读:Overview The flash is developed with Actionscript2.0; but the .fla file is generated by a decompiling software,this can be reviewed in the following discussion. Script On Root Timeline Preloading Now take a look at the script on frame 1: S

Overview




The flash is developed with Actionscript2.0; but the .fla file is generated by a decompiling software,this can be reviewed in the following discussion.


Script On Root Timeline & Preloading


root-timeline-script



Now take a look at the script on frame 1:

Stage.scaleMode = "noScale";
Stage.align = "MC";
stop ();
_global.style.setStyle("themeColor","0x8a8a8a");
_root.selectedG = 0;
_root.current_p = 1;
_root.g_page = 0;
_root.page = 0;
_root.flag = 0;
_root.music = 0;
_root.speed = 10;
_root.speed2 = 7;
loadVariablesNum("text.txt",0);
xml_data = new XML();
xml_data.ignoreWhite = true;
xml_data.load("video.xml");


These lines do three important tasks:?

1. stop the root MovieClip at this frame;

2. start to load the text.txt;

3. start to load video.xml


Piece of text.txt:


///////////////////// Site Slogans //////////

////Use your logo. Delete line below {logo} if you don't want to use logo image. Name1 and Name2 fields would be displayed.
	
	&logo_image=logo.png&

//Use this fields for Company name...

	&name1=<b>HD VIDEO</b>&
	&name2=by flashGIANT&

Its format is:


&[variable name]=[variable value]&[variable name]=[variable value]&.......[variable name]=[variable value]$


The name/value pairs are separated by ampersand '&',it also supports comment as well.


And there should be a kind of logic tells root MC to continue playing somewhere,the sole one MC on frame 1 is "loader",the script attached to it:


onClipEvent (enterFrame)
{
    if (_root.file_prelouder == 1)
    {
        _root.play();
    }
} 

It is more clear now,file_prelouder is the last variable in text.txt,so this variable being available means that the loading process is finished. And now the root can go to frame 2. ? ??


The script?on frame 2,which just stop root MC:


stop ();
_root.current_pic = _root.main1;
_root.scroller_x = 400;
_root.scroller_y = 350;

Now the next step is to look at MovieClip "loading" on frame 2,the script attached to it:


onClipEvent (load)
{
    total = _root.getBytesTotal();
}
onClipEvent (enterFrame)
{
    loaded = _root.getBytesLoaded();
    percent = int(loaded / total * 100);
    text = "  " + percent + "%";
    gotoAndStop(percent);
    if (loaded == total)
    {
        _root.play();
    } 
}

So,it play a loading animation based on timeline,the mask is scaled along x axis,and along time; looking like the loading progress bar grows as time elapses. ?Once the root is loaded,it tell it to go on to play.?


loading



The script on frame 3 is to load a mp3 file and play it,we can omit that for now.


The next MovieClip gos into the stage is "phone1". The script attached on it:


onClipEvent (load)
{
    accel1 = 6.500000E-001;
    rate1 = 1.400000E-001;
    _root.xd1 = 114;
    _root.yd1 = 217;
    x = 1;
    y = 1;
}
onClipEvent (enterFrame)
{
    x = x * accel1 + (_root.xd1 - _x) * rate1;
    setProperty("",_x,_x + x);
    if (Math.abs(_root.xd1 - _x) < 1)
    {
        setProperty("",_root.xd1);
    }
}
onClipEvent (enterFrame)
{
    y = y * accel1 + (_root.yd1 - _y) * rate1;
    setProperty("",_y,_y + y);
    if (Math.abs(_root.yd1 - _y) < 1)
    {
        setProperty("",_root.yd1);
    }
}

On 3rd line,there is a expression "6.500000E-001",this is scientific notation in computer language,it means:


6.5 / 10

The sign indicate the operation should be taken,minus sign means devide,plus sign means multiply,the number is the index value of 10. ?This kind of code must be generated by decompiler,not typed by human.


To sum up,what this piece do is moving the "phone1" MovieClip into the stage,where is [114,217]. 'accel1' is accelerator.



REFS:

http://www.cleavebooks.co.uk/dictunit/enote.htm

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读