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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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?
Dier02Author Commented:
I want to load SWFs into the container when a button is clicked.  I want to create the container programmatically via actionscript.
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!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Dier02Author Commented:
Is it the same code for Actionscript 2?
Dier02Author Commented:
Tried it but no luck
ariestavCommented:
No this is not the same as AS2, sorry.
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?  


Dier02Author Commented:
No output message and intended for AS2
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

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.