What is the difference between JavaScript  and ActionScript?

Posted on 2011-10-26
Last Modified: 2012-05-12
I have a JavaScript script that displays a widget on my html site. I am going to flash for my new site and need to have that widget in the flash movie. Is there a way I can insert the script without having to re-write the whole thing? I know nothing about ActionScript but I hear JS and AS are very similar.

Question by:DantechIT
    LVL 17

    Assisted Solution

    JavaScript is built into most web browsers, and it is usually used to interact with the web page in which it lives. You don't write a web page in JavaScript. You write it in HTML or XHTML, and you use JavaScript to add functionality to it.

    ActionScript is the programming language built into Flash. When you build an application in Flash, you can use ActionScript to bring the image to life much like JavaScript adds functionality to web pages.

    Author Comment

    Thanks for the reply.

    I know what they are but I don't know how close they are. For instance, will my JS script work in a flash movie if I put it where the actionscript goes? Do they have different libraries?
    I'm a Telecomm guy that knows a bit of JS and I want to see if it is worth my time to try to figure out how to get this to work with my new site or if I should just pay someone to do it.
    LVL 75

    Assisted Solution

    by:Michel Plungjan
    You can likely use the algorithms. It is the DOM that is different (not an answer, just a comment)

    More here
    LVL 37

    Accepted Solution

    If you are simply asking if your JS will work as is inside Flash, no it will never work.  Like mplungjan mentioned, the way you access elements are totally different.  An extreme example would be something like this.  You do not know how to drive a motocycle automatically just because you know how to ride a bicycle.  I am not saying one is better than another, but it's that much of difference if you ask me.


    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Article by: DanRollins
    This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (, we'll extend the program by adding a depth-…
    Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
    The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
    This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now