Solved

ActionScript2-   .loadMovie (); Method

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

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 …
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The viewer will learn how to count occurrences of each item in an array.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now