怎么去掉Flex4生成的SWF加载时的进度条
方法1:
[xhtml] view plaincopyprint?
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" usePreloader="false">
方法二:
重写Preload的进度条类
[xhtml] view plaincopyprint?
package com.haso.flex4SH.component
{
import flash.display.Sprite;
import flash.events.Event;
import flash.events.ProgressEvent;
import mx.events.FlexEvent;
import mx.preloaders.DownloadProgressBar;
public class pbarunsee extends DownloadProgressBar
{
public function pbarunsee()
{
super();
}
override public function set preloader( preloader:Sprite ):void {
preloader.addEventListener( ProgressEvent.PROGRESS , SWFDownloadProgress );
preloader.addEventListener( Event.COMPLETE , SWFDownloadComplete );
preloader.addEventListener( FlexEvent.INIT_PROGRESS , FlexInitProgress );
preloader.addEventListener( FlexEvent.INIT_COMPLETE , FlexInitComplete );
}
private function SWFDownloadProgress( event:ProgressEvent ):void {
this.visible=false;
}
private function SWFDownloadComplete( event:Event ):void {this.visible=false;}
private function FlexInitProgress( event:Event ):void {
this.visible=false;
}
private function FlexInitComplete( event:Event ):void
{
dispatchEvent(new Event(Event.COMPLETE));
}
}
}
[xhtml] view plaincopyprint?
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
minWidth="955" minHeight="600" preloader="com.haso.flex4SH.component.pbarunsee">