'inteligent' numbered clips

  • cloud4197
  • Born
  • Born
  • cloud4197
  • Posts: 2

Post 3+ Months Ago

Hi all,

if i have 10 movie clips all numbered according to their position in a list, can i make them understand their position and re-number themselves if re-arranged?

So far I can make 4 move to 2 (for instance) and know it's now 2, but how do I then make sure the old 2 has now re-numbered itself as 3, and the old 3 has re-numbered itself as 4 in order to accommodate the new order.
... does that make sense?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • classified
  • Expert
  • Expert
  • User avatar
  • Posts: 540
  • Loc: Bahrain

Post 3+ Months Ago

:S
i don't know ... but you can creat an array of postions

var posX:Array = new Array();
var posY:Array = new Array();

and start pushing values of their X and Ys ... something like that ...
jeee its late here cant think ..sozz
  • cloud4197
  • Born
  • Born
  • cloud4197
  • Posts: 2

Post 3+ Months Ago

Yeah i've got that far, but the trouble is, there will be an indefined number of array names. any idea how to make an array that can cope with that? i.e. adding Name4 after name 3 automatically...
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

yea, give them an ID;
i.e.:
for (i=0; i<10; i++)
this["movieClip"+i].ID = i;

then just change their ID's after each move. So if u move 4 to 2,
movieClip1 has the same ID, movieClip4 has ID = 2,
and starting from movieClip2, increase the ID with 1.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 21 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.