Link to home
Start Free TrialLog in
Avatar of raulmonda
raulmonda

asked on

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...
container_mc.moveTo(430,170);
// 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.

Regards,
Raul M.
ASKER CERTIFIED SOLUTION
Avatar of sjklein42
sjklein42
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of raulmonda
raulmonda

ASKER

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());
logo_mc.createEmptyMovieClip("container_mc",0);
logo_mc.container_mc._x=430;
logo_mc.container_mc._y=170;
logo_mc.container_mc.loadMovie("image.jpg");

Im sorry, Lamase solution didnt works.

Regards, Raul