Actionscript 2.0 Flash "HD VIDEO" - Investigation

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("", _x, _root.xd1);
    }
}
onClipEvent (enterFrame)
{
    y = y * accel1 + (_root.yd1 - _y) * rate1;
    setProperty("", _y, _y + y);
    if (Math.abs(_root.yd1 - _y) < 1)
    {
        setProperty("", _y, _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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值