AS2 swf in as3

Hello world

in a first time I´d first I know that many discussions of the forum exists on this topic yet, but its more your experiences or opninions what will I´m to ask...

for my work I have to maintain a construction of Web site someone else, which is built in as2 and consists of 99% of the time.

the structure is more or less what follows,

"layer" 2 = all time edit swf

"layer" 1 = main menu (all buttons)

"layer" 0 = BG base with 2 simple buttons (nothing special, almost empty)

so by clicking on the buttons "Layer1" different swf´s are laoded (and removed of course) on the layer 2

I have the following problem...

the menu layer 1 is a total mess and more or less impossibe for me to work with, so I'll have to rewrite...

Although I ve never really got it to as2.

all these weird pieces of code anywhere in your document, I do not.

so I thought lets rewrite this menu in as3

but after reading stuff on the web, I understand that the combination of different versions of actionscript in one document is not without risk...


If I just read I ve, I am able to load a swf in as3 "framework/title" as2 but not vice versa. but I also read that it is still not without risk.

of course I don't want Mayor problems occur on this page.

think you folks...

It would work to rewrite the layer 0 and layer 1 in as3 and let all SWFs in layer 2 as they are (written in as2)

and in this way only load as2 documents on layer 2? or do you think this will create probloems too?

If you think that it won´t work please let me know, in this case I´ll just once more via as2 evil and redo the menulayer in as2

Thanks in advance

Ivo

I say if you need AS3 file to control some aspects of the AS2 file (or vice versa), you need to watch by using the LocalConnection communication.  This type of communication could involve the manipulation of variables or the execution of functions between different file types.  If AS2 files play as autonomous parts, and the side AS3 just charge and discharge them, then you will should not use LocalConnection.

Tags: Adobe Animate

Similar Questions

  • Loading an AS2 Swf in AS3 project

    So, I have a need to load some AS2 SWF inherited in my new AS3 interface. To avoid communication problems, I created a proxy AS2 SWF that loads the existing sovereign funds and takes their calls of communication to convey to the interface via the class LocalConnection - the only method (as I understand it) that you can use to communicate between AS2 and AS3.

    I detected AS version when loading a SWF file in the interface and pass the load to the proxy if the version is not 3. The proxy load properly, but I start getting errors immediately. Let me paste code to show the following steps:

    First of all. Immediately, I get a StatusEvent error, even if the path is sent to the proxy and load properly.

    Then, when the complete event is triggered in the AS2 SWF - it sends a completion back to let the AS3 SWF know that she finished (and any manipulation to get at that time.) I have the following error:
    Error #2044: Unmanaged by the AsyncErrorEvent:. Text = Error #2095: flash.net.LocalConnection could not invoke the callback loadSwf. error = ReferenceError: Error #1069: loadSwf property not found on com.applied.flash.events.AS2Connect and there is no default value.

    Join the Code

    This is the code of AS2Proxy.swf.

    connection: LocalConnection var = new LocalConnection();

    Connection.Connect ("AS3Connect");

    {if (Path)}
    proxyLoader.contentPath = path;
    }

    connection.loadSwf = function (path: String) {}
    proxyLoader.contentPath = path;
    }

    proxyLoader.complete = function() {}
    Connection.Send ("AS3Connect", "swfLoaded", true);
    }

    function completion (): Void {}
    Connection.Send ("AS3Connect", "swfLoaded", true);
    }


    It's the AS2Connect class for the hearing which is sent by the AS2 SWF

    package com.applied.flash.events {}

    SerializableAttribute public class AS2Connect extends Object {}

    public function swfLoaded (value: Boolean): void {}
    trace (value);
    }
    }
    }

    Finally, it's all the code in the AS3 swf file

    connection: LocalConnection var = new LocalConnection();
    var myIP:String = connection.domain;
    Connection.client = new AS2Connect();
    try {}
    Connection.Connect ("AS3Connect");
    } catch (e) {}

    simulation.source = ModulePath + curPageXML.attribute ("Path") m:System.NET.SocketAddress.ToString ();
    contentPlayers.addChild (simulation);
    simulation.addEventListener (Event.INIT, doInitSim);

    function doInitSim(evt:Event):void {}
    If {(simulation.content.loaderInfo.actionScriptVersion > 2)
    simulation.addEventListener (Event.COMPLETE, doVideoReady);
    } else if (simulation.source! = InterfacePath + "AS2Proxy.swf") {}
    simulation.source = InterfacePath + "AS2Proxy.swf";
    simulation.addEventListener (Event.COMPLETE, doProxyReady);
    }
    }

    function doProxyReady(evt:Event):void {}
    Connection.Send ("AS3Connect", "loadSwf", ModulePath + loadedXML.Pages.Page [tree.selectedIndex].attribute("Path").toString ());
    connection.addEventListener (StatusEvent.STATUS, doStatus);
    }

    function doStatus (evt :*){
    trace (e);
    }

    Well, the component has worked well for me.

    Here's how I bypassed not being not able to change the former rulers.

    I created a new AS2 project that consists of a loading component and ASBTerminal component.

    I then added the code to operate the ASBTerminal. Knowing all the function calls _root or _level0 coming out the loaded SWF, I created a function for each and said the SBA to perform a function in the new interface, passing along and reformatting of arguments as needed.

    Then, I created for the interface AS3 call functions.

    loadSwf()
    sendStop()
    sendPlay()
    sendGotoAndStop()
    sendGotoAndPlay()

    Each of these passes call a function in the loading component. loadSwf sets the contentPath. sendStop... sends the appropriate call (play(), stop(), gotoAndPlay()), gotoAndStop().

    Then I add my custom, things functions that I could appeal to some of the former sovereign wealth funds, and whatever.

    So, there are 3 files of the chain when I load a legacy SWF file.

    1. the main interface of AS3
    2. the "proxy" AS2 swf loaded into the interface.
    3. the legacy AS2 swf that loads the proxy.

    The proxy acting as an intermediary between existing content and new content.

  • AS2 loading swf that loads additional s AS2 swf into Flex

    My loaded AS2 swf can not seem to load the AS2 swf using loadMovie() and loadMovieNum().

    I have a file .mxml with a tag with an attribute of the source of mx:Image bound to a string variable. I can set this variable to a valid way to AS2 swf and swf file load as expected.

    However, the AS2 swf contains one or more statements loadMovie() to load additional SWFs 'child' in empty movieClips that fails silently.

    (I have to load several legacy/AS2 projects, I try to avoid the migration of these projects to AS3, also try to avoid incrustation of the SWF to the 'child' in a single AS2 swf).

    I tried both loadMovie and loadMovieNum, I change the publication for local file access and network access settings, I tried to replace the mx:Image bound by a mx:SWFLoader tag, tag none of these work. I even tried to switch the compiler Flex setting - use network.

    All the other features seem to work in the loaded AS2 swf.

    I found many posts/articles as intercommunication between an AS3 Flex swf and loading AS2 swf, but it's not my problem. I need not communication, a few features.

    Thanks in advance for any idea!

    OK, once more, during 5 minutes walk away a problem proved to be invaluable. I started to think that maybe there is a known issue with loadMovie(). Even if I was trying to avoid to touch the source code of these sovereign wealth funds AS2, I decided that it would be useful to test replacing loadMovie() by MovieClipLoader.loadClip () statements.

    It works! Even if it means that all the old AS2 files that I need to load will have to be revised, it is much less of a task of migrating to AS3 or incorporation of the swf file of the child in the movie alone. I hope at least that this will save someone else the frustration of trying to do the same thing.

  • How to add a html page or page Web Flash SWF in as3?

    Hi all

    How to add a html page or page Web Flash SWF in as3?

    Thank you

    Omar

    to a swf on the web, use navigateToURL.  for a mobile swf file, use the htmlloader or stagewebview class.

  • Issue of AS3 incorporating AS2 .swf files

    Hello

    I want to create a menu with Flash/AS3 navigation system that opens a series of old AS2 activities.

    Right now I'm testing with two buttons / two activities.

    The problem I have is that when I test the navigation, the first button clicked will open its respective activity properly, which can then be closed using the output of the original activity button and go back to two buttons on my AS3 menu. However, if I then select another activity in the same screen, it does not. I am able to click again on the original activity and opened it, but not the new.

    If I test the flash main navigation again file and click on the first button (which didn't work), activity opens very well and can be closed. However the first button now does not open the activity. If the buttons work (if they are the first to be clicked), but from then on, only the first box you click work.

    In the debug Panel, it seems that .swf AS2 files I try to integrate themselves are the incorporation of a file wrapper.swf (with navigation buttons) as well as a different subset of .swf files shared for their own functioning. Maybe is it possible that these sub swf files are not discharging properly when I pass between the main films AS2 my menu system?

    Is there a way to delete/unload everything that was loaded (same resources loaded by the external files themselves - as a hard reset) between the keys?

    I have no access to the original AS2 code as was done by another team from years back.

    I would be really grateful for any help or advice anyone might be able to give.

    Thank you

    It's unfortunate because that's where the problem lies.

    You can always solve by positioning a button transparent as3 over as2 button and intercept the click of the mouse.

  • AS3 SWF into AS2 swf nest

    I bought a model written in AS2 flash, I have all the files needed to customize the site, the .fla, the PSD in Photoshop, you name it. I bought also a gallery of photos that is written in AS3 (did not know that it was AS3 when you purchase). My question: is it possible to integrate/nest of AS3 Photo Gallery, I the file swf file, in my AS2 site?

    By AS3 documentation:

    A single SWF file cannot combine ActionScript 1.0 or 2.0 code with ActionScript 3.0.

    SWF files written in ActionScript 1.0 or 2.0 cannot load SWF files written in ActionScript 3.0. This means that the SWF files created in Flash 8 or Flex Builder 1.5 or earlier versions cannot load ActionScript 3.0 SWF files.

    The only exception to this rule is that an ActionScript 2.0 SWF file can replace itself with an ActionScript 3.0 SWF, as long as the file file SWF in ActionScript 2.0 has not previously loaded anything in one of its levels.

  • Loading external SWF in as3 SWF Loader style?

    Hello

    I recently did the replacement of as2 as3 and am still struggling to get my head to a particular aspect. I managed to load an external swf into an empty file via the script

    Import LoadDisplayObject;

    var loader: LoadDisplayObject = new LoadDisplayObject ("button_01.swf", true);

    1. loader.addEventListener ("displayObjectLoaded", onComplete, false, 0, true);

    addChild (loader);

    function onComplete(evt:Event):void {}

    trace ("received full load");

    loader.scaleX = loader.scaleY is. 75;

    }

    ... but I'm struggling with the script to make a SWF to load into a space when one of my 3 buttons is activated...

    My page currently has three buttons (button_01, button_02 and button_03) and in a local folder three separate sovereign wealth funds with the same names that I want to load, when you press the appropriate button.

    I managed to get them to load using a tutorial... but what they charge on top of each course... far from ideal. Research on the internet I found a range of different script... goal, that I can't find anywhere that I can find the script to make it work... so why I turned here.

    Any help much appreciated... Thanks in advance.

    Simply call butt1Click (null);

  • SWF in AS3 in a DIV

    Hello! Something weird is going on and I'm totally screwed!

    Before, I created my document Flash in AS2, with Dreamweaver, I created a DIV, and I could add something to the bottom in HTML. When I saw it in Dreamweaver, he warned me it needed a script and created in a folder, even if I had the Scripts AC next... And everything works beautifully...

    But now, with a document in AS3, it didn't tell me what anyone, the preview is good, but on the web, I see nothing except the color of the background!

    Someone knows why?

    If it does not, check for incompatibility of the case. file.swf load locally when you use 'FILE. SWF"as a target, but not online.

  • Can I convert AS2 FLA in AS3 FLA?

    Is it possible that I can convert my flash document that was built with Action Script 2.0 in a Document Flash Action Script 3.0 using Flash CS6?

    The only way I can imagine to convert the file using Flash CS6 is if the AS2 code used in the file would be the same code that you write an AS3 file.  So you could change the settings of publication of AS2 to AS3 and save/compile the file.  I can't hazard a guess as to the likelihood of the code in the file which is authoritative for AS2 and AS3, but it is possible that if the code is very basic (play(), stop(), etc., gotoAndPlay()).

  • Returns the url of the SWF in AS3

    Hello. In 2.0, there is a simple code like trace (_root._url) that returns the url of the current swf file. What is the equivalent in AS3?

    The samples I found were all realted to window.location and other things, is there any simple code for this as in 2?

    Thank you.

    The LoaderInfo class has a url property.  the timeline root and all Chargers have contentLoaderInfo property that are instances of LoaderInfo.

  • AS2 SWF inside Flex

    I need help somewhat correctly load an external swf file in my flex application.

    I don't know where I'm wrong, but at this point, I guess it's a path error any. The swf file that I am trying to load is in fact a soundslides presentation that was built using AS2 and relies on a flashvar called 'project' to feed the document required xml. The flex application is being inserted into the page dynamically using a Jquery plugin.

    Here's a live version of what I'm trying to accomplish. It was built using Jquery and Soundslides, but due to some browser unforeseen complications that I decided rebuilt the widget together using Flex instead of Jquery.

    Example 1: original version using Jquery + Soundslides -look at the student sliding section view (s).
    http://www.PLU.edu/admission/first-year

    Example 2: Flex + Soundslides -this is a work in progress, and this is the version that I need help.
    http://dev.PLU.edu/admission/home-SV-widget.php

    So, basically, in example 2, I have a sequence of JPGs which is set to slide forward at a given time interval. When a user clicks on one of the jpg files the mouse event calls the following method:

    [code]
    Support Soundslide
    public void loadSoundslide (e:MouseEvent): void
    {
    Get id button id project
    var projID:int = currentImage;

    Create the path for charger
    var swfPath:String = basePath + playerPath + '? project ="+ basePath + projectsArray [PROJID];

    Alert.Show (swfPath);

    Load swf Soundslide
    swfRequest.url = swfPath;
    swfLoader.load (swfRequest);
    wrapper.addChild (swfLoader);

    }
    [/ code]

    I thought this might work, but it does not go around. Any thoughts? Another question. I have it works. Is that what I would just call another method to unload the swf file? Attached is my project so that you have an idea of what I'm working on. I'll also post a zip file containing over the project, the content of the student - views is big enough, so I'll only for one of them.

    Well, I feel like I had a conversation with myself. But basically, I was able to pull of this stop using some actionscript and the SWFLoader method. I have some adjustments to make to make things prettier and a little more efficient.

    I pulled the close component feature Flash AS2 and now I do basically the same thing from the inside of Flex. This way I can treat the AS2 more like a flat file that I'm loading and unloading. I came across some problems where the audio should continue to play even after I removed the SWFLoader on the parent object of display. This message had some ideas on how to address this issue.

    MXML is attached.

  • Publishing SWF with AS3

    Hi all

    I was wondering if its possible to build a flash application that can publish its own files from user input swf?  Maybe a silly question but I can't seem to find an answer to this anywhere?

    Thank you very much

    Matt

    No, a swf file cannot create another swf.

    on the other hand, a swf file can save data that are used by another swf and other than swf then seem to be customized (by the entry of the user if you wish).

  • Increase speed of loading of SWF in AS3

    The loaded Swf file inherits the cadence of the chronology of hand speed.

    Is there a way to control the pace of the loaded Swf file.

    In addition,

    If I loaded a Swf file to a container Movie Clip, how can I control the speed of Movie_ClipInstance.CurrentFrame.

    Concerning

    var Xpos:Number = 110;
    var Ypos:Number = 180;
    var swf:MovieClip;
    var loader: Loader = new Loader();

    var defaultSWF:URLRequest = new URLRequest ("Clip1.swf");

    Loader.Load (defaultSWF);
    Loader.x = Xpos;
    Loader.y = Ypos;
    addChild (loader);
    ////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////

    Function universal BTNS
    function btnClick(event:MouseEvent):void {}

    removeChild (loader);
    var newSWFRequest:URLRequest = new URLRequest ("SWFs /" + event.target.name + ".swf");

    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, completeF);
    Loader.Load (newSWFRequest);
    Loader.x = Xpos;
    Loader.y = Ypos;
    addChild (loader);
    }

    function completeF(e:Event):void {}

    var mc:MovieClip = MovieClip (e.target.loader.content);

    mc.addEventListener (Event.ENTER_FRAME, mcCheckF);

    }

    function mcCheckF(e:Event):void {}

    var mc:MovieClip = MovieClip (e.target);

    {if(MC.currentFrame==16)}

    playF (mc, 20, 16, 12);

    }

    {if(MC.currentFrame==21)}

    playF (mc, 21, 30, 20);

    }

    }

    Listeners of BTN
    Clip1.addEventListener (MouseEvent.CLICK, btnClick);
    Clip2.addEventListener (MouseEvent.CLICK, btnClick);
    Clip3.addEventListener (MouseEvent.CLICK, btnClick);
    Clip4.addEventListener (MouseEvent.CLICK, btnClick);

  • With the help of a button to load and unload the external SWF in AS3?

    How can I use a button to load and unload a sequence of external SWF files, as a Next button and previous?

    I don't know if it will work because apparently you are trying to load a swf AS1/2, but try

    change the line to be...

    _swfTempClip = MovieClip (event.target.content);

    If this does not work, then you will need to create _swfTempClip as a new MovieClip and add the event.target.content to this MovieClip using addChild().

  • How to convert this simple piece of AS2.0 to AS3.0?

    When I try to compile this in AS3, it tells me:
    WARNING: 1090: Migration issue: the delivery event handler is not triggered automatically by Flash Player running in ActionScript 3.0. You must first register this handler for the event using addEventListener ('mouseDown', callback_handler).

    What I need is a specific example of the required syntax. I can't understand it. Thank you.

    Yes - what you need here is:

Maybe you are looking for