Groups | Blog | Home
all groups > flash actionscript > january 2007 >

flash actionscript : renaming dynamic mcs



soupycafe
1/2/2007 10:47:08 PM
Hello and Happy New Year!!!

I have been trying to rename dynamic movieclips on the stage and place them
into new levels without re-attaching.
I have used eval, _name and .name, but to no avail.

I would appreciate your prompt assistance,
Emma=)


_root["thumbNail"+a].name=eval("thumbNail"+p);
sly one
1/3/2007 1:04:05 AM
soupycafe
1/3/2007 1:14:42 AM
hello sly one!

thank you for replying.

Wellllllll, I am making an editable video player.
The user selects from a menu and this attachs a movieclip where he can now
drag the new movieclip onto his editing platform.
He can select many videos/mcs multiple times placing them on the editing
platform.

He can also delete the mc if he drags it over the delete box.
He can also re-order the mcs, if he places one in front of other.

Then the video player plays according the movieclips on the platform.
Similar to jumpcut.com

That is the main concept. I am using an object list to track this information,
but I seem to have run into trouble when trying to rename the selected
movieclips.
It would help to rename them so I can track the levels and number according to
the list.
Right now, I have it re-attaching..etc and re-importing graphics...EW!

Any help is appreciated, let me know if I have been too abstract.

Kind Regards,
Emma
_AlbertG_
1/3/2007 1:48:45 AM
You were clear.

Well, we don't know exactly why you can't rename them but maybe I have a
solution.

All functions like (duplicateMovieClip, attachMovie, createEmptyMovieClip)
return the instace of the movieClip created/attached/duplicated. It meas that
you can have multiple names refering the same movieClip without increasing the
memory used.
For Example
//-----------
var currentClip:MovieClip = attachMovie("LibraryID", "newClipName", 10);
//---------
Here newClipName and currentClip have the same reference to the movieClip
attached. Also you can create as many references as you want.
//------------
var anotherRef:MovieClip = currentClip;
var anotherMore:MovieClip = anotherRef;
...
//------------
As you can see, your movieClip can have multiple names :D


AddThis Social Bookmark Button