Skip to main content
Participating Frequently
August 15, 2009
Question

OOP Load a Flash Page via External Action Script (.as File)

  • August 15, 2009
  • 2 replies
  • 1215 views

CS3 actionscript 2

Is it possible. Can I make a flash file that is OOP and, also design a short movie clip within Flash without it being external actionscript?
(Have done the above, but don't know if this is why I'm having a problem.)

Now, for the real problem, how do I call that particular movie clip.

I have worked on this for better than 2 weeks reading everything I can find, google, the forums, and their seems to be little information on OOP.

Would someone post a very simple example of how to load a clip from the external actionscript.

I know it is difficult for people to give up their time in the aide of others when they are lost and often are using incorrect terms. I will do my part, I will upload anything one may need to our server. I will provide all my code and share that code for you to use as desired. (some of it is really neat).

I really do need some guidance,,,THANKS

Here is my page that works inside the flash file.box
and here is what I want it to do entire file will need to click question mark. It also hangs from a PC, but works most of the time from a Mac.

This topic has been closed for replies.

2 replies

kglad
Community Expert
Community Expert
August 20, 2009

yes?

i received an email in the past hour (2:30pm pst) from you.

kglad
Community Expert
Community Expert
August 15, 2009

pass a movieclip to your constructor and use that to attach your linked library movieclip.  ie:

// in your class file:

.

.

public class C(mc:MovieClip){

mc.attachMovie("yourlinkageID","mcName",depth);

// in your fla:

var c:C=new C(this);  // or pass any other movieclip

ButchmuAuthor
Participating Frequently
August 16, 2009

I  really appreciate the reply.  Somewhere I'm missing something.  The compiler gave two errors

1. error in script layer 1 line 1

2. attribute used outside class

I've tried everything I can think of.....I'm missing something, any suggestions,  I will try a hundred different ways all wrong to figure out one that is right.

Again, thanks...it was  helpful, it was one more piece of information.

kglad
Community Expert
Community Expert
August 16, 2009

here's a complete class file that does what you want:

class Main extends MovieClip{
   
    public function Main(tl:MovieClip){
        tl.attachMovie("mcID","mc",1);  // mcID is a movieclips linkage id
    }
   
}

if you're still having problems, copy and paste your class file.