Solved

ActionScript2-   .loadMovie (); Method

Posted on 2011-02-20
4
415 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
  • 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

778 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