• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 428
  • Last Modified:

ActionScript2- .loadMovie (); Method

hi experts,

I have the following situation: main movie clip (size 900x600). In this movie clip i loaded a secondary movie clip (size 210x40). The secondary movie is loaded and played at (0,0) coords which is not where i want to play. I need it at 430,170. using .moveTo(x,y) didnt work.
to load the secondary movie  i used the following code:

logo_mc._lockroot = true;// for having access to library in the loaded movie
this.createEmptyMovieClip("logo_mc", this.getNextHighestDepth()); // here i create a" parent" movie to hold a child...
logo_mc.createEmptyMovieClip("container_mc",0);// here i create the child in which the secondary movie will be loaded...
logo_mc.container_mc.loadMovie("image.jpg"); // loading the secondary movie...
// i even use this line : logo_mc.container_mc.moveTo(430,170);
logo_mc.onPress = function() {
trace("It works"); 

Open in new window

Everything is working fine but the jpg is not loaded where i want to.

did i make something wrong in coding? or there is another way to set the position of a loaded movie into another one?
Any help in this matter will be highly appreciated.

Raul M.
  • 2
3 Solutions
Try setting _x and _y:

container_mc._x = 430;
container_mc._y = 170;

Open in new window

It seems that moveTo set the drawing point, so it should be called BEFORE loading the image.
moveTo is used when you are drawing a series of lines and curves.  It does not move a window (mc) to a position.  For that, you set the window's _x and _y values.
raulmondaAuthor Commented:
Thank you,

sjklein solution was very close!  i had to set the coords by calling the parent movie as follows:

this.createEmptyMovieClip("logo_mc", this.getNextHighestDepth());

Im sorry, Lamase solution didnt works.

Regards, Raul
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.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now