How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask Nick Your Own Question
Nick
Nick, Computer Hardware Engineer
Category: Programming
Satisfied Customers: 66
Experience:  C#, Java, PHP, JavaScript. Let's solve some cool problems.
65119931
Type Your Programming Question Here...
Nick is online now
A new question is answered every 9 seconds

I found the following sample "action script" 11 lines of code,

This answer was rated:

I found the following sample "action script" 11 lines of code, file name for it called eg my.as:

package {
import flash.display.Sprite;
public class ExampleApplication extends Sprite {
public function ExampleApplication( ) {
graphics.lineStyle(1, 0, 1);
for(var i:int=0;i<100;i++) {
graphics.lineTo(Math.random( ) * 400, Math.random( ) * 400);
}
}
}
}

it draws a bunch of random lines to the screen.
It says I should "save and run" this, and my browser
should open the resulting HTML file and display the .swf with 100 random lines in it. As you can see,
the constructor was executed as soon as the file was loaded into the player.

Is it possible to do this (execute it?) and see 100 lines on my screen? I have a PC with XP.
All I have in a folder right now is this "my.as" file ---do I need an "as compiler"? a million run-time
libraries!? I have no clue what to "do" with this ".as" code!!
The author is assuming I know what I am doing I guess!! I never used "as" before, is it a mess?
thanx!

Nick :

*.as files are ActionScript code. They are for use in Adobe Flash. Do you have a copy of Adobe Flash available to use?

Customer:

I have it in all my browsers,,,but do not know how to use it offline can i use it online

Customer:

for my .as file? or,,must i use adobe flash online?

Nick :

What you are talking about is Adobe Flash Player

Nick :

there is another software called Adobe Flash Professional that is required

Nick :

You can purchase it from Adobe and install it on your computer. It is quite expensive.

Customer:

so that little as file, as I showed, is useless to me on my xp pc, unless i get AFPro?

Nick :

that's correct

Nick :

You could try the open source alternative called synfig

Nick :

But I don't have any experience with it.

Customer:

i have used a lot of languages,,,never heard of this actionscript

Customer:

is it widely used/popular?

Nick :

It's proprietary to Adobe products

Nick :

Flash is very prevalent and so actionscript has become prevalent within adobe products

Nick :

It's also used in another product they make called Adobe Air

Nick :

it's loosely based on javascript

Customer:

ok, that all for now, thanx!

Nick :

You're welcome. If I've answered your question, please make sure you accept my answer. I appreciate the opportunity to assist you!

Nick and other Programming Specialists are ready to help you