·您当前的位置:首页 > 技术教程 > AS2与AS3技术 >

[AS3]as3数组元素如何实现分页功能代码示例(3)

时间:2012-09-14 14:04bbs.9ria.com
测试类: package { importflash.display.Sprite; importpages.Page; importpages.PageManager; publicclassMainextendsSprite { privatevarpage:PageManager; publicfunctionMain() { page = new PageManager(); in

测试类:

  1. package   
  2. {  
  3.         import flash.display.Sprite;  
  4.         import pages.Page;  
  5.         import pages.PageManager;  
  6.         public class Main extends Sprite  
  7.         {  
  8.                 private var page:PageManager;  
  9.                 public function Main()  
  10.                 {  
  11.                         page=new PageManager();  
  12.                         init();  
  13.                 }  
  14.                 private function init():void  
  15.                 {  
  16.                         var array:Array=new Array();  
  17.                         for (var i:int=0; i<10; i++)  
  18.                         {  
  19.                                 array.push(i);  
  20.                         }  
  21.                         page.page(array);  
  22.                         var pg:Page =page.current;  
  23.                         for(var t:int=0;t<page.count;t++)  
  24.                         {  
  25.                                 if (pg)  
  26.                                 {  
  27.                                         trace(pg.index,":",pg);  
  28.                                         pg=page.next();  
  29.                                 }  
  30.                         }  
  31.                 }  
  32.         }  

 

热门文章推荐

请稍候...

保利威视云平台-轻松实现点播直播视频应用

酷播云数据统计分析跨平台播放器