- Exclusive Author
- Item was Featured
- Author was Featured
- Author had a File in an Envato Bundle
- Has been a member for 4-5 years
- Sold between 100 000 and 250 000 dollars
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- India
plictis, you need to add the clips into the holder_mc, right? in such case, hers is the working example:
//Your linkage IDs goes here:
var myArray:Array = ["1mc","2mc"];
//This loop populates and positions the clips:
for (var i:Number = 0; i<myArray.length; i++) {
holder_mc.attachMovie(myArray[i], "mc"+i, i);
if (i>0) {
holder_mc["mc"+i]._x = holder_mc["mc"+(i-1)]._x+holder_mc["mc"+(i-1)]._width+40;
}
}
You can use EnterFrame loop instead of “for loop” in case needed. But only if the library symbol’s dimension expected to change after attaching.
thanks pez, but this code duplicates the mc’s, first time on stage and then in the holder. i only need to add the mc’s once.
pezflash said
var mc1 = _root.attachMovie("1mc", "mc1", 0); var mc1 = _root.attachMovie("2mc", "mc2", 1); mc2._x = mc1._x + mc1._width; var myArray:Array = new Array(); myArray.push(mc1); myArray.push(mc2); for (var i:Number = 0; i<=myArray.length; i++) { holder_mc.attachMovie(i+"mc", "mc"+i, i, {_x:i*40}); }
Thanks VF, it seems that this is the right answer. working just fine. and it’s so simple. thanks again. have a perfect day!
VF said
plictis, you need to add the clips into the holder_mc, right? in such case, hers is the working example://Your linkage IDs goes here: var myArray:Array = ["1mc","2mc"]; //This loop populates and positions the clips: for (var i:Number = 0; i<myArray.length; i++) { holder_mc.attachMovie(myArray[i], "mc"+i, i); if (i>0) { holder_mc["mc"+i]._x = holder_mc["mc"+(i-1)]._x+holder_mc["mc"+(i-1)]._width+40; } }You can use EnterFrame loop instead of “for loop” in case needed. But only if the library symbol’s dimension expected to change after attaching.
So a huge thanks to all of those who helped me or just tried helping. i’m really grateful. now i know the usage of adding an array to an mc, and where to use enterFrame event. i tought the “for” cycle can only work inside of a function. anyway THANKS and many many sales to you guys!
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Sold between 100 000 and 250 000 dollars
- Exclusive Author
- Author was Featured
- Item was Featured
- Beta Tester
- Has been a member for 3-4 years
- Spain
plictis said
thanks pez, but this code duplicates the mc’s, first time on stage and then in the holder. i only need to add the mc’s once.
Well, its the way you had it, so i just kept it!
Nice you got it running.
- Has been a member for 4-5 years
- Author was Featured
- Contributed a Tutorial to a Tuts+ Site
- Netherlands
- Community Moderator
- Microlancer Beta Tester
- Sold between 10 000 and 50 000 dollars
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Exclusive Author
plictis saidI follow..
Hello everybody, so here’s the story: the freelance wasn’t going well lately so i had to get a job
plictis saidAlways a great way to test someone’s skill!
a company recruited me, but instead of an interview they gave me a little test.
plictis saidA dull task, but I guess it should suffice..
the test is converting a stupid game
plictis saidSorry.. what?!
from as3 to as2.
plictis saidAnd so should they! What nonsense converting a game back to AS2 . Why would anyone want to do that? I guess it’s understandable that people still like AS2 and have projects written in it that their stuff needs to work together with, but.. This is just being contra-innovative.
there are 3 years since I’ve stopped working with as2
I hope the projects you’ll be doing for them will just allow you to work with what you’ve worked with for the past 3 years – recent technology
EDIT : I guess I took ages to make that point. This post seemed a lot better in my mind.. 
Ha ha. I was surprised too when i received the test with as2 conversion. A friend of mine, part of Plictis team, also works there and he told me that they are using as2 because they are creating flip-books and as2 it’s the only one compatible with the flip-book program they are using. But hey, for my country it’s well paid job. PS: i still didn’t finish the test, the as2 convention are driving me nuts. 2 hour sleep and 3 cigarette packs. i still have 8 hours, let’s be positive. NOT !!!!
- Author was Featured
- Beta Tester
- Bought between 10 and 49 items
- Exclusive Author
- Grew a moustache for the Envato Movember competition
- Has been a member for 4-5 years
- Item was Featured
- Microlancer Beta Tester
- Referred between 10 and 49 users
i think you totally forgot about as2
or you just learnt as3.
because you were trying to add movieclip to the stage first, then into holder_mc, you can do it with addChild and removeChild in as3 and move same movieclip from root to holder_mc…
but in as2 when you attach a movieclip into root or somewhere, you can’t move it into another movieclp, you need to remove it and attach another one in to the desired one…
so instead of adding it to root and than removing it from root and adding it into holder_mc again, you should directly put it into holder_mc which VF made already…
i am suprised, just he could reply this 
and hope that agency does not see this post of yours (:
Pdesignx said
i think you totally forgot about as2or you just learnt as3.
because you were trying to add movieclip to the stage first, then into holder_mc, you can do it with addChild and removeChild in as3 and move same movieclip from root to holder_mc…
but in as2 when you attach a movieclip into root or somewhere, you can’t move it into another movieclp, you need to remove it and attach another one in to the desired one…
so instead of adding it to root and than removing it from root and adding it into holder_mc again, you should directly put it into holder_mc which VF made already…
i am suprised, just he could reply this
and hope that agency does not see this post of yours (:
+1 we are helping you cheat
- Exclusive Author
- Item was Featured
- Author was Featured
- Author had a File in an Envato Bundle
- Has been a member for 4-5 years
- Sold between 100 000 and 250 000 dollars
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- India
Pdesignx said
and hope that agency does not see this post of yours (:
haha, +1
I think companies would be pleased to see quick learners (with their own efforts) rather depending those who believes “I already know” and without quick learning habits.
