kiri_fla
初心者

投稿: 32
|
 |
« 投稿日:: 2月 07, 2010, 03:05:19 午前 » |
|
いつもお世話になってます。 WinXp Flash CS3 progression 4 beta 1.3
他のスレで「SceneLaoderで事前によみこませたい」(http://forum.progression.jp/index.php?topic=217.0)と同じことだと思いますが、どうしても分からずスレッドを立てました。(ルール違反でしたら申し訳ありません。)
またいくつか疑問点があります。
まずProgression4 sampleにてシーンローダーを使用したサンプルを元に単体で読み込んだ場合にローディングを設定してみようと思いサンプルでのGallerySceneLoaderにて下記のように記述しました。 *barsetはライブラリに登録してあるリンケージ名から作成したMC
protected override function atScenePreLoad():void { _loadscene = new LoadScene(new URLRequest("gallery.swf")), _loadscene.loader = this; _loadscene.onStart=function():void { _barset = new barset(); manager.stage.addChild(_barset); _barset["bar"].scaleX = 0; }; _loadscene.onProgress = function():void { _barset["bar"].scaleX = _loadscene.percent / 100; }; _loadscene.onComplete = function():void { insertCommand( new DoTweener(_barset, {alpha:0,time:1} ) ); } addCommand( _loadscene, new Func(finish) ); } private function finish():void{ trace("complete"); manager.stage.removeChild(_barset); _barset = null; }
■疑問点 間違ってる??かもしれませんが、読み込んでIndexSceneからGallerySceneに移動するとローディングが表示されますが、2回目以降にGallerySceneに移動してもローディングが表示されず。スクリプトの書き方が悪い??
上記の疑問もありますが、今度はSceneLaoderで読み込むSWFを全て事前に読み込みローディングバーに反映させたいと思ったのですが、まとめて読み込み尚且つローディングバーに反映となるとLoaderListを使用すればいいのかな??と思いIndexSceneに下記のように記述しました。
*listdata:Array=["gallery.swf","second.swf"]; //読み込むSWF
protected override function atSceneLoad():void { _naviSet = new NaviSet(); _lList = new LoaderList( { onStart:function():void { _barset = new barset(); container.addChild(_barset); _barset.y = stage.stageHeight / 2; _barset["bar"].scaleX = 0; }, onProgress:function():void { _barset["bar"].scaleX = _lList.percent / 100; }, onComplete:function():void { trace("読み込み完了"); insertCommand(new DoTweener(_barset, {x:stage.stageWidth,time:0.7,transition:"easeInOutQuint" } )); } }); addCommand( new Func(startLoad), _lList, new Trace("completeの後の処理"), new Prop(_naviSet, { x:10, y:stage.stageHeight} ), new AddChild(stage, _naviSet), function():void { container.removeChild(_barset); } ); } private function startLoad():void { //コンテンツの数 for (var i:int = 0; i < listdata.length; i++) { _lList.addCommand(addScene(new ContentSceneLoader("loader"+(i+1),{cName:listdata}))); } }
以下 ContentSceneLoader.as 内での処理
public class ContentSceneLoaderextends SceneLoader{ private var _contentname:String; // // public function ContentSceneLoader(name:String=null,initObject:Object=null) { super(name, initObject); _contentname = initObject.cName; } //SWFをロード protected override function atScenePreLoad():void { addCommand( new LoadScene(new URLRequest(_contentname),this) ); }
要はLaoderListに読み込むSWFのコンテンツの数だけaddSceneをしたら・・・と実験してみましたが、読み込みはできて
return types dont match virt void jp.nium.core.display::IExDisplayObject/jp.nium.core.display:IExDisplayObject::setProperties() over flash.display::DisplayObject jp.nium.display::ExSprite/setProperties() VerifyError: Error #1053: jp.nium.display.ExSprite の ExSprite のオーバーライドが無効です。
at global$init()
とエラーが出てしまいました。原因が分からず困ってます。どなたかご教授願えますでしょうか? やり方が間違っているだけだと思うのですが・・・・
|