Convert ActionScript 2, ActionScript 3

Hello, I need to convert the ActionScript 2 below in ActionScript 3 for a HTML 5 document, I train in Flash. Unfortunately, I know almost nothing about ActionScript 2, ActionScript 3 or HTML 5. Any help I can get would be greatly appreciated!

Here's the ActionScript 2, I need to convert:

/ * slide.link1.onRelease = function() {}

getURL("/v3_store/New_Travel_Vest.shtml");

}*/

You would use AS3 for HTML5, you must use Javascript. The Javascript code for what you are doing that would be (if you want the page open in a new window):

Slide.Link.on ("MouseDown", openwebpage);

function openwebpage (e) {}

Window.Open("/v3_store/New_Travel_Vest.shtml","_blank");

}

Tags: Adobe Animate

Similar Questions

  • HTML5: Convert Actionscript reference Javascript or resource?

    Not there at - there no guideline anywhere repository?

    Code snippets do not appear to cover simple things like the filling of a dynamic text within an instance of symbol with a text string, such as:

    SymbolX.DynamicText.text = "show this text."

    I tried:

    This. SymbolX.DynamicText.text = 'show this text';

    Even simple "If Else" functions are not covered in the extracts of...

    Is anyone aware of a certain type of resource of reference to deal with CONVERSION?

    Thank you!

    Here is a general guide to translate as JS/CreateJS:

    Convert your ActionScript code to HTML5 in Adobe animate CC

  • Help needed to convert ActionScript 3 for HTML5 javascript

    I'm looking for help conversion code actionscript 3 in javascript for a platform of HTML5.  I'm a developer flash by trade but I am not familiar on how to 'translate as js code.  I had recently downloaded CC animate, thinking that he take the existing .fla file and republish on a html5 format.  Well I was wrong.  All of my code that I used in flash gives me hundreds of errors & I have not even know where to begin. the question I have is: all my flash documents I created over the years must now be converted to html5.  Where do I go, who can help you? is there an easy way to do this? is there an online converter...  I need help! Thank you.  Here's an actionscript exsisting code that I need to convert: sorry for the copy and past of the script.

    ActionScript code below

    Stop();

    import flash.utils.Timer;

    Here comes the string of numbers (rootLoader.parameters)

    var generatedNums:String is MovieClip (parent.parent). WinningNumbers;

    creates an array of numbers generated

    var chosenNums:Array = generatedNums.split("-");

    convert text to numbers

    var n = chosenNums.length;

    While (n)-{}

    chosenNums [n] = Number (chosenNums [n])

    }

    / / call funtion to remove 0 from the list of numbers

    function remove(list:Array,callback:Function):Array {}

    for (var i: int = list.length - 1; i > = 0; i--) {}

    {if (! callback (list [i]))}

    List.splice (i, 1);

    }

    }

    back list;

    }

    remove the 0 from the list of numbers

    function removeCallback(item:Number):Boolean {}

    return item > = 1;

    }

    Remove (chosenNums, removeCallback);

    keeps track of what element of the array to use to create balls

    (first and second and third)

    var chosenNumsIndex:uint = 0;

    creates array of the coordinates of the numbers on the card.

    var kNum:Array = new Array();

    var bottomArray:Array = new Array ("", "", "", "", "", "", "", "", "", "","", "","", "","", "","", "","", "","" ");

    kNum [0] is a dummy, because there is no 0 to the Board of Directors.

    kNum [0] = {x: 0, y: 0};

    /

    Array of movieclips

    var mcArray:Array = new Array();

    mcArray.push (n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16, n17, n18, n19, n20, n21, n22, no. 23, n24, n25, no. 26, no. 27, no. 28, n29, n30, n31, n32, n33, n34, n35, n36, n37, n38, no. 39, no. 40, n41, n42, n43, n44, n45, n46, n47, no. 48, n49, n50, n51, n52, 53, n54, n55, n56, no. 57, n58, n59, n60 n61 n62, n63, n64, F65, no. 66, n67, n68, n69, n70, n71, n72, n73, n74, n75, n76, n77, n78, n79, n80);

    creates a timer that executes every 3 seconds.  Number of times it runs

    is determined by the length of the array of chosenNums (which corresponds to the number

    selected numbers)

    var: timer = new Timer (3000, chosenNums.length);

    Timer is tuned to itself trigger, calls chuckBall()

    timer.addEventListener (TimerEvent.TIMER, chuckBall);

    timer.addEventListener (TimerEvent.TIMER_COMPLETE, ballChuckingComplete);

    chuckBall generates coins

    function chuckBall(event:TimerEvent):void

    {

    generates the new coin - currency is the name of MovieClip in the library

    don't forget to export for Actionscript

    var c1:Coin = new Coin();

    coin is placed in the appropriate x and y coords

    C1.x = kNum [chosenNums [chosenNumsIndex]] .x;

    C1.y = there kNum [chosenNums [chosenNumsIndex]];

    addChild tells the main timeline to display the piece once it is generated.

    this.addChild (c1);

    trace (chosenNums [chosenNumsIndex])

    Pull the movieclip appropriate off-table and play to darken.

    mcArray [chosenNums [chosenNumsIndex] - 1] () .play;

    fill the low numbers

    chosenNumsIndex increments for the next time chuckBall works

    He draws the element next to the chosenNums table.

    chosenNumsIndex ++;

    bottomArray [chosenNumsIndex - 1] = chosenNums [chosenNumsIndex-1];

    trace ("value bottomArray" + bottomArray [chosenNumsIndex]);

    firstWinningNumB.text = bottomArray [0];

    twoWinningNumB.text = bottomArray [1];

    threeWinningNumB.text = bottomArray [2];

    fourWinningNumB.text = bottomArray [3];

    fiveWinningNumB.text = bottomArray [4];

    sixWinningNumB.text = bottomArray [5];

    sevenWinningNumB.text = bottomArray [6];

    eightWinningNumB.text = bottomArray [7];

    nineWinningNumB.text = bottomArray [8];

    tenWinningNumB.text = bottomArray [9];

    elevenWinningNumB.text = bottomArray [10];

    twelveWinningNumB.text = bottomArray [11];

    thirteenWinningNumB.text = bottomArray [12];

    fourteenWinningNumB.text = bottomArray [13];

    fifteenWinningNumB.text = bottomArray [14];

    sixteenWinningNumB.text = bottomArray [15];

    seventeenWinningNumB.text = bottomArray [16];

    eighteenWinningNumB.text = bottomArray [17];

    nineteenWinningNumB.text = bottomArray [18];

    twentyWinningNumB.text = bottomArray [19];

    var lastNumber:Timer = new Timer (60000: 1);

    lastNumber.addEventListener (TimerEvent.TIMER, lastNumDone);

    lastNumber.start ();

    chosenNumsIndex increments for the next time chuckBall works

    He draws the element next to the chosenNums table.

    chosenNumsIndex ++;

    }

    function ballChuckingComplete(event:TimerEvent):void

    {

    trace ("ballchuckingcomplete is working");

    var thirtySeconds:Timer = new Timer (15000: 1);

    thirtySeconds.addEventListener (TimerEvent.TIMER, thirtyDone);

    thirtySeconds.start ();

    }

    function thirtyDone(event:TimerEvent):void

    {

    trace ("thirty seconds to the top");

    Stop();

    gotoAndStop (2);

    }

    function lastNumDone(event:TimerEvent):void

    {

    trace ("last number completed");

    twentyWinningNumB.text = chosenNums [19];

    }

    fill the low numbers

    manually, start the timer.

    Timer.Start ();

    The severe and simple truth is that you will have to re - write everything from the beginning in JavaScript (aka ECMAScript).

    The good news is that JS syntax and functions are 99% identical to AS2. Transition to AS3 will be slightly more difficult due it it is a little more similar to Java.

    The bad news is that all the APIs are completely different. Flanimate in canvas mode uses CreateJS for all rendering, animation and preload. Another thing is the basic JS functionality, or it either library third you import yourself.

    For example, instead of:

    var thirtySeconds:Timer = new Timer (15000: 1);

    thirtySeconds.addEventListener (TimerEvent.TIMER, thirtyDone);

    You would do:

    var thirtySeconds = this.setTimeout (thirtyDone, 15000);

    And instead of trace(), you must use console.log (), since all code must run in a web browser.

  • can someone help me convert actionscript 2.0 to actionscript 3.0 for my interactive sketch notebook?

    If anyone can come back to me, I'd be grateful help.

    I worked on the provision of an interactive drawing buffer but started from a model that was in actionscripts 1 & 2. but when I converted to actionscript 3.0, there are errors.

    I understand not really good coding and hoped someone could help me to make it work for actionscript 3.0.

    Here is the code for actionscript 2.0 (it works perfectly when in the right format)

    lineThickness = 0;

    selectedColor = "0x000000";

    _root. OnMouseDown = startDrawing;

    _root. OnMouseUp = stopDrawing;

    startDrawing() {} function

    If (_xmouse < 455) {}

    _root. LineStyle (lineThickness, selectedColor);

    _root. MoveTo (_root._xmouse, _root._ymouse);

    _root. OnMouseMove = drawLine;

    }

    }

    drawLine() {} function

    _root. LineTo (this ._xmouse, this ._ymouse);

    }

    stopDrawing() {} function

    delete this.onMouseMove;

    }

    line0.onPress = function() {}

    lineThickness = 0;

    };

    line3.onPress = function() {}

    lineThickness = 3;

    };

    Line6.onPress = function() {}

    lineThickness = 6;

    };

    colorRed.onPress = function() {}

    selectedColor = "0xFF0000";

    };

    colorGreen.onPress = function() {}

    selectedColor = "0x00FF00";

    };

    colorBlue.onPress = function() {}

    selectedColor = "0x0000FF";

    };

    colorYellow.onPress = function() {}

    selectedColor = "0xFFFF00;

    };

    colorMagenta.onPress = function() {}

    selectedColor = "0xFF00FF";

    };

    colorCyan.onPress = function() {}

    selectedColor = "0x00FFFF";

    };

    colorBlack.onPress = function() {}

    selectedColor = "0x000000";

    };

    eraser_btn.onPress = function() {}

    _root. Clear();

    };

    use:

    var lineThickness:int = 0;

    var selectedColor:int = 0 x 000000;

    this.addEventListener (MouseEvent.MOUSE_DOWN, startDrawing);

    this.addEventListener (MouseEvent.MOUSE_UP, stopDrawing);

    function startDrawing(e:MouseEvent):void {}

    If (mouseX<455)>

    {with (this.) Graphics)}

    lineStyle (lineThickness, selectedColor);

    moveTo (mouseX, mouseY);

    this.addEventListener (MouseEvent.MOUSE_MOVE, drawLine);

    }

    }

    }

    function drawLine(e:MouseEvent):void {}

    {with (this.) Graphics)}

    lineTo (mouseX, mouseY);

    }

    }

    function stopDrawing(e:MouseEvent):void {}

    this.removeEventListener (MouseEvent.MOUSE_MOVE, drawLine);

    }

    for (var i: int = 0; i<>

    This ["Line" + i] .addEventListener (MouseEvent.MOUSE_DOWN, downF);

    This ["line" + i] .ivar = i;

    }

    function downF(e:MouseEvent):void {}

    lineThickness = MovieClip (e.currentTarget) .ivar;

    }

    var colorA: Array = [[colorRed, 0xff0000], [colorGreen, 0x00ff00],..., [CouleurJaune, 0x000000]];

    for (i = 0; i<>

    colorA [i] [0] .addEventListener (MouseEvent.MOUSE_DOWN, colorF);

    colorA [i] [0] .ivar = i;

    }

    function colorF(e:MouseEvent):void {}

    selectedColor = MovieClip (e.currentTarget) .ivar;

    }

    erase_btn.addEventListener (MouseEvent.MOUSE_DOWN, eraseF);
    function eraseF(e:MouseEvent):void {}
    This.Graphics.Clear ();
    }

  • How can I convert my 100 games flash (actionscript 2.0) in HTML5 now that swiffy is dead?

    Unfortunately I didn't swiffy would be killed until August.  I have a lot of games I built using flash with actionscript 2.0, and I do not know now how to export to HTML5 without swiffy.  Someone at - he found a solution?  Adobe has a solution for us?  Singular video showing how convert a very basic adobe HTML5 flash ad is no help to those who have made the beautiful games and complex using flash with actionscript 2.0.

    I'm excited about learning all these new languages like actionscript 3.0 which is not at all compatible with actionscript 2.0, but I have to convert my current games in HTML5 first before you spend another few years learning a new language.

    I didn't adobe address this problem that many people, but I found an application called flaexporter that only works on flash cc.  I don't have flash cc, and it seems not available for download as a "past/old version" of my adobe creative app download.  Is there a way to download this older cc flash application, so I can export all my games to HTML5?  I don't want to lose years of game development just because swiffy disappeared.

    I have the cs adobe complete with all applications to update software including cc lively.  Unfortunately, animate cc seems unnecessary, because when I try to open one of the games I put years of work into, he destroys this game completely.  When I publish the game, it does not at all.

    I create games for education and had used swiffy and flash because they were easy for a designer like me to use.  I'm not a high level programmer, but I've always been able to create and edit flash.

    1 animate cc told me that only a3.0 files can be imported and still work.  So, how to export actionscript 2.0 to actionscript 3.0 using the flash c6s that always works on my laptop?  I don't see the option export for actionscript 3.0 in flash c6s, and I do not see the option "successfully" import ActionScript 2.0 cc animate.  Is there something I'm missing here?   Someone at - he found a solution to this problem?

    2. instead of trying to figure out how to export a2.0 a3.0, just so that I can open it to animate cc, then export to HTML5, is there an easier way - similar to swiffy, who has ignored all these steps your time?

    If anyone has an answer, thank you!

    Please do not cross-post.

    See How can I convert my 100 games flash (actionscript 2.0) in HTML5 now that swiffy is dead?

  • How to convert swf Actionscript 3 in HTML5

    Hi guys,.

    I have experience with Flash/Animate but not HTML5. I was under the impression that Animate has the ability to export or convert any project of HTML5 or even Android or iOS. However, I could not find a way to do it. Whenever I try to convert or export, my project loses all its features interactivity Actionscript like buttons or drop-down list boxes.

    Do what I have to start a project as an HTML5 project from the outset? I need to program in JavaScript instead of Actionscript?

    You can convert your AS3 FLA to be an HTML5 Canvas in Florida who has to keep all the layers and symbols, but it will comment all ActionScript. JavaScript have usually the classes and packages, so more likely, you will need to rewrite all the code in Javascript in the timeline panel.

    There are other changes you will have to do too much, for example, sound should be the event and cannot be Stream and numerous color effects and filters do not work.

  • How to convert a shape to a button by programming in actionscript 3?

    Hello

    I passed all the information I need to draw a shape in FlashVars. After that I designed the form, how can I convert this shape to a button using actionscript? Thanks in advance for your help.

    Kind regards

    Nilang

    You can directly draw a sprite or add the Shpe as child of a Sprite, like this

    var shape: Shape = new Shape();
    shape.graphics.beginFill (0xff3345);
    shape.graphics.drawRect (0,0,100,30);

    var btn:Sprite = new Sprite();
    btn.buttonMode = true;

    btn.addChild (shape)
    addChild (btn)

  • Is there an automatic ActionScript OLD/NEW converter?

    Hi all
    I've been using Macromedia Flash version 4 & 5 in 1999 ~ 2001. -I'm an old man.
    Then I stopped using Macromedia Flash.
    Now, I need more 100 swf flash files that I created at this time (8 years ago) to resurrect.
    Yes, all these SWFs that have been written in AS1 still work in current browsers (maybe the browsers automatically detect the correct version of flash player for my swf files)
    However, now the problem is I have to add more animals to & edit these old .fla files using the latest version of flash. And the new Macromedia Flash does not seem automatic conversion my old AS1 scripts for the new flash 8 player or higher... and displays only error messages.
    So my question is, is it ActionScript auto conversion software to convert the old AS1-AS2/AS3 files which can be read using the flash player version 8 or higher?

    URMyLuckyStar,

    > Yes, all these SWFs that have been written in AS1 still work
    > in current browsers (maybe the automatic detection of browsers the)
    (> good version of flash player for my swf files)

    Browsers does not inherently detect Flash Player, but the HTML that incorporates
    your SWF can be programmed with JavaScript to do it. More than likely,.
    what you see, is simply the fact that (for the most part) Flash Player
    is backward compatible. I can only think of one or two discouraged
    Terms of ActionScript (for example, the concatenator "add") are no longer
    supported. Seems like your SWF AS1 happens to be free of those very
    a few scenarios.

    > However, now the problem is I need to add more stuffs to &
    > change these old .fla files using the latest version of flash.

    This shouldn't really be a problem. :)

    > And the new Macromedia Flash does not seem automatic conversion my
    > old AS1 scripts for the new flash 8 player or higher...

    Unless your changes need the new features of Flash Player, you can
    keep on using AS1 and published for Flash Player 4, 5, 6 and so on.

    > So my question is, is auto conversion to ActionScript
    > software to convert the old AS1-AS2/AS3 files which
    > viewable with flash player version 8 or higher?

    There is no, I know. But what error messages are getting you?
    Why do you need to specifically target the Flash Player 8 (or higher)? (I ask)
    Because maybe you don't have.) Flash Player 8 is the version to drop support
    for the concatentor 'Add', so that's the only issue. Let's see some of
    your error messages and who should bring solutions to light.

    David Stiller
    Co-author, Foundation Flash CS3 for designers
    http://tinyurl.com/2k29mj
    "Luck is the residue of good design."

  • How can I convert an ActionScript 3.0 in ActionScript 2.0?

    I'm having a serious problem because I did a website in Flash CS4 ActionScript 2.0 in a long time, but then I opened it in CC and saved, it became simply a file in ActionScript 3.0. I need in Action Script 2.0, can someone help me?

    You will need to do is to get your hands on CS6 (even the trial version will suffice) and open the files and save them as files AS2.  If you have a creative cloud subscription, you will have access to install/use CS6 as well.

  • Problem converting java.util.HashMap in an ActionScript object

    I have this weird problem and I can't figure it out, let me explain:

    I have a java object A that has a variable myMap HashMap, this card will hold objects of class b. inside B is an instance of class C. In ActionScript, I have A corresponding class that has a myMap variable, but since no HashMap in ActionScript type is Object and I also have corresponding, B and C classes.

    [RemoteClass(alias="com.test.A")]
    public class A {}
    public var myMap:Object; It's the hash in Java table
    }

    [RemoteClass(alias="com.test.B")]
    public class B {}
    public var: identification number;
    public var name: String;
    public var myC: C
    }

    [RemoteClass(alias="com.test.C")]
    {} public class C
    public var myId:Number;
    public var myName:String;
    }

    I need to put objects C of each object B of the card inside a DataGrid control, so I get the class A with a RemoteObject object and then I iterate on myMap property using a foreach loop, like this:

    for each {(var i: * dans objectA.myMap)}
    someArrayCollection.add (i.myC);
    }

    The first issue was published here, java HashMap contains 3 elements, in the loop of the ActionScript I get 4 items, the fourth being a reference to an object. To avoid this, I use the operator "is" like this:

    for each {(var i: * dans objectA.myMap)}
    (if I is B) {}
    someArrayCollection.add (i.myC);
    }
    }

    Now, here's the real problem, when I do that objects C contained in the myMap property B objects are reset to their original values (myId is NaN and MyName is an empty string according to class C). I changed the if this condition and worked:

    for each {(var i: * dans objectA.myMap)}
    If (!) () I is A)) {}
    someArrayCollection.add (i.myC);
    }
    }
    When I did the control DataGrid displays the values of the perfectly good C (myId and MyName) objects. I did a little more testing and I 'found' the question, if I use an instance of the class B anywhere in my application, the values of the C object are reset, for example:

    for each {(var i: * dans objectA.myMap)}
    (if I is B) {}
    someArrayCollection.add (i.myC);
    }
    }
    var test: B = new B();

    This resets the object C (myId and MyName) of each object B contained in the plan of a being that has no absolute meaning.

    If the thing is when I use the B class, which is the class of the objects inside myMap, C objects are set to zero. Does anyone know how to fix this?

    I'm using Flex 2.01 hotfix 3, I wonder if it's some kind of bug that has been fixed in a later version.

    Any help would be appreciated.

    OK I fixed it, as I have said that my app was a more complicated scenario here is what happened:

    The C object is the superclass of the D and E, and the Java service puts the D or E, objects inside the property of object B myC, myC type C and C is the super class D and E, then it works.

    The problem is that in Flex object C inside B is actually a D or E object, I just had to use an instance of D and E somewhere in the code, that is why Flash Player included these classes.

    Anyway, I know it's all complicated, but the good news is that it works now

  • How to convert a document to ActionScript 2.0 to 3.0

    ?

    There is no easy way.  you have to rewrite the code.

    some things convert easily, others do not.

  • Convert mouse_click actionscript for touch events

    I am currently using a version of CS6 Flash Pro PC.

    I just created a Flash project that activates the buttons and opens other actions within which works perfectly when you use the mouse to click the buttons.

    However, I must now be able to use the same project for the touchscreen feature.

    Friend capable of transforming a mouse_click event code touch events?

    Is how hard it?

    Will I need to completely redo this project?

    I searched high and low on the internet and have found nothing about it.

    Any help is appreciated.

    Thank you

    Michael

    for simple keys (like buttons), it is easier to use MouseEvent.MOUSE_DOWN events instead of TouchEvents.

  • ActionScript &gt; Html 5

    Hello everyone.

    At the time, I was using a piece of code in actionscript to suspend my clip on a keyframe:

    Stop();

    var ID = setInterval (function () {}

    Play();

    clearInterval (ID);

    (}, 3000);

    I wanted to know if anyone of you knows how to convert in HTML5 (as a lively CC) or if you had a different technique to work.

    Thanks in advance

    This.Stop ();

    var clip = this

    var ID = setInterval (function () {}

    clip. Play();

    clearInterval (ID);

    (}, 3000);

  • ActionScript in JavaScript?

    I'm more familiar with ActionScript. The new easily animate will convert the script to me (I want it to be js/HTML5)?

    Laughing out loud

    You must convert yourself.  ActionScript and JavaScript are very similar.

    and in the ide, you can use easeljs, CreateJS | A suite of tools designed to work with HTML5 and JavaScript libraries

  • ActionScript file and fla file does not recognize each other

    I downloaded adobe flash professional (trial version) CC this morning on my pc and I am really a beginner.

    I want to use the ActionScript 3 with a purpose of fla and I used a tutorial (and many others later) to perform this task:

    -make a square

    -convert to symbol and call it 'test '.

    -write my code like a .as targeting my .fla file using test for my usable variable.

    -Save them

    and when I wanted to run my program, I got my blue square as non .swf

    So I tried to debug my code in the debug window telling me that there is no actionscript code in my .swf

    Finally, I copied my code in the action window and I received several messages telling me that 'test' was not defined.

    I need help please.

    Here's the problem:-write my code like a .as targeting my .fla file using test for my usable variable.

    Add your code to the timeline, or even better use the class files.

Maybe you are looking for