Create empty container of specific size in flash

I want to create a container on my stage (1024x760) of a certain size (332x288) at the coordinates x-38 and y-176.  How would I do this?
Dier02Asked:
Who is Participating?
 
ariestavCommented:
To create the container movie via Actionscript 3, write this code in the first frame of your main timline:

var container:MovieClip = new MovieClip();

container.width = 332;
container.height = 288;
container.x = 38;
container.y = 176;

addChild(container);

--------------
Keep in mind that while the container movieclip will actually be on the stage at this point, you may not "see" anything because nothing is in the container.  You would have to write more code to add a child to the container, and you probably need to have another movieclip with a graphic symbol within it already in your library.

Good luck!
0
 
ariestavCommented:
By container, I take it you mean an object that you can place (or load) other objects into?  Do you want to do this with Actionscript or with the basic creation (authoring) tools in Flash?
0
 
Dier02Author Commented:
I want to load SWFs into the container when a button is clicked.  I want to create the container programmatically via actionscript.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Dier02Author Commented:
Is it the same code for Actionscript 2?
0
 
Dier02Author Commented:
Tried it but no luck
0
 
ariestavCommented:
No this is not the same as AS2, sorry.
0
 
ariestavCommented:
Also, are you getting any error messages from your output or compiler window after you execute the Actionscript?  Is your Flash file intended for AS2 or AS3?  


0
 
Dier02Author Commented:
No output message and intended for AS2
0
 
Dier02Author Commented:
I tried loading an SWF into the container using loadvars on a button but no luck
on (release) {
           loader.loadClip("screen.swf", container);
     }

Open in new window

0
 
Dier02Author Commented:
FYI


var loader:MovieClipLoader = new MovieClipLoader();
     this.createEmptyMovieClip("container",1);
       container.width = 332;
container.height = 288;
container.x = 38;
container.y = 176;

This works in AS2
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.