Solved

createEmptyClip and Properties Problem

Posted on 2006-07-22
2
265 Views
Last Modified: 2011-09-20
Hi and thanks for reading;

What I want to do is duplicate/attach my "NEO" MC from the lib onto the stage as indicated below. I have the MC likned and I can get only 1 copy to appear on the stage anbd all my traces return indefined. I have tried a couple different variations to no avail including attacing only one mc to each empty clip that has been created and no difference. the closest I got was getitng 0 for x and y props.

I want to have several clips that I populate with the NEO mc in different locations.

What gives lol and TIA

initx = 100;
inity = 150;
dx = 30;
dy = 36;

createEmptyMovieClip("c1",this.getNextHighestDepth());
createEmptyMovieClip("c2",this.getNextHighestDepth());
createEmptyMovieClip("c3",this.getNextHighestDepth());
createEmptyMovieClip("c4",this.getNextHighestDepth());
createEmptyMovieClip("c5",this.getNextHighestDepth());

for (i=1; i<=3; i++) {
newName = "r" + i;
c1.attachMovie("neo", newName, this.getNextHighestDepth());
trace("newname = " + newName);
eval("c1." + newName)._x = 50 ;
eval("c1." + newName)._y = inity  + (dy*i);
}
trace (c1.r1._y);
trace (c1.r2._y);
trace (c1.r3._y);
0
Comment
Question by:MartiniMon
2 Comments
 
LVL 1

Accepted Solution

by:
laner2k earned 250 total points
ID: 17162939
initx = 100;
inity = 150;
dx = 30;
dy = 36;

createEmptyMovieClip("c1",this.getNextHighestDepth());
createEmptyMovieClip("c2",this.getNextHighestDepth());
createEmptyMovieClip("c3",this.getNextHighestDepth());
createEmptyMovieClip("c4",this.getNextHighestDepth());
createEmptyMovieClip("c5",this.getNextHighestDepth());

for (i=1; i<=3; i++) {
newName = "r" + i;
c1.attachMovie("neo", newName, c1.getNextHighestDepth());
trace("newname = " + newName);
eval("c1." + newName)._x = 50 ;
eval("c1." + newName)._y = inity  + (dy*i);
}
trace (c1.r1._y);
trace (c1.r2._y);
trace (c1.r3._y);


//////////////////////////////////////////////////////////////////////////////////////////////////

try that.

what is are the function of the 4 other empty mc? or will you be using them for other stuff, as they arent doing anything at the moment. btw it was the this.getNextHighestDepth() in the attachMovie that was causing it to not function as this wasn't c1 as you might expect but _level0

hope this helps
0
 
LVL 1

Author Comment

by:MartiniMon
ID: 17171370
that has solved the issue. Thanks for the fasdt response. I was able to move forward on that project over the weekend as a result.

I have some other thing I plan to put into the other clips that will be very similar to what I have for the first. If you want to see the final project moving forward go to ***Admin Delete***.com.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
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…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

932 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

12 Experts available now in Live!

Get 1:1 Help Now