4://星形
begin
Randomize;
if random(1)=0 then
mask := xMovie.AddStar(round(swfw/2), round(swfh/2), round(sqrt(swfw*swfw+swfh*swfh)), round(sqrt(swfw*swfw+swfh*swfh)/2), random(30)+3, false)
else
mask := xMovie.AddStar(round(swfw/2), round(swfh/2), round(sqrt(swfw*swfw+swfh*swfh)), round(sqrt(swfw*swfw+swfh*swfh)/2), random(30)+3, true);//两种不同的星形
mask.SetSolidColor(cswfGreen);
maskSprite := xMovie.AddSprite;
maskSprite.PlaceObject(mask, 1);
for i:=0 to myDelay(delaytime) do
begin
With maskSprite.PlaceObject(mask, 1) do
begin
translatex:= round(swfw/2-swfw/2/myDelay(delaytime)*i);
translatey:= round(swfh/2-swfh/2/myDelay(delaytime)*i);
SetScale(i/myDelay(delaytime), i/myDelay(delaytime));
RemoveDepth := true;
end;
maskSprite.ShowFrame;
end;
xMovie.PlaceObject(xMovie.Shapes[nxh],maskSprite, 1) ;
With xMovie.PlaceObject(xEM.Sprite, 3) do
begin
Name := 'd2';
end;
xMovie.ShowFrame(myDelay(delaytime));
end;
5://花形
begin
Randomize;
mask := xMovie.AddStar(round(swfw/2), round(swfh/2), round(sqrt(swfw*swfw+swfh*swfh)*0.6), round(sqrt(swfw*swfw+swfh*swfh)*2), random(10)+3, true);
mask.SetSolidColor(cswfGreen);
maskSprite := xMovie.AddSprite;
maskSprite.PlaceObject(mask, 1);
for i:=0 to myDelay(delaytime) do
begin
With maskSprite.PlaceObject(mask, 1) do
begin
translatex:= round(swfw/2-swfw/2/myDelay(delaytime)*i);
translatey:= round(swfh/2-swfh/2/myDelay(delaytime)*i);
SetScale(i/myDelay(delaytime), i/myDelay(delaytime));
RemoveDepth := true;
end;
maskSprite.ShowFrame;
end;
xMovie.PlaceObject(xMovie.Shapes[nxh],maskSprite, 1) ;
With xMovie.PlaceObject(xEM.Sprite, 3) do
begin
Name := 'd2';
end;
xMovie.ShowFrame(myDelay(delaytime));
end;
6:水平百叶窗
begin
mask := xMovie.AddRectangle(0,0,swfw, 10);//画矩形
mask.SetSolidColor(cswfGreen);
tempmaskSprite := xMovie.AddSprite;
for i:=0 to myDelay(delaytime) do
begin
with tempmaskSprite.PlaceObject(mask, 1) do
begin
setscale(1,i/myDelay(delaytime)+0.2);
if i>0 then RemoveDepth := true;
end;
tempmaskSprite.ShowFrame;
end;
maskSprite := xMovie.AddSprite;
for i:=0 to round(swfh/10-1) do
begin
with maskSprite.PlaceObject(tempmaskSprite, i) do
begin
SetTranslate(0,i*10);
end;
end;
maskSprite.ShowFrame(myDelay(delaytime));
xMovie.PlaceObject(xMovie.Shapes[nxh],maskSprite, 1) ;
xMovie.PlaceObject(xEM.Sprite, 3) ;
xMovie.ShowFrame(myDelay(delaytime));
end;
end;
end; 采用swfsdk不仅可以对SWF文件加图像,而且可以加声音、文字及Flash中按钮等一些元素,更复杂的例子可参考相关书籍。
|