Change AS2 file to AS3?

Hey all!
I started a new flash project and accidentally chose Action Script 2 instead of Action Script 3 and didn't realize it until I had already done quite a bit of work in the timeline. Just wondering if there's an easy way to change the document type to AS3?
I tried simply using the AS3 option in the drop down menu in the actions panel, but it still gives me a syntax error when I know the code works fine in an AS3 document.
Thanks!

Thank you. I tried that, but now when test the movie I get two compile errors:
WARNING: The component 'FLVPlayback' requires ActionScript 2.0.
WARNING: The component 'UIScrollBar' requires ActionScript 2.0.
And the playback does not stop at the frames I have told it to using a simple stop(); action. I know I've used a UI Scrollbar in AS3 before and I definitely know FLV Playback doesn't require AS 2.0 so maybe I need to change the settings of those components to be 3.0 components? Not sure how to do that though.
*UPDATE: Deleting the FLV and the UI Scrollbar and then adding them again fixed this problem. Obviously the components from AS2 and AS3 are much different.
On a different note, I have two other questions for you... Firstly, I've got the FLV Playback component starting off stage and sliding in to the center when the page loads. This seems to work fine in the timeline, but when I test the movie, the video remains on the right side of the stage and doesn't slide in. Any idea why?
Secondly is there a way to pause the video when you navigate to another page? Cause it keeps playing in the background (I can hear the audio still) even though I click on another page.
Thanks!

Similar Messages

  • Change as2 code to as3

    I used a tutorial http://www.flash-game-design.com/flash-tutorials/funky-flash-website-tutorial-5.html to make a menu for my application, I've tried following tips on how to change AS2 code to AS3, but it just doesn't work.
    menu = ["bulls", "about", "roster", "schedule"];
    var current = menu[0];
    for (var i = 0; i<menu.length; i++) {
    var b = menu[i];
    this[b+"_btn"].stars._visible = false;
    this[b+"_btn"].txt = b;
    this[b+"_btn"].onPress = function() {
    _root.site[current+"_btn"].stars._visible = false;
    _root.site[this.txt+"_btn"].stars._visible = true;
    current = this.txt;
    _root.site.content.gotoAndStop(this.txt)
    this[current+"btn"].stars._visible = true;
    this.onEnterFrame = function() {
    this[current+"_btn"].stars.s1._rotation += 1;
    this[current+"_btn"].stars.s2._rotation += 0.5;
    Thank you,
    Glenn

    Just a note. Function declarations in a loop is an EXTREMELY bad practice that will lead to many problems if it doesn't have some already. So, the following lines:
    for (var i:int = 0; i<menu.length; i++) {
        var b:String = menu[i];
        this[b+"_btn"].stars.visible = false;
        this[b+"_btn"].addEventListener(MouseEvent.CLICK,fn);
        this[b+"_btn"].txt=b;
        function fn(e:MouseEvent):void{
            this[current].stars.visible = false;
            var nam:String=e.target.parent.name;
            this[nam].stars.visible = true;
            current = nam;
            //MovieClip(root).site.content.gotoAndStop(this.txt)
    should be:
    for (var i:int = 0; i < menu.length; i++) {
         var b:String = menu[i];
         this[b+"_btn"].stars.visible = false;
         this[b+"_btn"].addEventListener(MouseEvent.CLICK,fn);
         this[b+"_btn"].txt=b;
    function fn(e:MouseEvent):void {
         this[current].stars.visible = false;
         var nam:String=e.target.parent.name;
         this[nam].stars.visible = true;
         current = nam;
         //MovieClip(root).site.content.gotoAndStop(this.txt)

  • Error in loading As2 file in As3 file

    I have some old files/activities which are developed using Actionscript2 and one main file(main menu) which is developed in Actionscript 3.
    I am loading Actionscript 2 files in main file using loader, every files are working fine apart from the files which contain 'Drag and drop activities'. Please anybody let me know how to solve this.

    what's the problem?

  • Help! Convert simple Flash AS2 code to AS3

    Hi everyone,
    I'm a Flash beginner and followed a tutorial: http://www.webwasp.co.uk/tutorials/018/tutorial.php ... to learn how to make a "live paint/draw" effect. I didn't realize  that if I made something in AS2, I wouldn't be able to embed it (and  have it work) into my root AS3 file, where I've got a bunch of other  stuff going on. I've tried following tips on how to change AS2 code to  AS3, but it just doesn't work. I know it's simple code, and that some  genius out there can figure it out, but I'm at a loss. Please help!
    Here's the AS2 code:
    _root.createEmptyMovieClip("myLine", 0);
    _root.onMouseDown = function() {
       myLine.moveTo(_xmouse, _ymouse);
       ranWidth = Math.round((Math.random() * 10)+2);
       myLine.lineStyle(ranWidth, 0xff0000, 100);
       _root.onMouseMove = function() {
          myLine.lineTo(_xmouse, _ymouse);
    _root.onMouseUp = function() {
       _root.onMouseMove = noLine;
    Thanks in advance!
    Signed,
    Nicolle
    Flash Desperado

    Considering the code is on timeline:
    var myLine:Sprite = new Sprite();
    addChild(myLine);
    var g:Graphics = myLine.graphics;
    addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
    function onMouseDown(e:MouseEvent):void {
         var ranWidth:Number = Math.round((Math.random() * 10) + 2);
         g.clear();
         g.lineStyle(ranWidth, 0xFF0000, 1);
         addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
         addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
    function onMouseMove(e:MouseEvent):void {
         g.lineTo(mouseX, mouseY);
    function onMouseUp(e:MouseEvent):void {
         removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
         removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);

  • How do I change an AS2 file to an AS3 file?

    I have just started learning Flash, and I have been doing some online tutorials. They told me to create AS2 files for the tuts. I now started on my own project, and I created an AS2 file to do it, but now I am reading that I really should just learn AS3 because it is much more efficient. I have put a lot of work into my project, but I have not created any action script yet. It is all art and pathing right now. So I think this would be the best time to switch it over to AS3 if I can. First off: can I? And Second: How?
    Thanks.

    AS3 is a superset of AS2 and can be easily converted. AS3 to AS2 is a much harder shift language wise. This resource will get you started:
    http://www.adobe.com/devnet/actionscript/as3_migration_table.html

  • Change some code from as3 to as2

    Hi, I want to use as2 because it compatible with my website.
    I want to change some code from as3 to as2
    /////////////////////////////image1//////////////////////////////// if(MovieClip(this.parent).imagetxt.text == "a") {     var imgurl:String = "C:/Users/Thái/Desktop/ls/cotton-1.jpg";     var myrequest:URL = new URL(imgurl);     myloader.scaleContent = true;     myloader.load(myrequest); } /////////////////////////////image2//////////////////////////////// else if(MovieClip(this.parent).imagetxt.text == "b") {     var imgurl2:String = "http://aloflash.com/images/upload/3.jpg";     var myrequest2:URLRequest = new URLRequest(imgurl2);     myloader.scaleContent = true;     myloader.load(myrequest2); }thank you for your support.

    use:
    var myloader:MovieClip=this.createEmptyMovieClip("loader_mc",this.getNextHighestDepth());
    if (MovieClip(this._parent).imagetxt.text == "a") {
        var imgurl:String = "C:/Users/Thái/Desktop/ls/cotton-1.jpg";
        myloader.load(imgurl);
    } else if (MovieClip(this._parent).imagetxt.text == "b") {
        var imgurl2:String = "http://aloflash.com/images/upload/3.jpg
        myloader.load(imgurl2);

  • AS3 menu to AS2 file back to AS3 menu?????

    *Also I should note, that the actions on the As3 file is coded on the frame. The actions in the AS2 file is coded on the corresponding button.

    I believe AS3 was not supported until Flash Player 9, so you would need at least that to open an AS3 file, though it is possible you would need an even newer player version if the file was created using a more recent version of Flash.

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

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

  • Converting external link as2 script to as3

    Hello.
    I used this script I found online to make a Flash file that accessed an external text file full of hyperlinks through buttons in the Flash movie. The code is as2. I had to update the Flash file to AS3 and now the script doesn't work. I can't figure out how to do the same thing that this script does in AS3. Can anyone help me?
    Here is the AS2 script:
    textFile = new LoadVars()
    textFile.onLoad = function(){
    buttonlink1 = this.BlackBooklink;
    buttonlink2 = this.Ashtraylink;
    buttonlink3 = this.bedroomlink;
    buttonlink4 = this.tvlink;
    buttonlink5 = this.spiderlink;
    buttonlink6 = this.Mirrorlink;
    buttonlink7 = this.Boomboxlink;
    buttonlink8 = this.Suitlink;
    buttonlink9 = this.cashlink;
    buttonlink10 = this.fastfoodlink;
    buttonlink11 = this.Idolatrylink;
    buttonlink12 = this.Trashlink;
    textFile.load("LeftHouseLinks.txt");
    //---buttons
    BlackBook.onRelease = function(){
    getURL(buttonlink1, "_self");
    Ashtray.onRelease = function(){
    getURL(buttonlink2, "_self");
    bedroom.onRelease = function(){
    getURL(buttonlink3, "_self");
    tv.onRelease = function(){
    getURL(buttonlink4, "_self");
    spider.onRelease = function(){
    getURL(buttonlink5, "_self");
    Mirror.onRelease = function(){
    getURL(buttonlink6, "_self");
    Boombox.onRelease = function(){
    getURL(buttonlink7, "_self");
    Suit.onRelease = function(){
    getURL(buttonlink8, "_self");
    cash.onRelease = function(){
    getURL(buttonlink9, "_self");
    fastfood.onRelease = function(){
    getURL(buttonlink10, "_self");
    idolatry.onRelease = function(){
    getURL(buttonlink11, "_self");
    trashtalk.onRelease = function(){
    getURL(buttonlink11, "_s
    This is the external .txt file content
    &BlackBooklink=http://www.yahoo.com
    &Ashtraylink=http://www.google.com
    &bedroomlink=http://www.yahoo.com
    &tvlink=http://www.google.com
    &spiderlink=http://www.yahoo.com
    &Mirrorlink=http://www.google.com
    &Boomboxlink=http://www.yahoo.com
    &Suitlink=http://www.google.com
    &cashlink=http://www.yahoo.com
    &fastfoodlink=http://www.google.com
    &Idolatrylink=http://www.yahoo.com
    I know how to make AS3 button work, I just don't know the code so that when I click the button, it accesses the external file and goes to the hyperlink specified by the button.
    Any help would be much appreciated.
    -Shawn

    Hi Ned.
    I have officially lost the rest of what's left of my hair over this.
    Here is the code I am using now. For whatever reason the variable
    buttonlink1 I have set up is not being recognized:
    var myTextLoader:URLLoader = new URLLoader();
    myTextLoader.addEventListener(Event.COMPLETE, onLoaded);
    function onLoaded(e:Event):void {
                trace(e.target.data);
    var buttonlink1;
    buttonlink1 = this.BlackBooklink;
    myTextLoader.load(new URLRequest("LeftHouseLinks.txt"));
    BlackBook.addEventListener ( MouseEvent.CLICK, myBlackBookHandler )
    function myBlackBookHandler( evt ){
                navigateToURL(new URLRequest(buttonlink1), "_self");
    This is the resulting error message and below that is the text of the
    external text file which is loading into Flash:
    Any ideas? Thanks.
    -Shawn
    TypeError: Error #2007: Parameter url must be non-null.
                at global/flash.net::navigateToURL()
                at SoulDecisions07_fla::MainTimeline/myBlackBookHandler()
    &BlackBooklink=http://www.yahoo.com
    &Ashtraylink=http://www.google.com
    &bedroomlink=http://www.yahoo.com
    &tvlink=http://www.google.com
    &spiderlink=http://www.yahoo.com
    &Mirrorlink=http://www.google.com
    &Boomboxlink=http://www.yahoo.com
    &Suitlink=http://www.google.com
    &cashlink=http://www.yahoo.com
    &fastfoodlink=http://www.google.com
    &Idolatrylink=http://www.yahoo.com
    &BlackBooklink=http://www.yahoo.com
    &Ashtraylink=http://www.google.com
    &bedroomlink=http://www.yahoo.com
    &tvlink=http://www.google.com
    &spiderlink=http://www.yahoo.com
    &Mirrorlink=http://www.google.com
    &Boomboxlink=http://www.yahoo.com
    &Suitlink=http://www.google.com
    &cashlink=http://www.yahoo.com
    &fastfoodlink=http://www.google.com
    &Idolatrylink=http://www.yahoo.com
    &BlackBooklink=http://www.yahoo.com
    &Ashtraylink=http://www.google.com
    &bedroomlink=http://www.yahoo.com
    &tvlink=http://www.google.com
    &spiderlink=http://www.yahoo.com
    &Mirrorlink=http://www.google.com
    &Boomboxlink=http://www.yahoo.com
    &Suitlink=http://www.google.com

  • Need help to find link to external AS2 file

    I have purchased an image gallery program that works fine but I am struggling to make a very minor modification. I have asked the author for assistance but previous requests have met with no response so I am also asking my question here.
    This program has most of its logic in an external AS2 file. I have made some small changes to this file and want to save it under a new name. However, that would also require me to change the reference to the external AS2 file from within the fla file. That's where my problem lies. I can't find any code in the fla that contains such a reference.
    If I try to publish an swf without this file in the required location it causes a compiler error thus proving that there must be a reference somewhere to that file. However, doing a search for this AS2 file in the 'current document' when viewing the fla file in Flash CS4 produces no results. Where else could this reference be hidden?
    David

    Unfortunately, the Movie Explorer window does not show class references of the type under discussion. I guess an alternative way to reference this external file might be via an include statement in an action, which would make it a lot easier to find than when it is hidden in the properties box of a library symbol.
    However, the Movie Explorer appears to be a useful facility for finding and searching timeline actions so thanks for bringing it to my attention. I used it for a brief exploration of another fla file with lots of code scattered all over the place.
    Thanks again for all your help.
    David

  • Does toolkit for createjs will export AS2 files?

    I was wondering if this extension will export files to hmtl 5 that were created in AS2.
    If it is not possible, where can I get to kwno how to program or pass my file to AS3?
    Thanks for the time.

    Hi Nijord,
    Toolkit for CreateJS does not convert ActionScript code to JavaScript (HTML5). You will have to re-write the ActionScript code to JavaScript once you export and convert your Flash assets to HTML5.
    Regards,
    Suhas Yogin

  • As2 linked to as3 ?

    I am working on an inherited project with a tight deadline, and  I have a large as2 file with xml that appears to calling up an as3 flash file that also has xml, but its not working so I cant tell for sure.  Is this possible to do?
    Barbara

    This is the beginning of the productDetails.fla  it cant find the xml cuz I am getting this error
    TypeError: Error #2007: Parameter url must be non-null.
    at flash.net::URLStream/load()
    at flash.net::URLLoader/load()
    at ProductDetails_fla::MainTimeline/frame1()
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.display.Stage;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.display.StageDisplayState;
    import flash.text.Font
    import classes.ProductDetails;
    import classes.ClickableMovieClip;
    ProductDetails.FileName = this.loaderInfo.parameters.XMLFile
    ProductDetails.Product = this.loaderInfo.parameters.LoadProduct
    ProductDetails.SelectedTab = this.loaderInfo.parameters.LoadSelectedTab
    ProductDetails.IsIE6 = this.loaderInfo.parameters.IsIE6
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
    xmlLoader.load(new URLRequest(ProductDetails.FileName));
    function LoadXML(e:Event):void {
    ProductDetails.xmlData = new XML(e.target.data);
    switch(ProductDetails.Product.toLowerCase()) {
    case "classics":
    ProductDetails.xmlProduct = new XML(ProductDetails.xmlData.products.classics);
    ProductDetails.xmlProducts = new XMLList(ProductDetails.xmlData.products.classics.product);
    break;
    case "fresheffects":
    ProductDetails.xmlProduct = new XML(ProductDetails.xmlData.products.fresheffects);
    ProductDetails.xmlProducts = new XMLList(ProductDetails.xmlData.products.fresheffects.product);
    break;

  • Main movie in AS2 and MC AS3

    Dear all,
    I have a main movie is coding AS2 which contains a movieClip called MC_header.
    And I have an external movie is coding with AS3.
    My question is :
    Can i loadmovie the external movieclip in the main movie????
    if yes, how?
    thanks
    MELAS

    Nope. If the original movie is AS3 you can load in an AS2 clip and it will run as an AVM1 (ActionScript Virtual Machine 1, which understands AS1 and 2) Movie. But the AVM1 has no idea about AVM2 (which understands AS3) so you can't go the other way.
    Even when you do load an AS2 into and AS3 file the communication between the main file and the loaded AVM1 movie is quite limited and you won't be able to control it the way you would if they were both of the same flavor -- if that is important to your project.

  • I recently had some 8mm film transferred to DVD. I am trying to edit the film clips using Premier Elements 4.0.  Some of the film clips copy into the project but others don't. I tried copying the VOB filed onto my hard drive and then changing the file ext

    I recently had some 8mm film transferred to DVD. I am trying to edit the film clips using Premier Elements 4.0. so I can reburn the films on a single BluRay disc. Some of the film clips copy into the project but others don't. I tried copying the VOB filed onto my hard drive and then changing the file extensions on the VOB files to MPEG but this was no help. Some of the VOB files contain numerous film clips but my software does not appear to be able to recognize them as such. I need to know if replacing my old Premier Elements with the new Version 13 would solve this problem or not. Any advice would be greatly appreciated!
    Bob

    Bob
    What do you have now.....
    What computer operating system do you have?
    We can go into the finer points of source and your intentions, but for now it would appear that you are using SD 4:3 source media to get to a HD 16:9 result. Lots to discuss in this regard.
    What was given to you on the DVD disc? DVD-VIDEO 4:3 or something else?
    If DVD-VIDEO on DVD disc, you should expect to find on the disc a folder named VIDEO_TS. That is your target for your video files.
    If you were given a DVD-VIDEO on DVD disc, then all you want from it are the video files, specifically
    VTS_01_1.VOB, VTS_01_2.VOB, and so on through that series until possibly getting to
    VTS_02_1.VOB, and so on. How many files you have beyond the VTS_01_1.VOB file will depend on the size of the DVD-VIDEO.
    Does the above scenario apply to you?
    The alternative might be someone giving a DVD disc (data disc) which contains just the VTS files mentioned which were copied from
    the VIDEO_TS Folder. So, you do not get the whole VIDEO_TS Folder, just the essential video files. Does this scenario apply to you.
    I see no need to replace your Premiere Elements 4 with a later version unless you have a huge project and need a later version that will be a 64 bit application running specifically on Windows 7, 8, or 8.1 64 bit computer.
    Consider...Premiere Elements 4 and if you have DVD-VIDEO on DVD....
    1. Place the DVD disc in the burner tray
    2. Open Premiere Elements 4 and set the project preset for NTSC DV Standard (assuming you are working in a NTSC setup)
    3. Go to
    Get Media
    "DVD, Digital Camera, Mobile Phone, Hard Drive Camcorder, Card Reader"
    "Adobe Premiere Elements - Media Downloader" and its Advanced dialog.
    Set the Source in the latter dialog for the drive which has your DVD disc inserted in its tray
    You should see your VTS_01_1.VOB thumbnail in the "Adobe Premiere Elements - Media Downloader" Advanced dialog.
    With this VOB selected, click on Get Media to get the file from there into the project.
    Should work fine.
    Complications may be involved if the people who processed your footage gave you something other what is described above.
    Please review and consider, and then we can plan our project strategy accordingly.
    Thank you.
    ATR

Maybe you are looking for