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
>

Similar Messages

  • Problems with loading AS2 assets into AS3 container

    Hello,
    in a Project I use the AS3 Loader Class to load
    AS2-swf-files. The swf-files are placed into different subfolders,
    since they're using the same filenames and subfoldernames for
    config-files etc.
    The Problem is: Whatever swf-file I load first, it is
    working, but every swf-file after that fails. It seems to be
    loaded, but it's not working correctly.
    I'm using the attached code (easy as it seems) to unload the
    present content and then loading the new one. But also using a
    separated second loader to load the second file is not working.
    I made some kind of testcase (a loader with 2 content
    swf-files) for you, so you can understand what I'm talking about.
    Here you can download the
    testcase (28
    MB).
    It seems like there is a bug in the flash player 9 that
    prevents the AS2-content from being unloaded correctly from an AS3
    file. Can you confirm that there is such a bug? Or do you have an
    explanation for this behavior? Or even better: a solution or
    workaround?
    Thanks a lot!

    Thanks for your help, but as said ("But also using a
    separated second loader to load the second file is not working.")
    even when using a second loader (with a different name) the second
    file loaded will not work.
    I'm removing any EventListener from the first loader,
    unloading and then nulling it.
    But to me it seems, that the first content is not garbage
    collected and because of that, even when loaded with an other
    loader the first loaded swf-file interferes with the second.
    I came to this conclusion, because the first loaded swf-file
    is still working after trying to load the second file. And just
    more weird: the first loaded file is in the same state and also
    after closing the Flash-Player.
    You can see it for yourself: download the testcase. Start the
    testcase.swf. Load a contentfile. Skip a few pages. Quit the Flash
    Player. Start the testcase.swf again and load the same contentfile.
    You will see it's at the same position like before quiting the
    Player.
    And I can't help, but that seems like a bug to me...

  • Loading muliple accordions into as3 swf

    I have an application written in AS3 that is loading swfs written in  AS2.  Most of them work fine, except for ones that contain the old AS2  accordion component.  Loading one results in it working correctly, but  each one that is loaded after it breaks the previous one (the content no  longer shows and the mask disappears).  It's not just limited to the  accordion, any of the AS2 components that came with Flash Pro cause  breakage.  I've tried loading the swfs to separate movieclips, tried  using applicationDomain, tried everything else I can think of.   Rewriting the swfs in AS3 is not an option due to circumstances out of  my control.  Any thoughts, ideas, even snide remarks would be welcomed.   Thanks.

    AS3 and AS2 stuff actually run in different VMs... to my knowledge, you can't have anything in AS3 in the same display tree as anything in AS2. Sorry, but you might be out of luck with this one...

  • 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)

  • Problem going to fullscreen after loading AS2 movie into AS3

    I've got a loader movie that is written in AS3, and
    fullscreen is enabled. I have a context-menu fullscreen trigger and
    a keypress fullscreen trigger built into the loader movie. When I
    load an AS3 movie or an AS1 movie through the loader movie, I can
    go to fullscreen without problems. When I load the AS2 movie, I
    cannot.
    Does anyone have an idea why this might be? I'm struggling.
    Thanks in advance.

    Thanks for your help, but as said ("But also using a
    separated second loader to load the second file is not working.")
    even when using a second loader (with a different name) the second
    file loaded will not work.
    I'm removing any EventListener from the first loader,
    unloading and then nulling it.
    But to me it seems, that the first content is not garbage
    collected and because of that, even when loaded with an other
    loader the first loaded swf-file interferes with the second.
    I came to this conclusion, because the first loaded swf-file
    is still working after trying to load the second file. And just
    more weird: the first loaded file is in the same state and also
    after closing the Flash-Player.
    You can see it for yourself: download the testcase. Start the
    testcase.swf. Load a contentfile. Skip a few pages. Quit the Flash
    Player. Start the testcase.swf again and load the same contentfile.
    You will see it's at the same position like before quiting the
    Player.
    And I can't help, but that seems like a bug to me...

  • Load AS2 SWF in AS3 SWF with FlashVars

    I am able to load SWF which is created using AS2 in to AS3
    SWF but I am not able to pass Flashvars to it..
    Does any one has any idea, how can I do that??
    Thanks

    You can talk to loaded AVM1 (AS1/2) SWF using LocalConnection. I used Grant Skinner's SWFBridge class in the past and worked very well:
    http://gskinner.com/blog/archives/2007/07/swfbridge_easie.html
    Kenneth Kawamoto
    http://www.materiaprima.co.uk/

  • External as2 userDrawingTablet into as3

    created a tablet where the user could draw on the pad. i did it a while ago using actionscript 2. now i'm loading it externally into as3. when placed in as3 it seems to be confused as to where the tablet is and draws only on the bottom right and off the page. also have a text function that is not working properly either.
    kind of a random application and random problem, but not sure where else to go with this...
    was just wondering if anyone had done this and had a similar problem?
    thanx

    "submitter" is a movie clip on the main timeline. this code is inside submitter layed out with a mc named "blackboard". blackboard has a mc named "innerBlackboard" inside of it.
    blackboard.clearChalk = function():Void {
        var cl = this._parent._parent.chalkLine;
        this.createEmptyMovieClip("chalkLayer", 0);
        this.chalkLayer.lineStyle(cl.thickness, cl.color, cl.alpha);
        this.drawings = [];
    blackboard.clearText = function():Void {
        this.createEmptyMovieClip("textLayer", 10);
        this.textfields = [];
    blackboard.clearAll = function():Void {
        this.clearChalk();
        this.clearText();
    blackboard.enterDrawMode = function():Void {
        this.innerBlackboard.onPress = this.startDraw;
    blackboard.startDraw = function():Void {
        var x:Number = Math.round(this._xmouse);
        var y:Number = Math.round(this._ymouse);
        var coordinates = [x + "," + y];
        this._parent.currentDrawing = coordinates;
        this._parent.drawings.push(coordinates);
        this._parent.chalkLayer.moveTo(x, y);
        this._parent.onMouseMove = this._parent.drawChalk;
        this.onRelease = function() {
            delete this._parent.onMouseMove;
    blackboard.endDraw = function():Void {
        delete this.onMouseMove;
        delete this.innerBlackboard.onRelease;
    blackboard.drawChalk = function():Void {
        if (this.hitTest(_root._xmouse, _root._ymouse)) {
            var x:Number = Math.round(this._xmouse);
            var y:Number = Math.round(this._ymouse);
            this.currentDrawing.push(x + "," + y);
            this.chalkLayer.lineTo(x, y);
        } else {
            this.endDraw();
        updateAfterEvent();
    blackboard.enterTextMode = function():Void {
        this.innerBlackboard.onPress = this.startText;
    blackboard.startText = function():Void {
        var d:Number = this._parent.textLayer.getNextHighestDepth();
        var x:Number = this._parent._xmouse;
        var y:Number = this._parent._ymouse;
        this._parent.textLayer.createTextField("t" + d, d, x, y, this._parent.width - x, this._parent.height - y);
        var tf:TextField = this._parent.textLayer["t" + d];
        this._parent.textfields.push(tf);
        tf.type = "input";
        tf.multiline = true;
        tf.wordWrap = true;
        tf.restrict = "^'<>";
        tf.setNewTextFormat(this._parent._parent._parent.chalkFormat);
        tf.embedFonts = true;
        tf.text = "Type message";
        Selection.setFocus(tf);
        Selection.setSelection(0, tf.text.length);
        tf.onKillFocus = function() {
            this.type = "dynamic";
            this.selectable = false;
    blackboard.formatEntry = function():String {
        var tf:TextField;
        var d:Object;
        var entryXML    =  "<entry>";
        entryXML        +=         "<text>";
        for (var i:Number = 0; i < this.textfields.length; i++) {
            tf = this.textfields[i];
            entryXML    +=            "<field x='" + tf._x + "' y='" + tf._y + "' text='" + tf.text + "' />";
        entryXML        +=         "</text>";
        entryXML        +=         "<drawings>";
        for (i = 0; i < this.drawings.length; i++) {
            d = this.drawings[i];
            entryXML    +=            "<drawing coordinates='" + d.join("|") + "' />";
        entryXML        +=         "</drawings>";
        entryXML        += "</entry>";
        return escape(entryXML);
    blackboard.clearAll();
    blackboard.innerBlackboard.useHandCursor = false;
    blackboard.width = blackboard._width;
    blackboard.height = blackboard._height;
    draw_bn.onRelease = function() {
        blackboard.enterDrawMode();
        text_bn.gotoAndStop("_Up");
        text_bn.enabled = true;
        this.gotoAndStop("_Down");
        this.enabled = false;
    text_bn.onRelease = function() {
        blackboard.enterTextMode();
        draw_bn.gotoAndStop("_Up");
        draw_bn.enabled = true;
        this.gotoAndStop("_Down");
        this.enabled = false;
    clear_bn.onRelease = function() {
        blackboard.clearAll();
    submit_bn.onRelease = function() {
        var name:String = name_if.text;
        if (name == "" || name == "name (required)") return;
        var email:String = email_if.text;
        if (email == "" || email == "email (required)") return;
        entry = new LoadVars();
        entry.name = name;
        entry.email = email_if.text;
        entry.message = blackboard.formatEntry();
        returnEntry = new LoadVars();
        returnEntry.onLoad = traceReturn;
        entry.sendAndLoad("submitEntry.php", returnEntry);
    function traceReturn() {
        if (this.result == "success") {
            blackboard.clearAll();
    name_if.onSetFocus = email_if.onSetFocus = function() {
        this.text = "";
        delete this.onSetFocus;
    name_if.restrict = email_if.restrict = "^'<>";

  • Dummy Guide needed for converting AS2 code into AS3

    I have to convert my existing AS2 code into AS3, but I might as well be reading chinese. I never even began to learn AS3, it was still fairly new at the time and the class ended before we had an opportunity to even touch on it. My major was not web design, it was the print side of design. I took an additional class, after I graduated, to learn web design and our teacher told us, basically, that we were designers, not coders so we won't be getting much into actionscripting, beyond the basics. At the time I was relieved, but looking back, I really wish we would have gotten more into it. Bottom line, I need to learn now.
    Is there ANYONE that can help me out? I will list my code below, buy I am way beyond lost any help that can be provided, I would be so grateful!!!!
    On the main timeline I have the basic..
    stop(); -- I found the AS3 version, but I don't know what I'm looking at. I get "not_yet_set.stop()" and there are are 8 options I can choose from. I just want the timeline to stop until I tell it where to go next. And what is "not_yet_set"
    Then I have my buttons, which are, basically...
    on (release) {
    gotoAndStop("Home");
    Or "gotoAndPlay("Whatever");"
    I also have buttons for scrolling...
    on (press) {
    play();
    on (release) {
    stop();
    AND
    on (press) {
    _root.AboutMe_Controller.gotoAndPlay(…
    on (release) {
    _root.AboutMe_Controller.gotoAndStop(…
    For the on(release) command, this is what I found as the AS3 version: not_set_yet.dispatchEvent()

    because that's really as1 code, you have steeper learning curve than going from as2 to as3.
    first, remove all code from objects, assign instance names to your buttons and you can then start on as3:
    // so, if you name your home button, home_btn:
    home_btn.addEventListener(MouseEvent.CLICK,homeF);
    function homeF(e:MouseEvent):void{
    gotoAndStop("Home");
    p.s.  the not_yet_set stuff is there because you tried to use script assist or some other actionscript shortcut.

  • 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?

  • Load as2 swf in as3 swf

    Hi All,
    I am new to this forum.
    Can anyone tell me how to load as2 swf in as3?
    If this is possible,can anyone give me some sample example?
    Thanks
    Harshal

    You can talk to loaded AVM1 (AS1/2) SWF using LocalConnection. I used Grant Skinner's SWFBridge class in the past and worked very well:
    http://gskinner.com/blog/archives/2007/07/swfbridge_easie.html
    Kenneth Kawamoto
    http://www.materiaprima.co.uk/

  • Convert AS2 swf to AS3 swf

    I have a swf (written in AS3) that loads other swfs into it.
    There are no issues when loading other AS3 swfs but there is a
    problem loading AS2 swfs. I get the following error:
    TypeError: Error #1034: Type Coercion failed: cannot convert
    flash.display::AVM1Movie@35d3a51 to flash.display.MovieClip.
    Is there any way to convert the AS2 swf into a AS3 swf so it
    will be compatible with my loader? I cannot go back and change the
    AS2 swfs because I do not have the fla files. Or is there any way
    to incorporate AS3 code that will load AS2 swfs properly? It seems
    hard to believe that Adobe would neglect this backwards
    compatibility issue. Thanks

    Hello Andrei1,
    Thanks for looking at my simple AS3 code. The AS2 swfs that
    I've been working (and having difficulties) with are components
    that I've purchased from places like www.flashden.com. Some are
    image transitions (such as "Dynamic Image Draw found at
    http://www.flashden.net/item/dynamic-image-draw/7532)
    while another is used to create a looped banner rotator animation
    (IMG_loop, a free d/l from www.afcomponents.net). I have another
    that uses an .xml file to configure a slideshow animation.
    You mention "needing to do more" if AS2 scripts inside its
    swf are to be run by the parent AS3 fla; what would these lines of
    code be?
    In researching my problem further I've since realized that
    most of these issues deal both with the version of AS used, as well
    as the version of the Flash player the fla is set up to animate
    for. In particular, the "Dynamic Image Draw" component requires
    that Flash Player 8 or 9 be used with AS2.
    Given that many of my purchased components are like this,
    I've since changed my main fla movie from AS3 back to AS2 and have
    learned that the scripting needed to call individual multiple swfs
    into it at various points in the timeline is MUCH simpler!!!!! One
    single, easily interpreted, line of code vs. 5 lines using
    variables and much more arcane (to me) function calls.
    I started my file with AS3 figuring that I'd be better off
    learning the new version of the language; much stress and
    forehead-rubbing later, I've seen just how much easier and
    understandable AS2 is to learn.
    I recognize that there are likely very strong arguments for
    the more structured coding approach used by AS3, but for someone
    like me who wants to generate customized Flash presentations with
    little fuss, I'm not qualified to make them.
    Perhaps this is a no brainer for those many flash gurus out
    there, but for me this tiny bit of wisdom has been hard fought for!
    That being said, is there an easy way to convert a swf file
    created using AS2 to something that AS3 can work/interact with?
    I've come across a free d/l product called actionscript bridge, but
    haven't been able to understand how to get it to work.

  • Communication between AS2 Template and AS3 Swf

    I created a template in AS2 which loads as2 swf's. i want to load as3 swf. then how can load as3 swf.within as2 template.
    please help me to find out this...

    hI,
    Look at package SDYNAMICDOCUMENTS, or look for DD_* ( This is Dynamic Documents  Tamplates ) in SE38.
    Regards,
    Marcelo Ramos.

  • AS2 .swf to AS3.swf

    This may have been posted somewhere else however I have created a series of AS2 .swfs and now that I am using captivate 5 i need to convert them to as3.swf
    Can anyone help

    That's going to depend on whether or not there's any AS2 code in your SWFs and how complex that code is.
    Did you create these SWFs in Flash?  If so, what version?  If it's Flash CS3 or above you should be able to open the original FLA files and change your publish settings to output as AS3.
    If you've programmed a lot of interactivity into these SWFs as AS2 and you don't know AS3, you'll need to either learn it yourself or pay someone that does.

  • Need help with loading child .swf into parent .swf

    Hello,
    I am having trouble with an external .swf that isbeing loaded
    into the master.swf. All of the files loads perfectly. However the
    .swf that has the contact form movieclip in it will not work. The
    combobox does that display any of the items listed and the form is
    not being sent to the server. Can anyone give me a hand with
    this?

    can you post your code

  • Need help loading and positioning a swf into a swf

    This is the swf  I'm trying to load.
    These actions load and position a small simple swf just fine and the trace in the onLoadProgress function indicates that it loads completely
    but I can't see it.  What am I doing wrong?
    this.createEmptyMovieClip("container_mc", this.getNextHighestDepth());
    var my_listener:Object = new Object();
    my_listener.onLoadComplete = function(target_mc:MovieClip) {
    target_mc._x = 150;
    target_mc._y = 100;
    my_listener.onLoadProgress = function(target_mc:MovieClip) {
    trace(target_mc.getBytesLoaded() + " out of " + target_mc.getBytesTotal());
    var my_loader:MovieClipLoader = new MovieClipLoader();
    my_loader.addListener(my_listener);
    //my_loader.loadClip("little.swf", container_mc);
    my_loader.loadClip("cam01.swf", container_mc);

    do you see a rotated swf if you use:
    this.createEmptyMovieClip("container_mc", 1);
    var my_listener:Object = new Object();
    my_listener.onLoadInit = function(target_mc:MovieClip) {
    target_mc._x = 150;
    target_mc._y = 100;
    target_mc._rotation = 22;
    var my_loader:MovieClipLoader = new MovieClipLoader();
    my_loader.addListener(my_listener);
    my_loader.loadClip("cam01.swf", container_mc);
    if yes, either:
    1.  you are repositioning your swf and for some reason don't recognize that or
    2.  you're changing container_mc or one of its parents _x,_y properties elsewhere.

Maybe you are looking for

  • G/L account configuration about GR of PO about the third purshase process

    Hi Guys, I am not clear about the G/L account configuration when do the GR of PO. ( PO is converted from PR which is created automatically when the SO is saved). The account assignment category is 'E' (The acct modification is VAY,consumption posting

  • How to determine the last transaction of a Batch Number

    Hello, For example, ITEMCODE - BATCHNUM - WHSCODE - LINENUM - DIRECTION ITEM1 - BATCH1 - WH1 - 0 - 0 ITEM1 - BATCH1 - WH2 - 0 - 0 ITEM1 - BATCH1 - WH1 - 1 - 1 ITEM1 - BATCH1 - WH2 - 1 - 1 How will I know that record number 4 is the last transaction r

  • "Battery low connect to..."

    Hallo, my iPod mini is still having problems with the battery. I did select+menu and then put it to recharge, but when i listen to music it keeps telling me that the battery is low even if it's full, and the battery image comes up. Any ideas? It's re

  • Different colored fade up?

    I want to fade up in a gray, not black. Can this be done? I tried to cross-dissolve with a gray block, but it a very quick fade up, no matter how long I make it. Just doesn't look right. Any suggestions? Thanks!

  • Unable to upload document in KM Content

    Hi all,          I am uploading documents into KM content by following path Folder> New> Upload. Previously it was working fine but today  the document is not getting uploaded and it is not giving any error message also.        I followed the path Fo