Código HTML:
Aqui el primer error es este: TypeError: Error #1034: Error de conversión forzada: no se puede convertir CarpetaAS::Preloader@25cc1f99 en Preloader. at flash.display::Sprite/constructChildren() at flash.display::Sprite() at flash.display::MovieClip() at CarpetaAS::MainTimeline()
Código PHP:
package CarpetaAS
{
import flash.display.*;
import flash.events.*;
dynamic public class MainTimeline extends MovieClip
//public class MainTimeline extends MovieClip NOTA: Esto no me resulto
{
public var preloader:Preloader;
public function MainTimeline()
{
this.stop();
//addFrameScript(1, this.frame2); NOTA: Esto no me resulto
this.preloader.addEventListener(Event.COMPLETE, this._initContent);
return;
}// end function
private function _initContent(event:Event) : void
{
this.preloader.removeEventListener(Event.COMPLETE, this._initContent);
this.removeChild(this.preloader);
nextFrame();
// return;
}// end function
}
}
Código PHP:
//public var preloader:Preloader;
Aqui: Preloader.as
Código PHP:
package CarpetaAS
{
import flash.display.*;
import flash.events.*;
public class Preloader extends Sprite
{
private var _targetLoaderInfo:LoaderInfo;
private var _loadPercent:Number = 0;
public var progBar:MovieClip;
public function Preloader()
{
this.addEventListener(Event.ADDED_TO_STAGE, this._init);
return;
}// end function
private function _onCheckLoaded(event:Event) : void
{
this._loadPercent = this._targetLoaderInfo.bytesLoaded / this._targetLoaderInfo.bytesTotal;
this.progBar.scaleX = this._loadPercent;
if (this.progBar.scaleX == 1)
{
this.removeEventListener(Event.ENTER_FRAME, this._onCheckLoaded);
this.dispatchEvent(new Event(Event.COMPLETE));
}
return;
}// end function
private function _init(event:Event) : void
{
this._targetLoaderInfo = stage.loaderInfo;
this.progBar.scaleX = 0;
this.removeEventListener(Event.ADDED_TO_STAGE, this._init);
this.addEventListener(Event.ENTER_FRAME, this._onCheckLoaded);
return;
}// end function