Skip to main content
Participant
September 3, 2013
Question

Include generated .swf --> .fla

  • September 3, 2013
  • 1 reply
  • 463 views

Hello,

I take one program to make slides because normally I don't work with Flash, and now I wan't to create a new .fla who contents a lot of that swf's.

I tried with:

- Actionscript 2.0:

· myMovieClipInstance.loadMovie("puertas/puertas.swf");

· var myLoader:MovieClipLoader = new MovieClipLoader(); myLoader.loadClip("puertas/puertas.swf", myContainer);

- Actionscript 3:

· loader.load(URLRequest("puertas/puertas.swf"), context); loader.x=Xpos; loader.y=Ypos; addChild(loader);

· var context:LoaderContext = new LoaderContext(false, new ApplicationDomain()); var loader:Loader=new Loader(); var defaultSWF:URLRequest=new URLRequest("reformas.swf"); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete); loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress); loader.load(defaultSWF, context); loader.x=Xpos; loader.y=Ypos; addChild(loader);

Putting created .swf in the same directory, outside... I fail to address this development. Can someone help me?

DOWNLOAD one of the SWF TO LINK

Best regards

PD: The code may be in wrong place?

This topic has been closed for replies.

1 reply

Inspiring
September 3, 2013

you should at least get 2 errors, since in your eventlistener you are referencing 2 functions that are not available in the code you show:

onComplete, onProgress

function onProgress(evt:ProgressEvent):void {   

var nPercent:Number = Math.round((evt.bytesLoaded / evt.bytesTotal) * 100);    loadingAnim.bar.scaleX = nPercent / 100;

trace(nPercent.toString() + "%");

}

function onComplete(evt:Event):void {

loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, onProgress);

loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, onComplete);

addChild(loader);//only add the contents if loader is done

}

urkoooAuthor
Participant
September 3, 2013

Thanks! I wrote well, right? But doesn't work with http://pastelink.me/dl/3a4d6e

PD: Finally HTML5 · CSS3 and JQUERY saved me