Solved

ActionScript2-   .loadMovie (); Method

Posted on 2011-02-20
4
418 Views
Last Modified: 2012-05-11
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.
0
Comment
Question by:raulmonda
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
sjklein42 earned 450 total points
ID: 34938809
Try setting _x and _y:

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

Open in new window

0
 
LVL 4

Assisted Solution

by:LAMASE
LAMASE earned 50 total points
ID: 34938824
It seems that moveTo set the drawing point, so it should be called BEFORE loading the image.
0
 
LVL 16

Assisted Solution

by:sjklein42
sjklein42 earned 450 total points
ID: 34938860
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.
0
 

Author Closing Comment

by:raulmonda
ID: 34939011
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
0

Featured Post

Turn Insights into Action

Communication across every corner of your business is essential to increase the velocity of your application delivery and support pipeline. Automate, standardize, and contextualize your communication processes with xMatters.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question