ForumsProgramming ForumExternal ActionScript

6 3268
Midmenj
offline
Midmenj
216 posts
Nomad

Does anyone know how to do this?

  • 6 Replies
BeastMode10
offline
BeastMode10
374 posts
Nomad

What do you mean?

If you are referring to, perhaps, external swf files, then...well since I use FlashDevelop I can't really help you.

Darkroot
offline
Darkroot
2,763 posts
Peasant
gone3d
offline
gone3d
17 posts
Nomad

I don't use the timeline at all anymore - I think that's what you're asking?

In the properties Tab

click on the background so the document comes up in the Properties Tab

There is a field there called 'Class'

Enter in something like 'Main'

in the editor, create a file call Main.as (don't put Main.as in the Class field. And then the .fla will start with that file when it compiles.

Open a new flash project and put this in Main.as to test:

package {

import flash.display.Sprite;

public class Main extends Sprite {

// graphic element exported for action script in the .fla
private var myMovieClip:MCinFLA;

public function Main() {
trace("Start Main"
// create new graphic object
this.myMovieClip = new MCinFLA();
// add object to the stage
this.addChild(this.myMovieClip);
// position the graphic
this.myMovieClip.x = 100;
this.myMovieClip.y = 100;
}
}
}

Create the MCinFLA on the stage, make it a symbol and click on the Export for ActionScript button

There are also a ton of tutorials pretty much everywhere on what to do on this - google it.

Good luck!

D

Hectichermit
offline
Hectichermit
1,828 posts
Bard

Well I know about 2 types of external class files

The first is the Document Class which is linked by typing it in some box within a normal Fla file its in the properties box but you must create the AS file first. The other is creating a Movieclip class, when you create a movie clip for an Fla you can set "export for Actionscript", if you save a AS file in the same folder as the Fla it will be able to access it without writing a file path in the code, theres also a setting in flash that allows you to link custom classes, which I don't know how yet...

gone3d
offline
gone3d
17 posts
Nomad

So what is it you're trying to do?

Midmenj
offline
Midmenj
216 posts
Nomad

I'm now trying to make an enemy and make him go up and down. I got a left to right but its hard making him go up and down

Showing 1-6 of 6