国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 辦公 > Flash > 正文

Flash簡單實現(xiàn)網(wǎng)頁中的Flash動畫全屏

2024-09-12 17:50:30
字體:
來源:轉載
供稿:網(wǎng)友

  Flash播放器自從升級到Flash Player 9,0,28,0,也可以使網(wǎng)頁中的Flash通過一個簡單的按鈕實現(xiàn)全屏顯示,和一些視頻網(wǎng)站中的效果基本相同,但是在這個教程里是沒有使用Javascript腳本的啊!

  需要我們在網(wǎng)頁中插入Flash代碼時,必須加上下面的代碼:

<param name="allowFullScreen" value="true" />

  實現(xiàn)網(wǎng)頁中的Flash動畫全屏顯示源代碼

  啟動Flash,制作一個按鈕元件,然后把按鈕放到主場景中,為按鈕添加代碼:

on(press){  toggleFullScreen();}
 

函數(shù)toggleFullScreen()是主要來控制窗口,函數(shù)定義如下。

//Don't scale the movie when the stage size changesStage.scaleMode="noScale";//Align the stage to the top leftStage.align = "TL";//Function to toggle between fullscreen and normal size//the toggle fullscreen button calls this function when pressedfunction toggleFullScreen(){  //if normal size, go to fullscreen, else go to normal size  if(Stage["displayState"]=="normal"){    Stage["displayState"]="fullScreen";  }else{    Stage["displayState"]="normal";  }}//Create a listener for each time the Stage is resizedvar resizeListener:Object = new Object();//Called each time the stage is resizedresizeListener.onResize = function () {  //Move the button to the center of the screen  toggleFullScreenButton._x=Stage.width/2;  toggleFullScreenButton._y=Stage.height/2;}//Add the listener to StageStage.addListener(resizeListener);

這樣就制作好了!

當我們把上面制作的Flash插入到網(wǎng)頁中時,具體代碼如下:

<object data="http://www.survivalescaperooms.com/upfiles/20071018/20071018224608_fullscreen.swf"type="application/x-shockwave-flash" width="400" height="200" ><param name="movie" value="http://www.survivalescaperooms.com/upfiles/20071018/20071018224608_fullscreen.swf" /><param name="allowFullScreen" value="true" /></object>


就可以看到前面的全屏和收縮效果了!

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 六安市| 铁岭县| 顺平县| 沅江市| 邳州市| 汾阳市| 三河市| 邵阳县| 双城市| 双桥区| 图们市| 青田县| 临潭县| 阳东县| 木里| 平利县| 大庆市| 绍兴市| 连平县| 商都县| 竹北市| 玛沁县| 武穴市| 临邑县| 阿城市| 石阡县| 广德县| 砚山县| 威宁| 民权县| 伊宁市| 齐河县| 内江市| 凤翔县| 日土县| 马鞍山市| 永年县| 双柏县| 上蔡县| 辉南县| 古田县|