Loading an AS2 Swf into an AS3 project

I have a need to be able to load legacy AS2 SWF's into a new
AS3 project. I know that this is not readily possible, because you
can only communicate between the two via the LocalConnection class.
So, what I have done is to create an AS2 proxy SWF. This SWF will
handle the loading of all legacy SWF's and act as a middleman to
pass the function calls between the pre-compiled SWF and the new
SWF using the LocalConnection class. The new SWF also needs to be
able to load AS3 SWF's, though.
Because of this, I have the need to detect the AS version of
the loaded SWF. If 1 or 2, then change the source to the
AS2Proxy.swf, if 3 then simply load it.
I have written the following code. My problem comes in when
the init event fires. Regardless of the compiled version of the
loaded SWF, it always traces 3 as the AS version.

Alright, I solved this problem, only to come up with many
more.
To solve this problem, I needed to point to the loaderInfo
object of the UILoader's content. So:
simulation.content.loaderInfo.actionScriptVersion.
Now the proxy loads correctly, but I start getting errors
immediately. Let me paste some code to show the next steps:
First off. I immediately receive a StatusEvent error, though
the path gets sent into the proxy and loads correctly.
Next, when the complete event fires in the AS2 SWF - it sends
a completion back up to let the AS3 SWF know that it finished (and
any handling that needs to happen at that point.) I receive the
following error:
Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095:
flash.net.LocalConnection was unable to invoke callback loadSwf.
error=ReferenceError: Error #1069: Property loadSwf not found on
com.applied.flash.events.AS2Connect and there is no default
value.

Similar Messages

  • Loading an AS2 swf into a AS3 project?

    I have an AS2 swf that is merely an image gallery made with a few components. I tried loading this swf into an AS3 project I am working on and it seems to load in and play properly in my AS3 file. I'm not looking to communicate with the AS2 swf with AS3 code, I just want to display it and be able to use the component buttons in the AS2 file that play or stop the images from being played.  I was wondering if using this will cause any potential issues in my AS3 project. It seems to render and work fine on my machine. Thanks

    as2 swfs will play without problem when loaded into an as3 swf.

  • Is loading a as2 swf into my as3 flash site the problem here?

    My question is listed on another board here, but I am too inexperienced to understand how to fix my issue:
    http://forums.adobe.com/message/5045059#5045059
    I went on flashkit.com and a member there immediately said that it "sounds like the problem is using the AS2 swf loaded into the AS3 swf."
    If it is... this mean I will have to convert everything in the AS2 .swf (including the XML retrieval script) to AS3. I may need some help with that if that is the problem.
    So will AS2 swfs cause XML communication and retrieval issues if loaded with a loader script into an AS3 file?
    Everything works (the buttons are clickable and when you click on a square in the "thumbnails" scroller it displays the correct photo title and captions), except I just cannot see the actual photos in my XML gallery. I am truly clueless as to why this happens and I've searched for days straight and tried many things...
    You'll find all the details of my problem in the above link.
    Thanks!

    Its really not worth the trouble to get as2 working with as3 if your goal is to make an xml driven gallery. There are literally thousands of free examples/tutorials how to achieve that feature with 50+ LOC. Like this one.

  • How do you load an AS2 swf into AS3?

    I think this is the way around my dilemma. How do you load and AS2 .swf into an AS3 file?
    thanks again!
    Steve

    check that code in your last thread:
    What is the  code to load a .swf file in AS3 on the same layer?

  • Loading a Flex3 SWF into an AS3 SWF

    I have an AS3 shell project which bootstraps my application
    by loading several other AS3 and Flex3 SWFs. The problem I am
    seeing is that tooltips in the Flex3 SWFs never show up. The events
    trigger properly but they simply never appear. Anyone know how I
    can get this to work?

    Anyone?

  • Load AS2 swf into AS3 swf problem

    I have a flash with AS3 and inside this swf i load in a AS2 swf.
    to load swf works just fine, but the problem is when i load this i want to go to
    a specific part of it, for example i want to go to frame 3 in the loaded swf.
    i must control this from the AS3 swf, does someone know if this is possible?
    thanks in advance

    so can i do like this then to go to frame 3 in my loaded swf?
    MovieClip(ldr.content).gotoAndStop(3); ?
    sorry for being such an airhead
    thanks for helping me out =)
    Date: Sun, 7 Jun 2009 10:25:09 -0600
    From: [email protected]
    To: [email protected]
    Subject: load AS2 swf into AS3 swf problem
    no.
    if, in your loaded swf, you have a function f1() on the loaded swf's main timeline and you load that swf using a loader (say ldr), use:
    MovieClip(ldr.content).f1();   // to call f1() in the loaded swf
    >

  • Inserting A SWF into a Captive Project

    Hi All,
    I'm trying to insert a swf into my captivate project. It goes
    onto the slide with no problem but when I preview the project the
    swf is not animated. I'm using AS3 to code the animation so there
    is only one frame. I set the frame rate in Captivate to match the
    frame rate of the swf with no success. Any help is appreciated,
    thanks.

    Hi there
    I suppose that's possible. I'm not a Flash Coder yet but
    would imagine the sky is the limit once you get things into Flash,
    as at that point it's a Flash project, no? I don't believe an
    avenue exists to take a Flash project and pop it into Captivate.
    (By that, I mean to export from Flash as a .CP file - I am well
    aware that one may create a .SWF from Flash and pop it into
    Captivate as an Animation)
    Cheers... Rick

  • How can I load an external SWF into a movie clip that's inside other movie clip?

    Hi.
    I creating my first flash (actionscript 3.0) website but I'm
    stuck with a visual effect I want to create.
    I have a window on my website called contentWindow. Every
    time you click a button this window is supposed to leave the stage,
    load the requested content and return to the stage.
    The sliding window is a movie clip with 83 frames, 21 to
    enter the stage, 21 to leave the stage again, 20 for nothing (its
    just to simulate the loading time) and 21 to return to the stage.
    Now my goal is, when the user clicks on a navigation button,
    the window exits the stage, loads an external SWF with the content,
    and then returns to the stage.
    I've the "window" movie clip with an instance name of
    "contentWindow". Inside there is another movie clip with an
    instance name of "contentLoader". The content that the user
    requested should appear inside the "contentLoader".
    Now, when the contentWindow leaves the stage, I get this
    error message:
    quote:
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at rwd_fla::MainTimeline/trigger()
    If I switch
    "contentWindow.contentLoader.addChild(navLoader);" for
    "contentWindow.addChild(navLoader);" it works fine, but the
    external SWF doesn't move with the window.
    How can I load an external SWF into a movie clip that's
    inside other movie clip?

    Hi,
    Recently, I have been putting together a flash presentation.
    And I am just wondering if the following might help you, in your
    communication with the said swf file:
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
    onComplete);
    function onComplete(event:Event):void
    event.target.content.thinggy_mc.y -= 100;
    Not the best example, but this allows you to target a mc
    within an external swf file. I think if you look up this code, you
    will have an answer ;)
    Kind Regards,
    Boxing Boom

  • Loading an external .swf into an empty container

    I'm loading an external .swf into an empty container.
    Everything seems to work fine except when the .swf is loaded both
    seems to be running extremely sluggish. The button rollovers are
    slow, the page transitions..everything. I can't figure out why it
    is doing this. Both .fla's have the same frame rate. Is there some
    known reason why this might happen?

    well, we've tried that and it is actually a little bit worse.
    Normally i test everything in a browser window anyway. I'm thinking
    it might be a naming issue of some variable or something that is
    the same for both fla's....not sure yet though.

  • Load AS2 swf into AS3 swf

    here is the code i'm using:
    var url:String = "avm1.swf";
    var urlrequest:URLRequest = new URLRequest(url);
    var loader:Loader = new Loader();
    loaderListener(loader.contentLoaderInfo);
    loader.load(urlrequest);
    function loaderListener(dispatched:IEventDispatcher){
    dispatched.addEventListener(Event.COMPLETE, assignSWF);
    function assignSWF(event:Event){
    addChild(loader.content);
    here is the error i get:
    It is illegal to move AVM1 content (AS1 or AS2) to a
    different part of the displayList when it has been loaded into AVM2
    (AS3) content.
    Is there a different way to do this?

    addChild(loader)

  • LoadMovie- loading an external swf into movieclip in AS3

    Im extremely frustrated.........im trying to do something
    that was once very simple, which has now become over complicated
    unecessecarily.....i want to do a simple loadMovie type action and
    load an external clip into a movieclip called ph. my AS2 code would
    be:
    loadMovie("ExternalMovieClip.swf","ph");
    or
    on(release) {
    loadMovie("ExternalMovieClip.swf","ph");
    This no longer works. Can somebody tell me the new code that
    i would use with AS3 to do exactly what i just demonstrated? I
    honestly dont even want to touch AS3. The only reason i want to use
    it is because it makes skinning the components SOOOOOO much easier
    than AS2. That is the one and only reason im trying to convert to
    AS3. All the new load movie AS3 examples ive seen on google look
    like half a page long to do what i used to do in 2 lines. There
    must be a simpler and much easier way. I am a designer. It looks to
    me like Adobe went back to making flash for programmers only again
    leaving us designers out of the mix. Someone please help me, im
    desperate. I also have other old code that im sure im going to have
    to convert to AS3 for it to still work, and i may eventually need
    help with that as well, but ill stick with this loadMovie problem
    for now. Any and all help is appreciated. Thanks

    have a look here:
    http://www.smithmediafusion.com/blog/?p=381
    use this:
    var i =new Loader();
    i.load(new URLRequest(”yourSwf.swf”));
    myMC.addChild(i)
    myMC is the name of your clip on the stage.
    Dan Smith > adobe community expert
    Flash Helps >
    http://www.smithmediafusion.com/blog/?cat=11
    http://www.dsmith.tv

  • Other problems with loading Captivate files into Flash AS3 project

    I have a Captivate file done with Captivate 3, published to
    Flash player 9 that is being loaded into Flash AS3. The captivate
    is a simple recording of some mouse clicks in a browser. I am
    displaying the playbar along the bottom, and its buttons all work
    fine except for the progress bar, where you can drag the knob and
    scrub back & forth in your presentation.
    This progress bar is not working as it should. I see the
    mouse cursor change to a hand, but when I click I cannot drag the
    knob to control the progress bar. The other buttons in the playbar
    do work (replay, pause, play, back, forward).
    This is a unique problem in that it is only happening when
    viewed in IE (7) when loaded into my Flash AS3 project. When viewed
    in Firefox in my project, or as a standalone SWF, or as a SWF
    simply embedded onto a plain HTML page, it works just fine.
    Does anybody have any insight?
    Another thing I notice with loading Captivate files with AS3
    is the the amount of output messages it displays. Rather annoying
    (unless this is a "feature" I've yet to be aware of - heh)

    Hi,
    I know exactly how you feel, there is simple answer; replace
    Captivate for Camtasia Studio 5 at techsmith.com. The weight on
    those shoulders will be gone! You'll smile more, be more
    socialable. One Happy Person.
    I am very happy person ;)
    Kind Regards,
    Boxing Boom

  • AS2 swf problem under AS3 swf (probably Tweener problem)

    Hello. I have this problem for a days and it hasn't been soluted yet although I put it on couple of forums. I have 3 files: test.fla, file_as2, file_as3.
    The test.fla file is a typical Loader, which loads external swf files and shows them on the screen. After any key is pressed, the swf is deleted from the screen and loaded again.
    The file_as2 and file_as3 are the AS2 and AS3 compiled having a simple square animation (6 squares fading in from alpha 0 one by one) animated by caurina Tweener. If the file_as3 is compilated and loaded externally there is no problem (six sqares are fading in, after pressing any key the vanish and appear (loaded) again and again...). But if the swf as2 file is loaded, it shows the squares only once and after pressing any key and loading it again, it doesn't shows it at all.
    I guess it's Tweener problem, because when i trace it in AS2 file (onUpdate) it traces only at the beginning.
    How it's possible, that AS3 somehow stops all Tweeners in 2nd time loaded AS2 file?? How to fix it?? Sorry for my english, i left a link for these 3 files to find solution. Try it (test.swf) and then change path inside fla to load AS2 file... Thanks for any ideas.
    Link to download: http://www.filolozka.pl/zip/file.ZIP

    Instead of reusing the same Loader, try loading the AS2 movie multiple times using different Loader instances. Instead of using event listeners like normal, this should be easy to do because you can addChild each Loader instance, and when it is loaded it will automatically play. If you are able to load the AS2 movie multiple times at once and have it work for you, then the problem must be in the way that you removing the old movie, and reusing code to load the movie again.

  • Loading an external SWF into movie?

    I am trying to laod an SWF into and empty movie clip using no
    human interaction. I.e the ovie laods once a certain point in the
    timeline is reached.
    Here is the code I have
    Can anyone help?

    i dont see how that code would work at all, to be honest...
    But, there are sooo many variations of a pre-loader, that it
    wouldnt surprise me if it did work.
    your formula is wrong. it should be...
    Math.round((loadedbytes/totalbytes) * 100)
    by your code i see that you are sending the playhead to the
    frame equal to the ammount loaded.
    In this case, you need the ammount loaded to be a WHOLE
    number, and not decimal numbers, as you can't say
    gotoAndPlay(5.22984749); for eg..
    ok this code should go on the first frame of the SWF you are
    loading into your main SWF.
    If its not there...it needs to be there.
    second: this pre-loader does what it's supposed to...but it
    doesnt specify the "who" part of the code.
    try thiese 2 alternatives..
    loadedbytes = this.getBytesLoaded();
    totalbytes = this.getBytesTotal();
    frame = int(loadedbytes/(totalbytes/100));
    if (frame > 100) {
    frame = 100;
    if (loadedbytes == totalbytes) {
    // this takes you to the next scene
    this.gotoAndPlay(5);
    OR
    this._lockroot = true;
    loadedbytes = _root.getBytesLoaded();
    totalbytes = _root.getBytesTotal();
    frame = int(loadedbytes/(totalbytes/100));
    if (frame > 100) {
    frame = 100;
    if (loadedbytes == totalbytes) {
    // this takes you to the next scene
    _root.gotoAndPlay(5);
    let me know how you go.

  • Loading an external swf into my parent swf?

    Does anyone know how I can load an external .swf file into my
    parent file? I have tried to use loader actionscript but think I am
    using the incorrect script or putting it in the wrong place? If
    anyone can tell me the script and where to/how to use it that would
    be amazing? Thanks

    thanks GWD!
    I am using the unloadMovieNum(); command, i have loaded the
    child into level 5 of my parent swf. the parent has multiple scenes
    this one with a layer with a stop(); action and another layer with
    the loadMovieNum("portfolioone.swf", 5); script. it loads the child
    perfectly. The child has a number of pictures in it and a back
    button at the end. I have been adding the
    on (release) {
    unloadMovieNum(5);
    script to the button which unloads the child but stops
    because of the stop action in the first frame of the particular
    scene within the parent. I want to be able to add a script to this
    button which will take me back to a labeled frame in a particular
    scene of the parent, I tried the this.removeMovieClip(); but
    doesn't seem to be working for me, Thanks for the reply, hope you
    can help me further??

Maybe you are looking for

  • Post goods issue

    hi if a order is created for a material 'X' for quantity=50.while delivering the order in VL01N if the delivering and picking qty is given 40 and a post goods issue is done after that in VL02N if we change the delivering and picking qty to 50 and do

  • Stuck Shift Key (Help!!)

    I needsome help! I've been having a LOT of problems with my MacBook Unibody late 2008 with Lion installed.  The shift key is stuck. At first I thought it was a bug and restored everything from a timemachine backup. Nothing changed. The computer refus

  • History in the menu is stuck on pages I visited a month ago

    When I hit "Show all History" in the History Menu... all the history is indeed displayed. However the sites I visited a week or 3 back are all stuck in the tab under History

  • 2 Gamecenters on 1 Apple ID!? Help!

    So on Friday of last week, I signed out of Gamecenter and then tried to log back in, however, here's what happened: Gamecenter said I had to accept new terms and conditions. Used E-mail associated with my Apple ID to log into Gamecenter and it asked

  • Finding duplicate photos

    Hello everyone. Is there a facility in OSX, perhaps Automator that could help me find on my harddrive duplicate photos. I am aware of 'photo diet' for iPhoto but I was hoping for something many times quicker. I have around 8000 images, I estimate 20%