Skip to main content
Participating Frequently
May 4, 2011
Answered

How to import an AS3 project in Flash

  • May 4, 2011
  • 1 reply
  • 2432 views

Hi,

First of all, I got to say that I'm new to Flash and AS3 and that my english is far from perfection, so just tell me if I'm saying anything you can't understand.

I received the source code of a website which is fully in flash. The code is sperated in two parts, one is containing the application specific code and the other one is containing the AS3 library.


I'm kind of lost when I'm trying to run it in Flash. What is the right way to import a full action script project in Flash? Where should I put the library?
If you got any good tutorial to explain this I would be great. If you got a good explanation it's great too

Thank you.

This topic has been closed for replies.
Correct answer Kenneth Kawamoto

So I put all my library in the src folder.

I got 4 errors but since they are coming from my library I think I can just bypass them, but I'm not sure.

I also got a lot of warning on function, all like this one:

Parameter 'heightLimit' has no type declaration.

Anyway, I look much closer to a compilation than ever.

What should I launch after the compilation? Right know it's trying to launch /Users/alexandredebetak/Desktop/Website/bin-debug/AppInit.html but since I got no file AppInit.html file, it can't work.


AppInit.as is not really the main class (we just set it to see) - can you find a class that extends Sprite?

With those errors you cannot compile into SWF. Can you just contact the author http://lab75.jp/de/contact ...?

1 reply

Community Expert
May 4, 2011

First you have to identify the main class (default application class). It can be called Main.as or [name of the application].as but can be anything. It usually extends Sprite, but can be MovieClip. It may have metadata such as [SWF] and [Embed]. It can be in the root of "src" directory.

Then set it as Document Class in Flash (Publish Settings > Advanced ActionScript 3.0 Settings, or Class field under Document Properties panel).

You have to include the package name as well. If you can tell us the structure of your files it's easier to show you exactly what you need to do.

If it's a code only project it's far better to use Flash Builder (or any other 3rd party tools) instead of Flash, by the way

StefaNouFAuthor
Participating Frequently
May 4, 2011

Thanks for your help!!

I indeed reoriented myself on  Flash Builder since it appears as you said a more appropriated tool.

Here is the structure of the project

http://i.imgur.com/4tvDz.png


I also got an AS3 library, and I'm not really sure about where should I put it.

I dont know wich file is my main since AppInit is extending "Lib", DataGetter is extending EventDispatcher (So this is my model if I'm right ), and TemplateFactory is exentending Object.

I got no .fla file, so I don't really know if I should create one with Flash and link it with some magic trick  with Flash Builder.

I'm guessing you need more information to help me, so just ask and I'll tell you. I hope I'm not that far from compilating this website because it seems pretty hard and I already spent a lot of time on it.

Thank you.

StefaNouFAuthor
Participating Frequently
May 4, 2011

Do not use Flash, use Flash Builder, full stop

The structure does not look right to me though. Create a new directory with your app name, and place "src" directory (that contains app directory) in it. In Builder create new ActionScript Project and set Project contents to the directory you created. Then set Main source folder to "src" (should be set to that already) and Main application file as app/AppInit.as and see how it goes. I bet you'll get a lot of errors but we can see what's going on from the errors


So let's forget Flash and let's focus on Flash Builder

So i created a ActionScript project as you said, I designed the src folder as the source folder, and AppInit.as is now my main, here is the error.

(Maybe it's too small, 1017: The definition of base class Lib was not found.)

And I guess that I still need to include my AS class library somewhere. Seems kind of obvious that I should put it in the Library path but my library contains only .as files and the Library path seems to receive only SWC. But maybe I'm 100 miles from what is right.

Once again, thank you for your very precious help.