Skip to main content
September 3, 2006
Answered

attach movie clip

  • September 3, 2006
  • 4 replies
  • 217 views
Hello i asked this in my another topic but that topic was mainly related with another problem.

my question is;

i have 3x3 square boxes ( "box_mc"s movie clips duplicated from 1 "box" movie clip on stage)

I want to put a small box (that is movie clip "smallmc") in front of bigger one(that is one of another mc "box_mc" already placed on stage). When i click big box( i mean "box_mc") i want to attach an instance of "smallmc" in front of big one.

i have this code in "box" mc ;
on (press) {
if (this.selected == 0) {
trace("box is selected");
selected = 1;
_root.attachMovie("smallmc","smallmc"+count,getNextHighestDepth(),{_x:this._x,_y:this._y});
_root.count++;
trace(_root.count);
} else {
trace("unselected");
selected = 0;
_root.count--;
trace(_root.count);
}
}

but this code puts "smallmc" under "boxmc" :(( and 1 more problem ;

i have 3x3 big boxes; and when i click a "boxmc" it puts 1 smallmc then i click another "boxmc" it puts "smallmc" but previous one dissappearing.(but this is not prior problem i think first i should put small boxes in front of big ones)

thank you for your all helps advices
This topic has been closed for replies.
Correct answer Newsgroup_User
Not sure if this will help but: getNextHighestDepth() is not a standalone
method - it is a method of a MovieClip. You need something like:
this.getNextHighestDepth() instead.

--
Dave -
Adobe Community Expert
www.blurredistinction.com
http://www.adobe.com/communities/experts/


4 replies

September 4, 2006
oh i just thought that if i cant put small boxes on big ones may i change big boxes' inside?
i mean that ; a big box is rectangle that has stroke and colored interior. Could i change the color of this interior part of rectangle(not stroke) by using code when i click this movie clip("box_mc")?
September 4, 2006
thank you for your help but still small boxes under big ones:((
Newsgroup_UserCorrect answer
Inspiring
September 4, 2006
Not sure if this will help but: getNextHighestDepth() is not a standalone
method - it is a method of a MovieClip. You need something like:
this.getNextHighestDepth() instead.

--
Dave -
Adobe Community Expert
www.blurredistinction.com
http://www.adobe.com/communities/experts/


September 4, 2006
again i couldnt explain my problem very well?:( maybe first i need to improve my english;)