4 Replies Latest reply on May 18, 2015 8:45 AM by seano2o7

    How to write a function (for an ex-Flash-dev)

    Allison@HavasLynx Level 1


      I'm from a Flash/AS 3.0 background and I am getting a bit confused trying to write functions in EA.

      I am quite new to JS and jQuery so although some stuff is similar to actionscript, I am still finding things a bit confusing.


      I am working on my first project using EA 2014.1.1 and have managed to get away with the built in functions up to now, but I now need to do some more custom stuff.


      For example, in Flash, I would write a function for a button and it would go into the first frame of the timeline or a class file:


      function nameOfFunction (event) {

           //do stuff



      Then on the button we'd have an event listener script calling the function:

      myButton.addEventListener(MouseEvent.CLICK, nameOfFunction);


      Can anyone explain to me how it works in EA?

      It seems easy to use for very basic functions but anything more requires advanced JS knowledge!


      I have looked at lots of tutorials but they are either for old versions of Edge or they only cover basic stuff.

      There doesn't seem to be much out there at all.


      Many thanks