题目
谁能帮我解释下这段AS代码:急
onClipEvent (load)
{
function speed(num)
{
speedX = -(_root._xmouse - hx) / num / 2;
return (speedX);
} // End of the function
function trans()
{
p = p + speed(100);
range = (p + 291) * 3.141593E+000 / 180;
re1 = Math.sin(range) * r;
re2 = Math.cos(range) * a;
} // End of the function
function property()
{
trans();
setProperty("",_x,hx + re1);
setProperty("",_alpha,re2 + 70);
setProperty("",_yscale,re2 + 70);
setProperty("",_xscale,re2 + 70);
this.swapDepths(_alpha);
} // End of the function
hx = this._parent.stageWidth / 2;
hy = this._parent.stageHeight / 2;
r = 100;
a = 30;
}
onClipEvent (enterFrame)
{
property();
}
onClipEvent (load)
{
function speed(num)
{
speedX = -(_root._xmouse - hx) / num / 2;
return (speedX);
} // End of the function
function trans()
{
p = p + speed(100);
range = (p + 291) * 3.141593E+000 / 180;
re1 = Math.sin(range) * r;
re2 = Math.cos(range) * a;
} // End of the function
function property()
{
trans();
setProperty("",_x,hx + re1);
setProperty("",_alpha,re2 + 70);
setProperty("",_yscale,re2 + 70);
setProperty("",_xscale,re2 + 70);
this.swapDepths(_alpha);
} // End of the function
hx = this._parent.stageWidth / 2;
hy = this._parent.stageHeight / 2;
r = 100;
a = 30;
}
onClipEvent (enterFrame)
{
property();
}
提问时间:2021-12-26
答案
这是 VB写的 调用Word 填充数据的.
On Error Resume Next
Dim ex As Application '声明
Set ex = CreateObject("word.application") '创建Word对象
ex.Visible = True '让Word可见
Set woreddoc = ex.Documents.Add '添加一个新文档
ex.Caption = "数据库原理概论试卷" '文档标题名
ex.Application.Selection.Range.ParagraphFormat.Alignment = wdAlignParagraphCenter '字体居中
ex.Application.Selection.Font.Size = 14
ex.Application.Selection.Font.Spacing = 1
ex.Application.Selection.Font.Bold = 20 '上面设置字体字号的
ex.Application.Selection.Range.Text = Text.Item(1).Text '从text的项目1获取数据 text 应该是个 combo 或listbox
ex.Application.Selection.EndKey '移到结尾
ex.Application.Selection.Range.InsertAfter (Text2.Item(1).Text) + Chr(13) '再填充 加个回车
ex.Application.Selection.Range.InsertParagraphAfter
ex.Application.Selection.EndKey
ex.Application.Selection.MoveDown
ex.Application.Selection.EndKey
ex.Application.Selection.Range.InsertParagraphAfter
ex.Application.Selection.MoveDown
ex.Application.Selection.MoveDown '下跳
ex.Application.Selection.Paragraphs.Last.Range.Font.Size = 12
ex.Application.Selection.Paragraphs.Last.Range.Font.Bold = 0 '再设置字体 字号
k = ex.Application.Selection.Tables.Add(ex.Application.Selection.Range,2,8,0,0) '这里画了个两行 8列的 表
ex.Application.Selection.Tables.Item(1).Columns.Item(1).Cells.Item(1).Range.InsertAfter ("题型") '1行1列 填充
ex.Application.Selection.Tables.Item(1).Columns.Item(1).Cells.Item(2).Range.InsertAfter ("分数") '1行2列填充
ex.Application.Selection.MoveDown
ex.Application.Selection.Tables.Item(1).Columns.Item(2).Cells.Item(1).Range.InsertAfter ("一")
ex.Application.Selection.Tables.Item(1).Columns.Item(3).Cells.Item(1).Range.InsertAfter ("二")
ex.Application.Selection.Tables.Item(1).Columns.Item(4).Cells.Item(1).Range.InsertAfter ("三")
ex.Application.Selection.Tables.Item(1).Columns.Item(5).Cells.Item(1).Range.InsertAfter ("四")
ex.Application.Selection.Tables.Item(1).Columns.Item(6).Cells.Item(1).Range.InsertAfter ("五")
ex.Application.Selection.Tables.Item(1).Columns.Item(7).Cells.Item(1).Range.InsertAfter ("六")
ex.Application.Selection.Tables.Item(1).Columns.Item(8).Cells.Item(1).Range.InsertAfter ("总分") '这里添完
ex.Application.Selection.MoveDown
ex.Application.Selection.MoveDown '下条
ex.Application.Selection.Range.InsertParagraphAfter
ex.Application.Selection.MoveDown
ex.Application.Selection.Range.ParagraphFormat.Alignment = wdAlignParagraphLeft
ex.Application.Selection.Paragraphs.Last.Range.Font.Size = 10
ex.Application.Selection.Paragraphs.Last.Range.Font.Bold = 10 '设置字体字号
ex.Application.Selection.Range.InsertParagraphAfter
ex.Application.Selection.Range.InsertAfter ("填空(20分)") '再填充
ex.Application.Selection.MoveDown
ex.Application.Selection.Range.InsertParagraphAfter
On Error Resume Next
Dim ex As Application '声明
Set ex = CreateObject("word.application") '创建Word对象
ex.Visible = True '让Word可见
Set woreddoc = ex.Documents.Add '添加一个新文档
ex.Caption = "数据库原理概论试卷" '文档标题名
ex.Application.Selection.Range.ParagraphFormat.Alignment = wdAlignParagraphCenter '字体居中
ex.Application.Selection.Font.Size = 14
ex.Application.Selection.Font.Spacing = 1
ex.Application.Selection.Font.Bold = 20 '上面设置字体字号的
ex.Application.Selection.Range.Text = Text.Item(1).Text '从text的项目1获取数据 text 应该是个 combo 或listbox
ex.Application.Selection.EndKey '移到结尾
ex.Application.Selection.Range.InsertAfter (Text2.Item(1).Text) + Chr(13) '再填充 加个回车
ex.Application.Selection.Range.InsertParagraphAfter
ex.Application.Selection.EndKey
ex.Application.Selection.MoveDown
ex.Application.Selection.EndKey
ex.Application.Selection.Range.InsertParagraphAfter
ex.Application.Selection.MoveDown
ex.Application.Selection.MoveDown '下跳
ex.Application.Selection.Paragraphs.Last.Range.Font.Size = 12
ex.Application.Selection.Paragraphs.Last.Range.Font.Bold = 0 '再设置字体 字号
k = ex.Application.Selection.Tables.Add(ex.Application.Selection.Range,2,8,0,0) '这里画了个两行 8列的 表
ex.Application.Selection.Tables.Item(1).Columns.Item(1).Cells.Item(1).Range.InsertAfter ("题型") '1行1列 填充
ex.Application.Selection.Tables.Item(1).Columns.Item(1).Cells.Item(2).Range.InsertAfter ("分数") '1行2列填充
ex.Application.Selection.MoveDown
ex.Application.Selection.Tables.Item(1).Columns.Item(2).Cells.Item(1).Range.InsertAfter ("一")
ex.Application.Selection.Tables.Item(1).Columns.Item(3).Cells.Item(1).Range.InsertAfter ("二")
ex.Application.Selection.Tables.Item(1).Columns.Item(4).Cells.Item(1).Range.InsertAfter ("三")
ex.Application.Selection.Tables.Item(1).Columns.Item(5).Cells.Item(1).Range.InsertAfter ("四")
ex.Application.Selection.Tables.Item(1).Columns.Item(6).Cells.Item(1).Range.InsertAfter ("五")
ex.Application.Selection.Tables.Item(1).Columns.Item(7).Cells.Item(1).Range.InsertAfter ("六")
ex.Application.Selection.Tables.Item(1).Columns.Item(8).Cells.Item(1).Range.InsertAfter ("总分") '这里添完
ex.Application.Selection.MoveDown
ex.Application.Selection.MoveDown '下条
ex.Application.Selection.Range.InsertParagraphAfter
ex.Application.Selection.MoveDown
ex.Application.Selection.Range.ParagraphFormat.Alignment = wdAlignParagraphLeft
ex.Application.Selection.Paragraphs.Last.Range.Font.Size = 10
ex.Application.Selection.Paragraphs.Last.Range.Font.Bold = 10 '设置字体字号
ex.Application.Selection.Range.InsertParagraphAfter
ex.Application.Selection.Range.InsertAfter ("填空(20分)") '再填充
ex.Application.Selection.MoveDown
ex.Application.Selection.Range.InsertParagraphAfter
举一反三
已知函数f(x)=x,g(x)=alnx,a∈R.若曲线y=f(x)与曲线y=g(x)相交,且在交点处有相同的切线,求a的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
最新试题
- 1表现了闻一多先生的什么精神?急呀..
- 2We___ the same. A.are look B.looks C.look D.look at
- 3物理书上说在通常情况下冰水混合物的温度是0摄氏度,请问什么叫通常情况,冰水混合物可以达到别的温度吗
- 4幂的乘方是指几个相同的()相乘
- 5修改病句 1人类在长期的改造和认识自然的劳动实践中积累了丰富的经验.缩句 1这是第一条完全由我国的工程
- 6同意句:for example,plot needs to be thought of
- 7在离子反应中离子的浓度的变化这么可以看出?
- 8Lily is playing soccer with Tom
- 9张老师家的电话号码是7位数,前三位和后四位 相加是2529 前四位和后三位相加是9063,问张老师电话号码
- 10英语翻译
热门考点