actionscript 3 - loading external movie as2 wrapper -



actionscript 3 - loading external movie as2 wrapper -

load as2 swf as3 swf , pass vars in url

i'm trying load in as3 file external as2 swf file (of dont have access fla file). according explanation given in link above, solution utilize as2 wrapper original as2 file (and found localconnection between the as3 , as2 files). i've tried that, although film seems load in as3 file, doesnt start, doesnt play , gets stuck in first frame. how play film (as load it)? help.

my as3 file is:

import com.gskinner.utils.swfbridgeas3; var loader = new loader() loader.load(new urlrequest("as2_test.swf")); addchild(loader); var sb1:swfbridgeas3 = new swfbridgeas3("test",this);

my as2 file is:

import com.gskinner.utils.swfbridgeas2; var sb1 = new swfbridgeas2("test",this); sb1.addeventlistener("connect",this); var loader:moviecliploader = new moviecliploader(); loader.addlistener(this); loader.loadclip("digestive.swf", mainloader_mc);

edit: maintain having problem. have far:

as2 file - as2test.fla (this needs download as2 file -digestive.sfw , acts wrapper found connection between original as2 file , main as3 file)

import com.gskinner.utils.swfbridgeas2; var sb1 = new swfbridgeas2("test",this); sb1.addeventlistener("connect",this); var my_pb:mx.controls.progressbar; my_pb.mode = "manual"; this.createemptymovieclip("img_mc22", 999); var my_mcl:moviecliploader = new moviecliploader(); var mcllistener:object = new object(); mcllistener.onloadstart = function(target_mc:movieclip):void { my_pb.label = "loading: " + target_mc._name; }; mcllistener.onloadprogress = function(target_mc:movieclip, numbytesloaded:number, numbytestotal:number):void { var pctloaded:number = math.ceil(100 * (numbytesloaded / numbytestotal)); my_pb.setprogress(numbytesloaded, numbytestotal); trace(pctloaded); }; my_mcl.addlistener(mcllistener); my_mcl.loadclip("digestive.swf", img_mc22); stop();

as3 file (this plays as2 wrapper):

import flash.net.urlrequest; import flash.display.loader; import flash.events.event; import flash.events.progressevent; function startload() { var mloader:loader = new loader(); var mrequest:urlrequest = new urlrequest("as2test.swf"); mloader.contentloaderinfo.addeventlistener(event.complete, oncompletehandler); mloader.contentloaderinfo.addeventlistener(progressevent.progress, onprogresshandler); mloader.load(mrequest); } function oncompletehandler(loadevent:event) { addchild(loadevent.currenttarget.content); } function onprogresshandler(mprogress:progressevent) { var percent:number = mprogress.bytesloaded/mprogress.bytestotal; trace(percent); } startload(); stop();

in as2 wrapper file, original film plays until frame; in as3 file, as2 wrapper file plays first frame. have do?????

actionscript-3 actionscript-2 localconnection

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -