Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

createEmptyClip and Properties Problem

Posted on 2006-07-22
2
Medium Priority
?
296 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
[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 Comments
 
LVL 1

Accepted Solution

by:
laner2k earned 1000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

722 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