终于把页面搞定了
我把ChinaAcg的页面设计出来了,主页,设计了一个计数器,很简单的,就是读取文本,然后显示。
大概的代码是这样的:
这个是读取一个文本然后显示。
php
function hitcount($count_file){
$count=0;
if(file_exists($count_file)){
$fp=fopen($count_file,”r”);
$count=0+fgets($fp,20);//取出count值,是计数文件的前二十位
fclose($fp);
}
$count++;
$fp=fopen($count_file,”w”);
fputs($fp,$count);
fclose($fp);
return $count;
}
$count=hitcount(“计速器文本地址”);
echo $count;
?>
很简单的PHP代码。
然后我用DIV固定了一些FLASH的层显示,比较简单固定分辨率方法是2个层
1个层用于扩充和固定分辨率,然后所有的层放在这个层里面。
主层的话,可以用一个table固定进去。
Flash方面,一段AS旋转代码:
// ######################################
//
// Coffee Chen Dev. Data : 2007.8.22
//
// ########################################
fscommand(“fullscreen”, “false”);
fscommand(“allowscale”, “false”);
fscommand(“showmenu”, “false”);
//
click = false;
//
circle1.circle.PosX = circle1.circle.defX=circle1.circle._x;
circle1.circle.PosY = circle1.circle.defY=circle1.circle._y;
circle2.circle.PosX = circle2.circle.defX=circle2.circle._x;
circle2.circle.PosY = circle2.circle.defY=circle2.circle._y;
circle3.circle.PosX = circle3.circle.defX=circle3.circle._x;
circle3.circle.PosY = circle3.circle.defY=circle3.circle._y;
//
Nav1.onEnterFrame = function() {
if (_root, click) {
if (this._x>210) {
this._x = this._x+(200-this._x)*0.19;
this.nextFrame();
}
if (this._x<210) {
this.nextFrame();
}
} else {
this.prevFrame();
if (this._currentframe<=5) {
}
}
};
Nav2.onEnterFrame = function() {
this._y = this._y+(_root.nav1._y-this._y);
this._x = this._x+(_root.nav1._x-this._x);
};
circle1.onEnterFrame = function() {
this._rotation = this._rotation+3;
this._y = this._y+(_root.nav1._y-this._y)*0.8;
this._x = this._x+(_root.nav1._x-this._x)*0.8;
};
circle2.onEnterFrame = function() {
this._rotation = this._rotation+3.5;
this._y = this._y+(_root.nav1._y-this._y)*0.7;
this._x = this._x+(_root.nav1._x-this._x)*0.7;
};
circle3.onEnterFrame = function() {
this._rotation = this._rotation+3.5;
this._y = this._y+(_root.nav1._y-this._y)*0.7;
this._x = this._x+(_root.nav1._x-this._x)*0.7;
};
circle1.circle.onEnterFrame = function() {
this._y = this._y+(this.PosY-this._y)*0.2;
this._x = this._x+(this.PosX-this._x)*0.2;
};
circle2.circle.onEnterFrame = function() {
this._y = this._y+(this.PosY-this._y)*0.2;
this._x = this._x+(this.PosX-this._x)*0.2;
};
circle3.circle.onEnterFrame = function() {
this._y = this._y+(this.PosY-this._y)*0.2;
this._x = this._x+(this.PosX-this._x)*0.2;
};
//
Nav1.circle.onRelease = function() {
if (_root.click) {
_root.menu_out();
} else {
_root.menu_on();
}
};
//
function menu_on() {
_root.circle1.circle.PosX = _root.circle2.circle.PosX=_root.circle3.circle.PosX=0;
_root.circle1.circle.PosY = _root.circle2.circle.PosY=_root.circle3.circle.PosY=0;
_root.click = true;
}
function menu_out() {
_root.click = false;
_root.circle1.circle.PosX = _root.circle1.circle.defX;
_root.circle1.circle.PosY = _root.circle1.circle.defY;
_root.circle2.circle.PosX = _root.circle2.circle.defX;
_root.circle2.circle.PosY = _root.circle2.circle.defY;
_root.circle3.circle.PosX = _root.circle3.circle.defX;
_root.circle3.circle.PosY = _root.circle3.circle.defY;
}
这就基本实现了index.php这个页面了!!~~
Categories: Garfield's Diary