PDA

View Full Version : attachMovieClip random loch


tr394
11-17-2002, 05:48 PM
Hello,
I'm looking to create a flash movie which has the following behavior:
At the beginning mc1 is attached from the library at a random location. When it is clicked mc1 disappears and mc2 is attached randomly. When mc2 is clicked mc3 is attached randomly.
I've been having trouble getting anything to attach randomly. First of all, do I need to use linkage? I'm running flash XP. Secondly, I'm wondering why the following code won't work for the first attachment (it's on the first frame):

attachMovieClip(mc1, mcBlue, 1);
mcBlue._x = random;
mcBlue._y = random;

Any help would be appreciated, thanks!

Tim

farafiro
11-18-2002, 07:22 AM
tr394, welcome here
first of all, what is Flash XP, is it differes than Flash MX :p :D
for the attaching movies from the library, YES you should use the linkage
second, why your code doesn'r working?? for that u didn't tll flash to put the mc in what random numbers, so it should be randome(200) for example.
Also, note that the mc names in any code, and also here in the attachMovie, should be within ""

tr394
11-18-2002, 10:27 PM
thanks for your help.
i must have mistyped when i said xp, i was thinking of my os... yes, i use flash mx just like everyone else and am not privy to some strange new version of flash.
sorry about that...
thanks again for your help farafiro!

take care
tim

farafiro
11-19-2002, 05:21 AM
Originally posted by tr394
...., i was thinking of my os... yes, i use flash mx just like everyone else and am not privy to some strange new version of flash.
sorry about that...
nop, I was just joking and teasing